Class l2df.class.component.collision
Collisions component.
Inherited from l2df.class.Component class.
Info:
- Copyright: Atom-TM 2020
- Author: Abelidze, Kasai
Functions
Collision:added(obj[, kwargs]) | Component was added to Entity event. |
Collision:collider(obj, col[, action=0]) | Wrap collider with entity and callback function. |
Collision:update(obj, dt) | Collision update event handler. |
Functions
Methods- Collision:added(obj[, kwargs])
-
Component was added to Entity event.
Parameters:
- obj l2df.class.entity Entity's instance.
- kwargs table Keyword arguments. Not actually used. (optional)
- Collision:collider(obj, col[, action=0])
-
Wrap collider with entity and callback function.
Generates new Collider's table.
Parameters:
- obj l2df.class.entity Entity's instance.
-
col
table
Collider's description table.
- kind number or string ID / name of the kind associated with this collider. (default 0)
- x number Collider's box X position. (default 0)
- y number Collider's box Y position. (default 0)
- z number Collider's box Z position. (default 0)
- w number Collider's box width. (default 0)
- h number Collider's box height. (default 0)
- d number Collider's box depth. (default 0)
- action function Callback called when collider is triggered. (optional)
Returns:
- Collision:update(obj, dt)
-
Collision update event handler.
Parameters:
- obj l2df.class.entity Entity's instance.
- dt number Delta-time since last game tick.