|
Trace Engine
A Raycaster Engine in C
|
Functions | |
| trc_world_position_t | get_collision_axis (const trc_transform_t transform, const trc_world_position_t velocity) |
| void | move_and_collide (trc_transform_t *transform, const trc_world_position_t velocity) |
| void | move_and_slide (trc_transform_t *transform, const trc_world_position_t velocity) |
| void | rotate_transform (trc_transform_t *transform, const float rotation_delta) |
| trc_world_position_t get_collision_axis | ( | const trc_transform_t | transform, |
| const trc_world_position_t | velocity | ||
| ) |
Utility function only visible for transform_t
It returns the given velocity but masked with the current collision status
For example, if a collision for the given transform is happening in the x axis, but not in the y axis, and velocity is (a, b), the returning vale will be (0, b). If no collision is detected, the function will return (a, b), and so on.
| void move_and_collide | ( | trc_transform_t * | transform, |
| const trc_world_position_t | velocity | ||
| ) |
Moves the given transform in the specified direction, unless there is a wall within a distance equal to the transform's size
If that occurs, the transform will stop moving entirely
The velocity vector specifies both the direction and the speed of the transform
| void move_and_slide | ( | trc_transform_t * | transform, |
| const trc_world_position_t | velocity | ||
| ) |
Moves the given transform in the specified direction, unless there is a wall within a distance equal to the transform's size
If that occurs, the transform will slide across the wall (losing velocity according with the collision angle)
The velocity vector specifies both the direction and the speed of the transform
| void rotate_transform | ( | trc_transform_t * | transform, |
| const float | rotation_delta | ||
| ) |
Rotates the transform direction in the given signed angle