new CollisionDataContainer() → {platypus.CollisionDataContainer}
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.
- Source:
Methods
(static) recycle(CollisionDataContainer)
Returns a CollisionDataContainer back to the cache.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
CollisionDataContainer |
platypus.CollisionDataContainer
|
The CollisionDataContainer to be recycled. |
(static) setUp() → {platypus.CollisionDataContainer}
Returns an CollisionDataContainer from cache or creates a new one if none are available.
- Source:
recycle()
Relinquishes properties of the CollisionDataContainer and recycles it.
- Source:
resetX(delta)
Resets the X axis.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
delta |
Number
|
The delta value of the X-axis. |
resetY(delta)
Resets the Y axis.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
delta |
Number
|
The delta value of the Y-axis. |
tryToAddX(collisionData) → {Boolean}
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.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
collisionData |
platypus.CollisionData
|
The collision data to add. |
Returns:
- Type:
-
Boolean
Whether the collision data was added.
tryToAddY(collisionData) → {Boolean}
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.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
collisionData |
platypus.CollisionData
|
The collision data to add. |
Returns:
- Type:
-
Boolean
Whether the collision data was added.