API reference

PhysicsCollisionCallbackEventArgs Class

Extends EventArgs
Event arguments for physics collision callbacks. Each entity with a listener receives one event when it starts touching another body.

Signature

class PhysicsCollisionCallbackEventArgs(
    val collidedEntity: Entity,
    val collisionPosition: Vector3,
    val collisionNormal: Vector3,
    val impulse: Float,
    datamodel: DataModel,
) : EventArgs

Constructors

PhysicsCollisionCallbackEventArgs ( collidedEntity , collisionPosition , collisionNormal , impulse , datamodel )
Signature
constructor(
    collidedEntity: Entity,
    collisionPosition: Vector3,
    collisionNormal: Vector3,
    impulse: Float,
    datamodel: DataModel,
)
Parameters
collidedEntity: Entity  The other entity in the collision
collisionPosition: Vector3  The world-space position where the bodies first touched
collisionNormal: Vector3  The contact normal, pointing from the receiving entity toward collidedEntity
impulse: Float  An estimate of the impact impulse in newton-seconds, from the bodies' closing speed and masses. It is 0 when the bodies are not moving toward each other.
datamodel: DataModel  The data model instance for event propagation
Returns
PhysicsCollisionCallbackEventArgs

Properties

collidedEntity : Entity
[Get]
The other entity in the collision
Signature
val collidedEntity: Entity
collisionNormal : Vector3
[Get]
The contact normal, pointing from the receiving entity toward PhysicsCollisionCallbackEventArgs.collidedEntity
Signature
val collisionNormal: Vector3
collisionPosition : Vector3
[Get]
The world-space position where the bodies first touched
Signature
val collisionPosition: Vector3
dataModel : DataModel
[Get]
Data model.
Signature
val dataModel: DataModel
eventName : String
[Get]
The string identifier for this event type, used to match registered Entity event listeners. Each EventArgs subclass defines its own event name constant for dispatch routing.
Signature
val eventName: String
handled : Boolean
[Get][Set]
Flag indicating whether this event has been consumed by a listener. Set to true in an event handler to prevent further propagation to other listeners registered for the same event.
Signature
var handled: Boolean
impulse : Float
[Get]
An estimate of the impact impulse in newton-seconds, from the bodies' closing speed and masses. It is 0 when the bodies are not moving toward each other.
Signature
val impulse: Float
throttleTime : Int?
[Get][Set]
Minimum interval in milliseconds between consecutive dispatches of this event type. Events fired more frequently than this interval are silently dropped to prevent listener overload.
Signature
var throttleTime: Int?

Companion Object

Properties

EVENT_NAME : String
[Get]
Signature
val EVENT_NAME: String