4.6 KiB
Planck.js API Doc › Globals › BodyDef
Interface: BodyDef
Hierarchy
- BodyDef
Index
Properties
- active
- allowSleep
- angle
- angularDamping
- angularVelocity
- awake
- bullet
- fixedRotation
- gravityScale
- linearDamping
- linearVelocity
- position
- type
- userData
Properties
Optional active
• active? : boolean
Defined in src/dynamics/Body.ts:105
Does this body start out active?
Optional allowSleep
• allowSleep? : boolean
Defined in src/dynamics/Body.ts:97
Set this flag to false if this body should never fall asleep. Note that this increases CPU usage.
Optional angle
• angle? : number
Defined in src/dynamics/Body.ts:63
The world angle of the body in radians.
Optional angularDamping
• angularDamping? : number
Defined in src/dynamics/Body.ts:80
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.
Optional angularVelocity
• angularVelocity? : number
Defined in src/dynamics/Body.ts:68
Optional awake
• awake? : boolean
Defined in src/dynamics/Body.ts:101
Is this body initially awake or sleeping?
Optional bullet
• bullet? : boolean
Defined in src/dynamics/Body.ts:92
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.
Optional fixedRotation
• fixedRotation? : boolean
Defined in src/dynamics/Body.ts:84
Should this body be prevented from rotating? Useful for characters.
Optional gravityScale
• gravityScale? : number
Defined in src/dynamics/Body.ts:93
Optional linearDamping
• linearDamping? : number
Defined in src/dynamics/Body.ts:74
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.
Optional linearVelocity
• linearVelocity? : Vec2
Defined in src/dynamics/Body.ts:67
The linear velocity of the body's origin in world co-ordinates.
Optional position
• position? : Vec2
Defined in src/dynamics/Body.ts:59
The world position of the body. Avoid creating bodies at the origin since this can lead to many overlapping shapes.
Optional type
• type? : BodyType
Defined in src/dynamics/Body.ts:54
Body types are static, kinematic, or dynamic. Note: if a dynamic body would have zero mass, the mass is set to one.
Optional userData
• userData? : any
Defined in src/dynamics/Body.ts:106