Panch, so perhaps explain more specifically the issues you're getting with genmeshes and CD.
Sure. I create a spherical GenMesh using the same code from walktest:
// Create a GenMesh
// Create GenMesh Factory
imeshfact = engine->CreateMeshFactory (
if (!imeshfact) return false;
fstate = scfQueryInterface<iGeneralFactoryState> (
csEllipsoid ellips (
csVector3 (0, 0, 0),
csVector3 (1, 1, 1));
fstate->GenerateSphere (ellips, 10);
if (!loader->LoadTexture ("adversary_texture", "/lib/stdtex/misty.jpg"))
return ReportError ("Error loading 'misty' texture!");
iMaterialWrapper* adversary_material = engine->GetMaterialList ()
//csRef<iMeshWrapper> adversary = view->GetEngine ()->CreateMeshWrapper (
sprite = view->GetEngine ()->CreateMeshWrapper (
room, csVector3 (0, 3, 3));
When I try to detect collision detection with:
// Aggro for level 1
for (aggro_i; aggro_i<aggroList.GetSize(); aggro_i++)
string aggroName = aggroList.Get(aggro_i);
csRef<iMeshWrapper> aggroed = engine->GetMeshes()->FindByName(aggroName.c_str());
csReversibleTransform trans1 = hero->GetMovable()->GetFullTransform();
csReversibleTransform trans2 = aggroed->GetMovable()->GetFullTransform();
col_aggro = aggroed->QueryObject();
csRef <csColliderWrapper> hero_collider_wrapper =
if(hero_collider_wrapper->Collide(col_aggro, &trans1, &trans2))
The CD doesn't report properly, if you can imagine a circle around the circumference on the x-axis of the sphere, CD will work fine along that axis. However, it is not per polygon accurate. It is however with Thing Meshes. I have my camera set a few marks behind my hero mesh for debugging purposes and I can see the hero mesh intersect with different pieces of the GenMesh with no response. However, if I jump up to the x-axis of the object I will collide properly. With Thing Meshes however I can collide against any polygon and return that collision accurately.
The idea is to create a sphere/cube around enemies that when collided with will let them know to attack me. I have nearly surrendered to the fact that I can not do it with the limitation of CS + ODE collision. It isn't too much of a big deal because I've come up with 2 very workable alternatives.
I would like to see the 'aggro' thing work though as I think my theory and code are sound!