Optional
options: BodyComponentOptionsInternal
__oldIndicates whether the old transform has been captured at least once for interpolation
The also known as coefficient of restitution of this actor, represents the amount of energy preserved after collision or the bounciness. If 1, it is 100% bouncy, 0 it completely absorbs.
Can this body sleep, by default bodies do not sleep
Collision type for the rigidbody physics simulation, by default CollisionType.PreventCollision
Optionally list any component types this component depends on If the owner entity does not have these components, new components will be added to the entity
Only components with zero-arg constructors are supported as automatic component dependencies
Enable or disabled the fixed update interpolation, by default interpolation is on.
The coefficient of friction on this actor
The collision group for the body's colliders, by default body colliders collide with everything
Readonly
idDegrees of freedom to limit
Note: this only limits responses in the realistic solver, if velocity/angularVelocity is set the actor will still respond
Gets/sets the acceleration of the actor from the last frame. This does not include the global acc Physics.acc.
The velocity of the actor last frame (vx, vy) in pixels/second
Optional
Readonly
optionalOptional
ownerAmount of "motion" the body has before sleeping. If below Physics.sleepEpsilon it goes to "sleep"
Readonly
typeType of this component, must be a unique type among component types in you game.
Should use global gravity Physics.gravity in it's physics simulation, default is true
Static
_IDReturns if the owner is active
Get the angular velocity in radians/second
Set the angular velocity in radians/second
The (x, y) position of the actor this will be in the middle of the actor if the Actor.anchor is set to (0.5, 0.5) which is default. If you want the (x, y) position to be the top left of the actor specify an anchor of (0, 0).
Get the moment of inertia from the ColliderComponent
Get the inverse moment of inertial from the ColliderComponent. If CollisionType.Fixed this is 0, meaning "infinite" mass
The inverse mass (1/mass) of the body. If CollisionType.Fixed this is 0, meaning "infinite" mass
Gets/sets the rotation of the body from the last frame.
The rotation of the body in radians
Whether this body is sleeping or not
The current torque applied to the actor
Clones any properties on this component, if that property value has a clone()
method it will be called
Optional
onOptional
onUpdate body's BodyComponent.sleepMotion for the purpose of sleeping
Body describes all the physical properties pos, vel, acc, rotation, angular velocity for the purpose of of physics simulation.