Nilorea Library
C utilities for networking, threading, graphics
n_3d.h File Reference

Simple 3D movement simulation. More...

#include "n_log.h"
#include "n_common.h"
#include <sys/time.h>
+ Include dependency graph for n_3d.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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. More...
 
#define MOVE_INTER   1
 PHYSICS object state for move interpolated between two position. More...
 
#define MOVE_SIMU   2
 PHYSICS object state for move simulated from latest update. More...
 
#define MOVE_STOPPED   0
 PHYSICS object state for STOPPED. More...
 
#define VECTOR3D_COLLINEAR   -1
 value when the two VECTOR3D are collinear More...
 
#define VECTOR3D_DO_INTERSECT   0
 value when the two VECTOR3D are intersecting More...
 
#define VECTOR3D_DONT_INTERSECT   -2
 value when the two VECTOR3D are not connected More...
 
#define VECTOR3D_SET(VECTOR, X, Y, Z)
 helper to set a VECTOR3D position More...
 

Typedefs

typedef double VECTOR3D[3]
 struct of a point More...
 

Functions

double distance (VECTOR3D *p1, VECTOR3D *p2)
 compute the distance between two VECTOR3D points More...
 
int update_physics_position (PHYSICS *object, double delta_t)
 Update object position, reversed. More...
 
int update_physics_position_nb (PHYSICS *object, int it, double delta_t)
 Update object position componant. More...
 
int update_physics_position_reverse (PHYSICS *object, double delta_t)
 Update object position, reversed. More...
 
int update_physics_position_reverse_nb (PHYSICS *object, int it, double delta_t)
 Update object position componant, reversed. More...
 
double vector_angle_between (VECTOR3D *vec1, VECTOR3D *vec2)
 Compute angle beteen two VECTOR3D. More...
 
double vector_dot_product (VECTOR3D *vec1, VECTOR3D *vec2)
 Compute the dot product of two VECTOR3D. More...
 
int vector_intersect (VECTOR3D *p0, VECTOR3D *p1, VECTOR3D *p2, VECTOR3D *p3, VECTOR3D *px)
 Compute if two vectors are intersecting or not. More...
 
double vector_normalize (VECTOR3D *vec)
 Return the normalized value of vec. More...
 

Detailed Description

Simple 3D movement simulation.

Author
Castagnier Mickael
Version
1.0
Date
30/04/2014

Definition in file n_3d.h.