I have two functions.
#1 is my 1.1 function
#2 is my .97 function
#2 Works fine, but #1 can't seem to do this line right:
mesh = scfQueryInterface<iTriangleMesh>(sp->GetMeshObject());
sp is a valid iMeshWrapper(I tested it on both functions)
mesh==NULL though
What am I doing wrong?
Here are the functions:
#1 New Function
void
Simple::InitCollDet2 (iEngine * engine, iSceneNodeArray * SNA)
{
csRef < iTriangleMesh > mesh;
unsigned int i;
csRef <iSceneNodeArray> SNB;
for (i = 0; i < SNA->GetSize(); i++)
{
iMeshWrapper *sp = SNA->Get(i)->QueryMesh();
SNB=sp->QuerySceneNode ()->GetChildrenArray();
if (SNB->GetSize() > 0)
InitCollDet2 (engine, SNB);
mesh = scfQueryInterface<iTriangleMesh>(sp->GetMeshObject());
if(mesh==NULL)
printf("zzz\n");
if (mesh)
{
printf("child collider\n");
csColliderWrapper *cw =
new csColliderWrapper (sp->QueryObject (), cdsys, mesh);
cw->SetName (sp->QueryObject ()->GetName ());
}
}
}
That prints zzz 14 times.
#2: Old Function
void
WalkTest::InitCollDet2 (iEngine * engine, iMeshList * meshes)
{
csRef < iPolygonMesh > mesh;
int i;
csRef < iMeshList > ML;
for (i = 0; i < meshes->GetCount (); i++)
{
iMeshWrapper *sp = meshes->Get (i);
ML = sp->GetChildren ();
if (ML->GetCount () > 0)
InitCollDet2 (engine, ML);
mesh = SCF_QUERY_INTERFACE (sp->GetMeshObject (), iPolygonMesh);
if(mesh==NULL)
printf("zzz\n");
if (mesh)
{
printf("child collider\n");
csColliderWrapper *cw =
new csColliderWrapper (sp->QueryObject (), collide_system, mesh);
cw->SetName (sp->QueryObject ()->GetName ());
}
}
}
That prints "child collider" 14 times
---------------------------------
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news,
photos & more. -------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]