![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Data Structures | |
| struct | PHYSICS |
| structure of the physics of an object More... | |
Macros | |
| #define | copy_point(__src_, __dst_) memcpy(__dst_, __src_, sizeof(VECTOR3D)); |
| VECTOR3D copy wrapper. | |
| #define | MOVE_INTER 1 |
| PHYSICS object state for move interpolated between two position. | |
| #define | MOVE_SIMU 2 |
| PHYSICS object state for move simulated from latest update. | |
| #define | MOVE_STOPPED 0 |
| PHYSICS object state for STOPPED. | |
| #define | VECTOR3D_COLLINEAR -1 |
| value when the two VECTOR3D are collinear | |
| #define | VECTOR3D_DO_INTERSECT 0 |
| value when the two VECTOR3D are intersecting | |
| #define | VECTOR3D_DONT_INTERSECT -2 |
| value when the two VECTOR3D are not connected | |
| #define | VECTOR3D_SET(VECTOR, X, Y, Z) |
| helper to set a VECTOR3D position | |
Typedefs | |
| typedef double | VECTOR3D[3] |
| struct of a point | |
Functions | |
| double | distance (VECTOR3D *p1, VECTOR3D *p2) |
| distance between two points | |
| int | update_physics_position (PHYSICS *object, double delta_t) |
| update the position of an object, using the delta time T to update positions | |
| int | update_physics_position_nb (PHYSICS *object, int it, double delta_t) |
| update component[ it ] of a VECTOR3D | |
| int | update_physics_position_reverse (PHYSICS *object, double delta_t) |
| update the position of an object, using the delta time T to reverse update positions | |
| int | update_physics_position_reverse_nb (PHYSICS *object, int it, double delta_t) |
| update component[ it ] of a VECTOR3D, reversed time | |
| double | vector_angle_between (VECTOR3D *vec1, VECTOR3D *vec2) |
| vector angle with other vector | |
| double | vector_dot_product (VECTOR3D *vec1, VECTOR3D *vec2) |
| dot product | |
| int | vector_intersect (VECTOR3D *p0, VECTOR3D *p1, VECTOR3D *p2, VECTOR3D *p3, VECTOR3D *px) |
| compute if two vector are colliding, storing the resulting point in px | |
| double | vector_normalize (VECTOR3D *vec) |
| vector normalize | |
| struct PHYSICS |
structure of the physics of an object
Collaboration diagram for PHYSICS:| Data Fields | ||
|---|---|---|
| VECTOR3D | acceleration | ax,ay,az actual acceleration |
| VECTOR3D | angular_acceleration | rax,ray,raz actual angular acceleration |
| VECTOR3D | angular_speed | rvx,rvy,rvz actual angular speed |
| int | can_jump | ability |
| time_t | delta_t | last delta_t used |
| VECTOR3D | gravity | gx , gy , gz gravity |
| VECTOR3D | orientation | ax,ay,az actual rotation position |
| VECTOR3D | position | x,y,z actual position |
| VECTOR3D | speed | vx,vy,vz actual speed |
| int | sz | size |
| int | type | optionnal type id |
| #define copy_point | ( | __src_, | |
| __dst_ | |||
| ) | memcpy(__dst_, __src_, sizeof(VECTOR3D)); |
| #define MOVE_INTER 1 |
| #define MOVE_SIMU 2 |
| #define VECTOR3D_COLLINEAR -1 |
| #define VECTOR3D_DO_INTERSECT 0 |
| #define VECTOR3D_DONT_INTERSECT -2 |
| #define VECTOR3D_SET | ( | VECTOR, | |
| X, | |||
| Y, | |||
| Z | |||
| ) |
helper to set a VECTOR3D position
| typedef double VECTOR3D[3] |
struct of a point
| int update_physics_position | ( | PHYSICS * | object, |
| double | delta_t | ||
| ) |
update the position of an object, using the delta time T to update positions
update the position of an object, using the delta time T to update positions
Wrapper of update_physics_position_nb to update each component.
| object | The object physics to update |
| delta_t | Elapsed time since last call for component update computing |
Definition at line 105 of file n_3d.c.
References __n_assert, and update_physics_position_nb().
Referenced by manage_particle_ex().
Here is the call graph for this function:
Here is the caller graph for this function:| int update_physics_position_nb | ( | PHYSICS * | object, |
| int | it, | ||
| double | delta_t | ||
| ) |
update component[ it ] of a VECTOR3D
update component[ it ] of a VECTOR3D
| object | The object physics to update |
| it | component of VECTOR3D to update. it values : 0 -> x, 1 -> y , 2 -> z |
| delta_t | Elapsed time since last call for component update computing |
Definition at line 49 of file n_3d.c.
References __n_assert, and acceleration.
Referenced by update_physics_position(), and update_physics_position_reverse().
Here is the caller graph for this function:| int update_physics_position_reverse | ( | PHYSICS * | object, |
| double | delta_t | ||
| ) |
update the position of an object, using the delta time T to reverse update positions
update the position of an object, using the delta time T to reverse update positions
Wrapper of update_physics_position_reverse_nb to update each component.
| object | The object physics to update |
| delta_t | Elapsed time since last call for component update computing |
Definition at line 83 of file n_3d.c.
References __n_assert, and update_physics_position_nb().
Here is the call graph for this function:| int update_physics_position_reverse_nb | ( | PHYSICS * | object, |
| int | it, | ||
| double | delta_t | ||
| ) |
update component[ it ] of a VECTOR3D, reversed time
update component[ it ] of a VECTOR3D, reversed time
| object | The object physics to update |
| it | component of VECTOR3D to update. it values : 0 -> x, 1 -> y , 2 -> z |
| delta_t | Elapsed time since last call for component update computing |
Definition at line 67 of file n_3d.c.
References __n_assert, and acceleration.
vector angle with other vector
vector angle with other vector
| vec1 | first VECTOR3D |
| vec2 | second VECTOR3D |
Definition at line 233 of file n_3d.c.
References vector_dot_product(), and vector_normalize().
Here is the call graph for this function:dot product
dot product
| vec1 | first VECTOR3D |
| vec2 | second VECTOR3D |
Definition at line 210 of file n_3d.c.
Referenced by vector_angle_between().
Here is the caller graph for this function:compute if two vector are colliding, storing the resulting point in px
compute if two vector are colliding, storing the resulting point in px
| p1 | First point of vector 1 |
| p2 | Second point of vector 1 |
| p3 | First point of vector 2 |
| p4 | Second point of vector 2 |
| px | Storage for the eventual point |
Definition at line 133 of file n_3d.c.
References same_sign(), VECTOR3D_COLLINEAR, VECTOR3D_DO_INTERSECT, and VECTOR3D_DONT_INTERSECT.
Here is the call graph for this function:| double vector_normalize | ( | VECTOR3D * | vec | ) |
vector normalize
vector normalize
| vec | VECTOR3D to normalize |
Definition at line 219 of file n_3d.c.
Referenced by vector_angle_between().
Here is the caller graph for this function: