#include "orpyfbsdk_common.h"
ORModelUser::ORModelUser(
const char* pName,
HIObject pObject ) : FBModel( pName, pObject )
{
}
bool ORModelUser::FBCreate()
{
CreateGeometry ();
return true;
}
void ORModelUser::FBDestroy()
{
ParentClass::FBDestroy();
}
void ORModelUser::CreateGeometry()
{
FBMesh* lMesh = new FBMesh("Model Custom");
this->Geometry = lMesh;
int P0a,P0e,P0d;
int P1a,P1b,P1e;
int P2a,P2b,P2c;
int P3a,P3c,P3d;
int P4d,P4e,P4f;
int P5b,P5e,P5f;
int P6b,P6c,P6f;
int P7c,P7d,P7f;
lMesh->GeometryBegin();
lMesh->VertexInit(24, false, true);
lMesh->VertexNormalSet(0.0,-1.0,0.0);
lMesh->VertexUVSet(0.0,0.0);
P0a = lMesh->VertexAdd( 0.0, 0.0, 0.0 );
lMesh->VertexUVSet(0.0,1.0);
P1a = lMesh->VertexAdd( 0.0, 0.0, len );
lMesh->VertexUVSet(1.0,0.0);
P2a = lMesh->VertexAdd( len, 0.0, len );
lMesh->VertexUVSet(1.0,1.0);
P3a = lMesh->VertexAdd( len, 0.0, 0.0 );
lMesh->VertexNormalSet(0,0,1);
lMesh->VertexUVSet(0.0,0.0);
P1b = lMesh->VertexAdd( 0.0, 0.0, len );
lMesh->VertexUVSet(1.0,0.0);
P2b = lMesh->VertexAdd( len, 0.0, len );
lMesh->VertexUVSet(0.0,1.0);
P5b = lMesh->VertexAdd( 0.0, len, len );
lMesh->VertexUVSet(1.0,0.5);
P6b = lMesh->VertexAdd( len, len, len );
lMesh->VertexNormalSet(1,0,0);
P2c = lMesh->VertexAdd( len, 0.0, len );
P3c = lMesh->VertexAdd( len, 0.0, 0.0 );
P6c = lMesh->VertexAdd( len, len, len );
P7c = lMesh->VertexAdd( len, len, 0.0 );
lMesh->VertexNormalSet(0,0,-1);
P0d = lMesh->VertexAdd( 0.0, 0.0, 0.0 );
P3d = lMesh->VertexAdd( len, 0.0, 0.0 );
P7d = lMesh->VertexAdd( len, len, 0.0 );
P4d = lMesh->VertexAdd( 0.0, len, 0.0 );
lMesh->VertexNormalSet(-1,0,0);
P0e = lMesh->VertexAdd( 0.0, 0.0, 0.0 );
P1e = lMesh->VertexAdd( 0.0, 0.0, len );
P4e = lMesh->VertexAdd( 0.0, len, 0.0 );
P5e = lMesh->VertexAdd( 0.0, len, len );
lMesh->VertexNormalSet(0,1,0);
P4f = lMesh->VertexAdd( 0.0, len, 0.0 );
P5f = lMesh->VertexAdd( 0.0, len, len );
P6f = lMesh->VertexAdd( len, len, len );
P7f = lMesh->VertexAdd( len, len, 0.0 );
lMesh->PolygonBegin();
lMesh->PolygonVertexAdd(P0a);
lMesh->PolygonVertexAdd(P3a);
lMesh->PolygonVertexAdd(P2a);
lMesh->PolygonVertexAdd(P1a);
lMesh->PolygonEnd();
lMesh->PolygonBegin();
lMesh->PolygonVertexAdd(P1b);
lMesh->PolygonVertexAdd(P2b);
lMesh->PolygonVertexAdd(P6b);
lMesh->PolygonVertexAdd(P5b);
lMesh->PolygonEnd();
lMesh->PolygonBegin();
lMesh->PolygonVertexAdd(P2c);
lMesh->PolygonVertexAdd(P3c);
lMesh->PolygonVertexAdd(P7c);
lMesh->PolygonVertexAdd(P6c);
lMesh->PolygonEnd();
lMesh->PolygonBegin();
lMesh->PolygonVertexAdd(P0d);
lMesh->PolygonVertexAdd(P4d);
lMesh->PolygonVertexAdd(P7d);
lMesh->PolygonVertexAdd(P3d);
lMesh->PolygonEnd();
lMesh->PolygonBegin();
lMesh->PolygonVertexAdd(P1e);
lMesh->PolygonVertexAdd(P5e);
lMesh->PolygonVertexAdd(P4e);
lMesh->PolygonVertexAdd(P0e);
lMesh->PolygonEnd();
lMesh->PolygonBegin();
lMesh->PolygonVertexAdd(P4f);
lMesh->PolygonVertexAdd(P5f);
lMesh->PolygonVertexAdd(P6f);
lMesh->PolygonVertexAdd(P7f);
lMesh->PolygonEnd();
lMesh->GeometryEnd();
}
bool ORModelUser::FbxStore(FBFbxObject* pFbxObject,
kFbxObjectStore pStoreWhat)
{
return true;
}
bool ORModelUser::FbxRetrieve(FBFbxObject* pFbxObject,
kFbxObjectStore pStoreWhat)
{
return true;
}