Original Post
Hello there. I have trying to make some sort of collision test agains some world objects, in this case the objects are 3ds models. This is what I have done so far. 1. Get my position. 2. Loop through all the models. 3. Loop through all the objects in the model. 4. Loop through all the Faces in the current object. 5. Made a Vector that holds the current vertex from current object. 6. Then try make some collision here. Well like I said how can I make the collision test agains my position and the vPoly ? if anyone know and can help me I will be realy glad. Thanks alot!
//Model Collision
Vector3 vPoly[3], pPos;
pPos = m_game.GetMyPosition();
vector<PhysicObjects>::iterator itr;
for( itr = pPhysicObjList.begin(); itr != pPhysicObjList.end(); itr++ )
{
for(int index = 0; index < itr->pModel->m3DModel.numOfObjects; index++)
{
t3DObject *pObject = &(itr->pModel->m3DModel.pObject[index]);
for(int i=0; i < pObject->numOfFaces; i++)
{
vPoly[0] = pObject->pVerts[pObject->pFaces.vertIndex[0]];
vPoly[1] = pObject->pVerts[pObject->pFaces.vertIndex[1]];
vPoly[2] = pObject->pVerts[pObject->pFaces.vertIndex[2]];
//How do I make the test agains the polys and my current position?
}
}
}