Body |
Index
Properties
ancestor
bounce
bounce: number
bounds
collisionType
collisionType: number
Readonlyfalling
falling: boolean
force
friction
gravityScale
gravityScale: number
ignoreGravity
ignoreGravity: boolean
ReadonlyisStatic
isStatic: boolean
Readonlyjumping
jumping: boolean
mass
mass: number
maxVel
onBodyUpdate
onBodyUpdate: Function | undefined
vel
Methods
addShape
Returns number
the shape array length
addVertices
contains
Returns boolean
true if contains
forEach
Parameters
- callback: Function
OptionalthisArg: object
Returns void
fromJSON
Parameters
- json: object
Optionalid: string
Returns number
how many shapes were added to the body
getBounds
Returns Bounds
bounding box Rectangle object
getShape
removeShape
Returns number
the shape array length
removeShapeAt
Returns number
the shape array length
respondToCollision
Returns void
rotate
setCollisionMask
Parameters
Optionalbitmask: number = collision.types.ALL_OBJECT
Returns void
setCollisionType
Returns void
setFriction
Parameters
- x: number = 0
- y: number = 0
Returns void
setMaxVelocity
Parameters
- x: number
- y: number
Returns void
setStatic
Parameters
OptionalisStatic: boolean = true
Returns void
setVertices
Protectedupdate
ProtectedReturns boolean
true if resulting velocity is different than 0