Crystal Space
Welcome, Guest. Please login or register.
April 20, 2014, 05:05:26 pm

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7598 Members
Latest Member: Tarafigueroa
* Home Help Search Login Register
+  Crystal Space
|-+  Associate Projects
| |-+  CEL Discussion
| | |-+  AttachColliderMesh lost in the space !
« previous next »
Pages: [1] Print
Author Topic: AttachColliderMesh lost in the space !  (Read 3186 times)
danledan
Guest


Email
« on: November 14, 2005, 11:48:07 am »

Hello,

I try some test on the mechtest app., and I have trouble with the AttachColliderMesh function.

For exemple: I just want to change the actor sphere with a custom object ( like a flattened sphere) and I add a MeshCollider insteat of a standard sphere collider..

in mechtest.cpp I changed the object

Code:
// pcmesh->SetMesh ("Sphere", "sphere");
 pcmesh->SetMesh ("platsphere", "platsphere");

with this, I can see the new mesh object but I want to have the collision based on the mesh

I change in CreateDynActor()

Code:
//  pcmechobject->AttachColliderSphere (.42f, csVector3 (0, 0, 0));
  pcmechobject->AttachColliderMesh() ;
 
but my "platsphere" fall down.. (like if they don't have collision with the ground)
After that, I try without comment pcmechobject->AttachColliderSphere..  and now the ground interact with the sphere collider..  but other objects (like walls and balls) interact with the "platsphere" Mesh..

Any idea ?!
Thanks
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1704


View Profile
« Reply #1 on: November 14, 2005, 11:51:43 am »

Hello,

I try some test on the mechtest app., and I have trouble with the AttachColliderMesh function.

For exemple: I just want to change the actor sphere with a custom object ( like a flattened sphere) and I add a MeshCollider insteat of a standard sphere collider..

in mechtest.cpp I changed the object

Code:
// pcmesh->SetMesh ("Sphere", "sphere");
 pcmesh->SetMesh ("platsphere", "platsphere");

with this, I can see the new mesh object but I want to have the collision based on the mesh

I change in CreateDynActor()

Code:
//  pcmechobject->AttachColliderSphere (.42f, csVector3 (0, 0, 0));
  pcmechobject->AttachColliderMesh() ;
 
but my "platsphere" fall down.. (like if they don't have collision with the ground)
After that, I try without comment pcmechobject->AttachColliderSphere..  and now the ground interact with the sphere collider..  but other objects (like walls and balls) interact with the "platsphere" Mesh..

Any idea ?!
Thanks

There is currently a bug with plane/mesh colliding. I assume your ground is a plane collider? In that case that is the reason. You might have better luck with a box collider on the ground but the best thing to do is to avoid mesh colliders at all and try to use primitives as much as possible.

Greetings,
Logged
danledan
Guest


Email
« Reply #2 on: November 14, 2005, 09:59:03 pm »

Thanks for you short and quick reply..

but, I have an other "stange physical" problem, I change the code to have my flattedsphere with the meshcollider on a box build with

Code:
  csOrthoTransform t;
  t.SetOrigin(csVector3(0.0f,-1.5f,0.0f));
  pcmechobj->MakeStatic (true);
  pcmechobj->AttachColliderBox (csVector3 (200.0f, 1.0f, 200.0f), t);
 

At the begining all look perfect, collision look perfect, but after few test, the physical ground (the box) seem to go down. . if I set  the Mass of all the wallbox to 1000 for example ..   the ground fall down in few second .. . with 10 for Mass the ground fall down slowly (cool effect.. but I don't want this) . . I look into the code of the function MakeStatic and the doc of ODE but all seem to be OK. .. .  if I try it with the standard PlaneCollider for ground, this problem don't exist.

Any other idea ?
Thanks



Logged
danledan
Guest


Email
« Reply #3 on: November 28, 2005, 01:34:06 pm »

Finaly I use this function to create a ground who interact with mesh, and this ground is completely locked on the world system, not like the last try.


Code:
void MechTest::CreateGround (csVector3 size, csOrthoTransform t)
{
  iCelEntity* entity_room (pl->FindEntity("room"));

  csRef<iPcMechanicsSystem> pcmechsys = CEL_QUERY_PROPCLASS_ENT (entity_room,
        iPcMechanicsSystem);

  iDynamicSystem* dynsys;
  dynsys=pcmechsys->GetDynamicSystem();
  dynsys->AttachColliderBox (size, t, 1, 1,1);
}

Maybe that will help someone !! Smiley
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 8.016 seconds with 16 queries.