libmove3d
3.13.0
|
00001 00002 #ifndef VOLINT_H 00003 #define VOLINT_H 00004 00005 /* 00006 ============================================================================ 00007 macros 00008 ============================================================================ 00009 */ 00010 00011 #define SQR(x) ((x)*(x)) 00012 #define CUBE(x) ((x)*(x)*(x)) 00013 00014 /* 00015 ============================================================================ 00016 constants 00017 ============================================================================ 00018 */ 00019 00020 #define MAX_VERTS 10000 /* maximum number of polyhedral vertices */ 00021 #define MAX_FACES 20000 /* maximum number of polyhedral faces */ 00022 #define MAX_POLYGON_SZ 3 /* maximum number of verts per polygonal face */ 00023 00024 //#define X 0 00025 //#define Y 1 00026 //#define Z 2 00027 00028 00029 /* 00030 ============================================================================ 00031 data structures 00032 ============================================================================ 00033 */ 00034 00035 typedef struct { 00036 int numVerts; 00037 double norm[3]; 00038 double w; 00039 int verts[MAX_POLYGON_SZ]; 00040 struct VOLINT_POLYHEDRON *poly; 00041 } VOLINT_FACE; 00042 00043 typedef struct VOLINT_POLYHEDRON { 00044 int numVerts, numFaces; 00045 double verts[MAX_VERTS][3]; 00046 VOLINT_FACE faces[MAX_FACES]; 00047 } VOLINT_POLYHEDRON; 00048 00049 00050 typedef struct Mass_properties{ 00051 double mass, volume, density; 00052 double r[3]; /* center of mass */ 00053 double J[3][3]; /* inertia tensor */ 00054 } Mass_properties; 00055 00056 00057 #endif