![]() |
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) |
| compute the distance between two VECTOR3D points | |
| int | update_physics_position (PHYSICS *object, double delta_t) |
| Update object position, reversed. | |
| int | update_physics_position_nb (PHYSICS *object, int it, double delta_t) |
| Update object position component. | |
| int | update_physics_position_reverse (PHYSICS *object, double delta_t) |
| Update object position, reversed. | |
| int | update_physics_position_reverse_nb (PHYSICS *object, int it, double delta_t) |
| Update object position component, reversed. | |
| double | vector_angle_between (VECTOR3D *vec1, VECTOR3D *vec2) |
| Compute angle between two VECTOR3D. | |
| double | vector_dot_product (VECTOR3D *vec1, VECTOR3D *vec2) |
| Compute the dot product of two VECTOR3D. | |
| int | vector_intersect (VECTOR3D *p0, VECTOR3D *p1, VECTOR3D *p2, VECTOR3D *p3, VECTOR3D *px) |
| Compute if two vectors are intersecting or not. | |
| double | vector_normalize (VECTOR3D *vec) |
| Return the normalized value of vec. | |
| 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
| int update_physics_position | ( | PHYSICS * | object, |
| double | delta_t | ||
| ) |
Update object position, reversed.
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 86 of file n_3d.c.
References 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 object position component.
| 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 31 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 object position, reversed.
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 65 of file n_3d.c.
References 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 object position component, reversed.
| 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.
Compute angle between two VECTOR3D.
| vec1 | first VECTOR3D |
| vec2 | second VECTOR3D |
Definition at line 213 of file n_3d.c.
References vector_dot_product(), and vector_normalize().
Here is the call graph for this function:Compute the dot product of two VECTOR3D.
| vec1 | first VECTOR3D |
| vec2 | second VECTOR3D |
Definition at line 190 of file n_3d.c.
Referenced by vector_angle_between().
Here is the caller graph for this function:Compute if two vectors are intersecting or not.
| 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 113 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 | ) |
Return the normalized value of vec.
| vec | VECTOR3D to normalize |
Definition at line 199 of file n_3d.c.
Referenced by vector_angle_between().
Here is the caller graph for this function: