Ive got my physics to a place where I'm ready to try getting terrain collision going again, so I'm going to try out Spintz now. I'll let you know how it goes.
Okay, problems with initial build. Figure its best to ask you directly how these things were modified (especially with the Mesh stuff).
Firstly, my function for loading Mesh data into OPAL:
Code: Select all
bool IRRtoOPAL_AddMeshBufferToSolid( opal::Solid* solid, irr::scene::IMeshBuffer * meshBuffer ) {
opal::MeshShapeData meshData;
meshData.numVertices = 0;
meshData.numTriangles = 0;
meshData.numVertices = meshBuffer->getVertexCount();
meshData.numTriangles = meshBuffer->getIndexCount()/3;
meshData.vertexArray = new opal::real[3 * meshData.numVertices];
meshData.triangleArray = new unsigned int[3 * meshData.numTriangles];
// Copy vertex data.
irr::video::S3DVertex* normVerts = (irr::video::S3DVertex*)(meshBuffer->getVertices());
irr::video::S3DVertex2TCoords* txrVerts = (irr::video::S3DVertex2TCoords*)(meshBuffer->getVertices());
irr::video::S3DVertexTangents* tangyVerts = (irr::video::S3DVertexTangents*)(meshBuffer->getVertices());
for(unsigned int i = 0; i < meshBuffer->getVertexCount(); ++i)
{
switch(meshBuffer->getVertexType())
{
case irr::video::EVT_STANDARD:
{
meshData.vertexArray[3 * i + 0] = normVerts[i].Pos.X;
meshData.vertexArray[3 * i + 1] = normVerts[i].Pos.Y;
meshData.vertexArray[3 * i + 2] = normVerts[i].Pos.Z;
}
break;
case irr::video::EVT_2TCOORDS:
{
meshData.vertexArray[3 * i + 0] = txrVerts[i].Pos.X;
meshData.vertexArray[3 * i + 1] = txrVerts[i].Pos.Y;
meshData.vertexArray[3 * i + 2] = txrVerts[i].Pos.Z;
}
break;
case irr::video::EVT_TANGENTS:
{
meshData.vertexArray[3 * i + 0] = tangyVerts[i].Pos.X;
meshData.vertexArray[3 * i + 1] = tangyVerts[i].Pos.Y;
meshData.vertexArray[3 * i + 2] = tangyVerts[i].Pos.Z;
}
break;
default:
{
// you will need to handle the vertex type
assert(false);
}
break;
}
}
// Copy triangle data.
uint16* meshIndices = (uint16*)meshBuffer->getIndices();
for (unsigned int i = 0; i < meshData.numTriangles; ++i)
{
meshData.triangleArray[i*3 + 0] = meshIndices[i*3 + 0];
meshData.triangleArray[i*3 + 1] = meshIndices[i*3 + 1];
meshData.triangleArray[i*3 + 2] = meshIndices[i*3 + 2];
}
solid->addShape(meshData);
return true;
}
Which (when I switch to IrrSpintz) results in compile errors:
Code: Select all
c:\IrrlichtRPG\src\IrrlichtRPG\Physics\IrrToOPAL.cpp(30): error C2039: 'S3DVertex2TCoords' : is not a member of 'irr::video'
c:\IrrlichtRPG\src\IrrlichtRPG\Physics\IrrToOPAL.cpp(30): error C2065: 'S3DVertex2TCoords' : undeclared identifier
c:\IrrlichtRPG\src\IrrlichtRPG\Physics\IrrToOPAL.cpp(30): error C2065: 'txrVerts' : undeclared identifier
c:\IrrlichtRPG\src\IrrlichtRPG\Physics\IrrToOPAL.cpp(30): error C2296: '*' : illegal, left operand has type ''unknown-type''
c:\IrrlichtRPG\src\IrrlichtRPG\Physics\IrrToOPAL.cpp(30): error C2297: '*' : illegal, right operand has type ''unknown-type''
c:\IrrlichtRPG\src\IrrlichtRPG\Physics\IrrToOPAL.cpp(30): error C2039: 'S3DVertex2TCoords' : is not a member of 'irr::video'
c:\IrrlichtRPG\src\IrrlichtRPG\Physics\IrrToOPAL.cpp(30): error C2059: syntax error : ')'
c:\IrrlichtRPG\src\IrrlichtRPG\Physics\IrrToOPAL.cpp(44): error C2039: 'EVT_2TCOORDS' : is not a member of 'irr::video'
c:\IrrlichtRPG\src\IrrlichtRPG\Physics\IrrToOPAL.cpp(44): error C2065: 'EVT_2TCOORDS' : undeclared identifier
How exactly did you change the internal representation of the mesh?