PathSettings Path_Settings;
PathMesh Path_mesh;
PathWorld Path_World;
PathObstacle Path_obstacle;
MeshBase base ;
/******************************************************************************/
void InitPre()
{
EE_INIT();
App.flag=APP_MS_EXCLUSIVE;
Cam.dist=3;
}
/******************************************************************************/
bool Init()
{
base.create(3, 0, 1, 0, VTX_TEX0); //
base.vtx.pos (0).set(-1, 0, 0); // set #0 vertex position
base.vtx.pos (1).set( -1, 0, 1); // set #1 vertex position
base.vtx.pos (2).set( 0,0, 0); // set #2 vertex position
base.vtx.tex0(0).set(-1, 0 ); // set #0 vertex texture coordinates
base.vtx.tex0(1).set( 1, 1 ); // set #1 vertex texture coordinates
base.vtx.tex0(2).set( 0,-1 ); // set #2 vertex texture coordinates
base.tri.ind (0).set( 0, 1, 2); // set triangle vertex indexes (#0 #1 #2 vertexes)
base.setNormals(); // set automatic vertex normals
base.setAutoTanBin(); // calculate tangents and binormals if needed
race_path.create((MeshBase&)base, VecI2(0, 0), Path_Settings);
return true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
bool Update()
{
if(Kb.bp(KB_ESC))return false;
Cam.transformByMouse(0.01, 10, CAMH_ZOOM|(Ms.b(1) ? CAMH_MOVE : CAMH_ROT));
return true;
}
/******************************************************************************/
void Render()
{
switch(Renderer())
{
case RM_PREPARE:
{
LightDir(Cam.matrix.z).add();
}break;
}
}
/******************************************************************************/
void Draw()
{
Renderer(Render);
D.text(0, 0.8, S + "Tringles = "+base.tris());
D.text(0, 0.7, S + " Mesh base has data? "+base.is());
D.text(0, 0.5, S + "Path mesh has data? " + Path_mesh.is());
}
/******************************************************************************/