Appearance
Interface: BodyDef
Properties
active?
optionalactive:boolean
Does this body start out active?
allowSleep?
optionalallowSleep:boolean
Set this flag to false if this body should never fall asleep. Note that this increases CPU usage.
angle?
optionalangle:number
The world angle of the body in radians.
angularDamping?
optionalangularDamping:number
Angular damping is use to reduce the angular velocity. The damping parameter can be larger than 1.0 but the damping effect becomes sensitive to the time step when the damping parameter is large. Units are 1/time
angularVelocity?
optionalangularVelocity:number
awake?
optionalawake:boolean
Is this body initially awake or sleeping?
bullet?
optionalbullet:boolean
Is this a fast moving body that should be prevented from tunneling through other moving bodies? Note that all bodies are prevented from tunneling through kinematic and static bodies. This setting is only considered on dynamic bodies. Warning: You should use this flag sparingly since it increases processing time.
fixedRotation?
optionalfixedRotation:boolean
Should this body be prevented from rotating? Useful for characters.
gravityScale?
optionalgravityScale:number
linearDamping?
optionallinearDamping:number
Linear damping is use to reduce the linear velocity. The damping parameter can be larger than 1.0 but the damping effect becomes sensitive to the time step when the damping parameter is large. Units are 1/time
linearVelocity?
optionallinearVelocity:Vec2Value
The linear velocity of the body's origin in world co-ordinates.
position?
optionalposition:Vec2Value
The world position of the body. Avoid creating bodies at the origin since this can lead to many overlapping shapes.
style?
optionalstyle:Style
Styling for dev-tools.
type?
optionaltype:BodyType
Body types are static, kinematic, or dynamic. Note: if a dynamic body would have zero mass, the mass is set to one.
userData?
optionaluserData:any