Module m.kinematic

Utility functions for working with kinematic collision objects

Functions

handle_geometry_contact (correction, normal, distance, id) Handle geometry contact (ie collision) by separating this object from the collision.
look_at (look_at_position, id) Set rotation around z-axis in such a way that the game object is facing a specific position
rotate (angle, id) Rotate around the z-axis
set_rotation (angle, id) Set the absolute rotation around z-axis
forward (amount, id) Move forward in the current direction of rotation around z-axis
backwards (amount, id) Move backwards in the current direction of rotation around z-axis
create () Create a wrapper for a kinematic collision object


Functions

handle_geometry_contact (correction, normal, distance, id)
Handle geometry contact (ie collision) by separating this object from the collision.

Parameters:

  • correction Aggregated correction vector (for when dealing with multiple collisions per frame)
  • normal Collision normal (as provided from a contact_point_response message)
  • distance Collision distance/overlap
  • id Optional id of the game object to separate
look_at (look_at_position, id)
Set rotation around z-axis in such a way that the game object is facing a specific position

Parameters:

  • look_at_position The position to look at
  • id Optional id of the game object to rotate
rotate (angle, id)
Rotate around the z-axis

Parameters:

  • angle Amount to rotate in radians
  • id Optional id of the game object to rotate
set_rotation (angle, id)
Set the absolute rotation around z-axis

Parameters:

  • angle Angle in radians (use math.rad(deg) to convert from degrees to radians)
  • id Optional id of the game object to rotate
forward (amount, id)
Move forward in the current direction of rotation around z-axis

Parameters:

  • amount Distance to move
  • id Optional id of the game object to move
backwards (amount, id)
Move backwards in the current direction of rotation around z-axis

Parameters:

  • amount Distance to move
  • id Optional id of the game object to move
create ()
Create a wrapper for a kinematic collision object
generated by LDoc 1.4.6 Last updated 2017-11-27 06:48:33