20 #ifndef __OPC_MESHINTERFACE_H__ 21 #define __OPC_MESHINTERFACE_H__ 29 const Point& p0 = *Vertex[0];
30 const Point& p1 = *Vertex[1];
31 const Point& p2 = *Vertex[2];
34 Point Normal = (p2 - p1)^(p0 - p1);
37 return (Normal | (source - p0)) >= 0.0
f;
41 #ifdef OPC_USE_CALLBACKS 65 #ifdef OPC_USE_CALLBACKS 75 bool SetCallback(RequestCallback callback,
void* user_data);
77 inline_ void* GetUserData()
const {
return mUserData; }
78 inline_ RequestCallback GetCallback()
const {
return mObjCallback; }
107 inline_ udword GetVertexStride()
const {
return mVertexStride; }
120 #ifdef OPC_USE_CALLBACKS 121 (mObjCallback)(index, vp, mUserData);
123 #ifdef OPC_USE_STRIDE 132 for (
int i = 0;
i < 3;
i++){
133 const double* v = (
const double*)(((
ubyte*)mVerts) + T->
mVRef[
i] * mVertexStride);
135 VertexCache[
i].
x = (float)v[0];
136 VertexCache[
i].y = (float)v[1];
137 VertexCache[
i].z = (float)v[2];
157 bool RemapClient(
udword nb_indices,
const udword* permutation)
const;
165 bool IsValid()
const;
174 udword CheckTopology()
const;
180 #ifdef OPC_USE_CALLBACKS 183 RequestCallback mObjCallback;
188 #ifdef OPC_USE_STRIDE 199 #endif //__OPC_MESHINTERFACE_H__ bool BackfaceCulling(const Point &source)
const IndexedTriangle * mTris
Array of indexed triangles.
udword mNbTris
Number of triangles in the input model.
udword mVRef[3]
Vertex-references.
inline_ void SetNbVertices(udword nb)
const Point * mVerts
Array of vertices.
inline_ udword GetNbTriangles() const
udword mNbVerts
Number of vertices in the input model.
unsigned int udword
sizeof(udword) must be 4
inline_ void SetNbTriangles(udword nb)
typedef void(PNGAPI *png_error_ptr) PNGARG((png_structp
unsigned char ubyte
sizeof(ubyte) must be 1
inline_ udword GetNbVertices() const
inline_ const Point * GetVerts() const
bool Single
Use single or double precision vertices.
inline_ const IndexedTriangle * GetTris() const