Hi,
I'm loading a player mesh in cel using:
csRef<iDataBuffer> rpath = vfs->GetRealPath (config->GetStr (
cfgkey+"ModelPath", "/xd/models/ships/F2.zip"));
vfs->Mount ("/xd/ship", rpath->GetData ());
pcmesh->SetPath ("/xd/ship");
pcmesh->SetMesh ("craft", "world");
Since its a library file theres no meshes there, and a new mesh is created
using the factory "craft".
Then I set the flag CS_ENTITY_NOHITBEAM on the iMeshWrapper.
iMeshWrapper *meshw = pcmesh->GetMesh ();
if (!meshw)
return ReportError ("Error loading model!");
meshw->GetFlags ().Set (CS_ENTITY_NOHITBEAM);
if (meshw->GetFlags ().Check (CS_ENTITY_NOHITBEAM))
printf ("mesh has CS_ENTITY_NOHITBEAM\n");
Eventhough I have this flag set, I've been having the problem that
iSector::HitBeam () still seems to be hitting the mesh. So inside
int csSector::IntersectSegment (
const csVector3 &start,
const csVector3 &end,
csVector3 &isect,
float *pr,
bool only_portals,
iMeshWrapper **p_mesh)
I added printf's inside the main loop so I can see whats happening. So it ends
up looking like:
printf ("--- start\n");
while (visit->HasNext ())
{
iVisibilityObject* vo = visit->Next ();
iMeshWrapper* mesh = vo->GetMeshWrapper ();
if (!mesh) continue;
csVector3 pos = mesh->GetMovable ()->GetFullPosition ();
if (mesh->GetFlags ().Check (CS_ENTITY_NOHITBEAM))
printf ("(%f, %f, %f)\tCS_ENTITY_NOHITBEAM\n", pos.x, pos.y, pos.z);
else
printf ("(%f, %f, %f)\n", pos.x, pos.y, pos.z);
if (!mesh || mesh->GetFlags ().Check (CS_ENTITY_NOHITBEAM)) continue;
...
}
printf ("--- end\n");
So when I run the app and get the output, and move the main entity about, I
get these co-ordinates (sample).
mesh has CS_ENTITY_NOHITBEAM
--- start
(0.000000, 0.000000, 0.000000)
(199.583313, 29.670748, -131.294876)
(198.192215, 29.574041, -132.562943)
(199.585190, 30.126381, -133.123779)
(192.149185, 30.269884, -135.707047)
(192.149185, 30.269884, -135.707047)
--- end
--- start
(0.000000, 0.000000, 0.000000)
(219.525986, 26.606274, -102.077812)
(218.774399, 26.668711, -103.805153)
(220.290756, 27.169477, -103.705826)
(216.687073, 28.965502, -110.654640)
(216.687073, 28.965502, -110.654640)
--- end
--- start
(0.000000, 0.000000, 0.000000)
(216.217819, 35.918373, -29.748653)
(216.803299, 34.868767, -31.200562)
(217.965302, 35.600403, -30.379297)
(220.037277, 34.756561, -37.301964)
(220.037277, 34.756561, -37.301964)
--- end
--- start
(0.000000, 0.000000, 0.000000)
(190.191803, 46.976715, -4.965292)
(191.637878, 46.804218, -6.161789)
(192.000626, 47.459938, -4.748124)
(198.257294, 47.722618, -8.967169)
(198.257294, 47.722618, -8.967169)
--- end
// exit the app
--- start
(-18.680956, 1.526901, 0.117609) CS_ENTITY_NOHITBEAM
(0.000000, 0.000000, 0.000000)
--- end
Why are there 2 co-ordinates exactly in the same place for the ship?? Why are
there 3 other co-ordinates always near the ship? Why is none of those
co-ordinates display CS_ENTITY_NOHITBEAM? Why does the expected output only
appear AFTER I exit the app?
Thanks.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]