summaryrefslogtreecommitdiffstats
path: root/src/include/video/trail_geometry.h
blob: e6c747bc57ef937b91d15c5d78ccbe56aa0ec454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef TRAIL_GEOMETRY_H
#define TRAIL_GEOMETRY_H

#include "video.h"
#include "game/game.h"

typedef struct {
	vec3* pVertices; // each vertex consists of three floats
	vec3* pNormals; // each normal consists of three float
	vec2* pTexCoords; // each texcoord consists of three float
	unsigned short *pIndices; // each triangle consists of three 16bit indices
	unsigned char *pColors; // each vertex color consists of 4 bytes
	unsigned int iSize;
	unsigned int iUsed;
} TrailMesh;

void storeVertex(TrailMesh *pMesh, int offset, 
								 segment2 *s, float t, float fFloor, float fTop,
								 float fSegLength, float fTotalLength);
void storeIndices(TrailMesh *pMesh, int indexOffset, int vertexOffset);
void trailGeometry(Player *pPlayer, PlayerVisual *pV,
									 TrailMesh *pMesh,
								 int *pVertexOffset, int *pIndexOffset);
void bowGeometry(Player *pPlayer, PlayerVisual *pV,
								 TrailMesh *pMesh,
								 int *pVertexOffset, int *pIndexOffset);
void trailRender(TrailMesh *pMesh);
void trailStatesNormal(Player *pPlayer, int texture);
void trailStatesShadowed(void);
void trailStatesRestore(void);
#endif