Physik-Engine angefangen.

Lightmaps implementiert.
This commit is contained in:
neoraider 2006-10-20 12:57:05 +00:00
parent f5ef6536cc
commit 1021d32f7c
13 changed files with 141 additions and 100 deletions

View file

@ -1,7 +1,7 @@
#ifndef NEOFX_COLLISION_H
#define NEOFX_COLLISION_H
#include "types.h"
#include <neofx/types.h>
int CollisionPointTriangle(VERTEX, TRIANGLE);
int CollisionRayTriangle(VERTEX, VECTOR, TRIANGLE, float*);

View file

@ -1,7 +1,7 @@
#ifndef NEOFX_MATH_H
#define NEOFX_MATH_H
#include "types.h"
#include <neofx/types.h>
float VectorDot(VECTOR, VECTOR);
VECTOR VectorCross(VECTOR, VECTOR);

9
neofx/physics.h Normal file
View file

@ -0,0 +1,9 @@
#ifndef NEOFX_PHYSICS_H
#define NEOFX_PHYSICS_H
#include <neofx/types.h>
void SetGravitation(VECTOR);
void ApplyPhysics(OBJECT, float);
#endif

View file

@ -1,15 +1,14 @@
#ifndef NEOFX_TYPES_H
#define NEOFX_TYPES_H
#pragma pack(push, 2)
typedef union _MATRIX {
float m[4][4];
float f[16];
} MATRIX;
typedef struct _VECTOR_VERTEX {
typedef struct _VECTOR_VERTEX_ROTATION {
float x, y, z;
} VECTOR, VERTEX;
} VECTOR, VERTEX, ROTATION;
typedef struct _TEXCOORDS {
float s, t;
@ -19,6 +18,13 @@ typedef struct _TRIANGLE {
VERTEX vertices[3];
VECTOR normal;
} TRIANGLE;
#pragma pack(pop)
typedef struct _OBJECT {
VERTEX pos;
VECTOR move;
ROTATION rot;
float air_resistance;
float bounce;
} OBJECT;
#endif