Class l2df.class.component.collision

Last updated 2021-05-28 15:24:22

Collisions component.

Inherited from l2df.class.Component class.

Info:

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:

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:

    l2df.manager.physix.Collider
Collision:update(obj, dt)
Collision update event handler.

Parameters:

  • obj l2df.class.entity Entity's instance.
  • dt number Delta-time since last game tick.