Problem with collisions

João Pereira <[email protected]>
Newsgroups gmane.comp.lib.ode
Message-ID <[email protected]>
Hello,
Im new to ODE and started working with it because i have a project on my 
University that need it.

Im trying to start with a simple example a ball falling and a plane.
When the ball hit's the plane should get up again.



do i need a space collision to get this done????

I have created a simpleSpace and the ball just go through the plane and 
keeps falling.

i created the ball has

typedef struct ic3dPos{
    dReal x;
    dReal y;
    dReal z;
}ic3dPos_t;

typedef struct icBody{
    dBodyID bId;
    dGeomID gId;
    ic3dPos_t pos;
    dMass mass;
}icBody_t;
#define sphereMass 0.5
#define sphereRadius 1
   
icBody_t ball;
icBody_t floor2;
dSpaceID space;

    ball.bId = dBodyCreate( world );
    pos = (ic3dPos_t *) dBodyGetPosition( ball.bId );
    ball.gId = dCreateSphere( space , sphereRadius );


    ball.pos.x = 0;
    ball.pos.y = 0;
    ball.pos.z = 10;

    dBodySetPosition( ball.bId , ball.pos.x , ball.pos.y , ball.pos.z );
   
    //set's the mass parameters
    dMassSetSphereTotal(&ball.mass , sphereMass , sphereRadius );
    dBodySetMass( ball.bId , &ball.mass );


and the plane has

floor2.gId = dCreatePlane( space , 0 , 0 , 1 , -1 );

do i need to do something to make the ball go up when its the plane????


Thanks for the help

João Pereira
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.