Libneofx von Libzoom abgespalten
This commit is contained in:
commit
ad0845d0bd
26 changed files with 35951 additions and 0 deletions
11
neofx/collision.h
Normal file
11
neofx/collision.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#ifndef NEOFX_COLLISION_H
|
||||
#define NEOFX_COLLISION_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
int CollisionPointTriangle(VERTEX, TRIANGLE);
|
||||
int CollisionRayTriangle(VERTEX, VECTOR, TRIANGLE, float*);
|
||||
int CollisionSphereTriangle(VERTEX, float,TRIANGLE);
|
||||
int CollisionMovingSphereTriangle(VERTEX, float, VECTOR, float, TRIANGLE);
|
||||
|
||||
#endif
|
21
neofx/math.h
Normal file
21
neofx/math.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#ifndef NEOFX_MATH_H
|
||||
#define NEOFX_MATH_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
float VectorDot(VECTOR, VECTOR);
|
||||
VECTOR VectorCross(VECTOR, VECTOR);
|
||||
VECTOR VectorSub(VECTOR, VECTOR);
|
||||
VECTOR VectorAdd(VECTOR, VECTOR);
|
||||
VECTOR VectorMul(VECTOR, float);
|
||||
VECTOR VectorNormalize(VECTOR);
|
||||
VECTOR VectorNeg(VECTOR);
|
||||
float VectorLength(VECTOR);
|
||||
float VectorLengthSq(VECTOR);
|
||||
int VectorEqual(VECTOR, VECTOR);
|
||||
MATRIX MatrixMul(MATRIX, MATRIX);
|
||||
MATRIX MatrixIdentity();
|
||||
MATRIX VectorMatrix(VERTEX, VECTOR, VERTEX, VECTOR);
|
||||
VECTOR VectorMatrixMul(VECTOR, MATRIX);
|
||||
|
||||
#endif
|
28
neofx/types.h
Normal file
28
neofx/types.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#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 {
|
||||
float x, y, z;
|
||||
} VECTOR, VERTEX;
|
||||
|
||||
typedef struct _TEXCOORDS {
|
||||
float s, t;
|
||||
} TEXCOORDS;
|
||||
|
||||
typedef struct _TRIANGLE {
|
||||
unsigned char type;
|
||||
unsigned char visible;
|
||||
VERTEX vertices[3];
|
||||
VECTOR normal;
|
||||
int texture;
|
||||
TEXCOORDS texcoords[3];
|
||||
} TRIANGLE;
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif
|
Reference in a new issue