API Docs for:
Show:

Collidable Class

A component class which holds the collision properties of an entity.

Constructor

Collidable

(
  • restitution
  • friction
  • category
  • collideWith
)

Parameters:

  • restitution Number
  • friction Number
  • category Number

    A set of bit flags that describe the entity's collision category. The number will be converted to a 32bit long integer and used to check whether the object should collide with other objects.

  • collideWith Number

    A set of bit flags that describe collision categories that this entity will collide with. The number will be converted to a 32bit long integer and used to check whether the object should collide with other objects.

Methods

getCategory

() Number

Returns:

Number:

getCollideWith

() Number

Returns:

Number:

getFriction

() Number

Returns:

Number:

getRestitution

() Number

Returns:

Number:

setCategory

(
  • category
)

A set of bit flags that describe the entity's collision category. The number will be converted to a 32bit long integer and used to check whether the object should collide with other objects.

Parameters:

  • category Number

setCollideWith

(
  • collideWith
)

A set of bit flags that describe collision categories that this entity will collide with. The number will be converted to a 32bit long integer and used to check whether the object should collide with other objects.

Parameters:

  • collideWith Number

setFriction

(
  • friction
)

Parameters:

  • friction Number

setRestitution

(
  • restitution
)

Parameters:

  • restitution Number