API Documentation for: 0.11.8
Show:

platypus.CollisionDataContainer Class

CollisionDataContainer holds lists of CollisionData passed to entities during collisions with other entities. This class is primarily used by the "HandlerCollision" Component to trigger messages on child entities as collisions occur.

Constructor

platypus.CollisionDataContainer

() platypus.CollisionDataContainer

Returns:

platypus.CollisionDataContainer:

Returns the new aabb object.

Methods

CollisionDataContainer.recycle

(
  • CollisionDataContainer
)

Defined in CollisionDataContainer.recycle:116

Available since 0.8.7

Returns a CollisionDataContainer back to the cache.

Parameters:

CollisionDataContainer.setUp

() platypus.CollisionDataContainer

Defined in CollisionDataContainer.setUp:109

Available since 0.8.7

Returns an CollisionDataContainer from cache or creates a new one if none are available.

Returns:

platypus.CollisionDataContainer:

The instantiated CollisionDataContainer.

recycle

()

Defined in recycle:123

Available since 0.8.7

Relinquishes properties of the CollisionDataContainer and recycles it.

reset

()

Defined in reset:63

Resets the X and Y axes.

resetX

(
  • delta
)

Defined in resetX:73

Available since 0.8.7

Resets the X axis.

Parameters:

  • delta Number

    The delta value of the X-axis.

resetY

(
  • delta
)

Defined in resetY:91

Available since 0.8.7

Resets the Y axis.

Parameters:

  • delta Number

    The delta value of the Y-axis.

tryToAddX

(
  • collisionData
)
Boolean

Defined in tryToAddX:25

Adds a CollisionData object to the container's X-axis if the movement distance is less than or equal to collision data collected so far.

Parameters:

Returns:

Boolean:

Whether the collision data was added.

tryToAddY

(
  • collisionData
)
Boolean

Defined in tryToAddY:44

Adds a CollisionData object to the container's Y-axis if the movement distance is less than or equal to collision data collected so far.

Parameters:

Returns:

Boolean:

Whether the collision data was added.