|
Trace Engine
A Raycaster Engine in C
|
#include "trigonometry.h"#include "log.h"#include "trc_world_position.h"#include <math.h>#include <stdio.h>Functions | |
| char * | trc_world_position_to_string_with_name (const trc_world_position_t pos, const char *pos_name) |
| float | distance_between (const trc_world_position_t p1, const trc_world_position_t p2) |
| float | vector_length (const trc_world_position_t vector) |
| trc_world_position_t | normalize_vector (const trc_world_position_t vector) |
| trc_world_position_t | scalar_multiplication (const trc_world_position_t vector, const float scalar) |
| float | angle_from_vector (trc_world_position_t vector) |
| float | adjust_angle (const float angle) |
| bool | are_equals (const float f1, const float f2) |
| float adjust_angle | ( | const float | angle | ) |
Returns the angle so it's in the range of 0 to 2*PI
| angle | The angle to adjust, in radians |
| float angle_from_vector | ( | trc_world_position_t | vector | ) |
Use the position given as a vector, and returns it's angle
| bool are_equals | ( | const float | f1, |
| const float | f2 | ||
| ) |
Returns if the first float is equal to the second
| f1 | First float |
| f2 | Second float |
| float distance_between | ( | const trc_world_position_t | p1, |
| const trc_world_position_t | p2 | ||
| ) |
Returns the distance between p1 and p2
| p1 | First point |
| p2 | Second point |
| trc_world_position_t normalize_vector | ( | const trc_world_position_t | vector | ) |
Returns the normalized vector
| trc_world_position_t scalar_multiplication | ( | const trc_world_position_t | vector, |
| const float | scalar | ||
| ) |
Returns the given vector scaled by the given factor
| char * trc_world_position_to_string_with_name | ( | const trc_world_position_t | pos, |
| const char * | pos_name | ||
| ) |
| float vector_length | ( | const trc_world_position_t | vector | ) |
Returns the distance between the origin and the given vector