Jump to content

Wheel joints usage example, clipping in the ground


photo

Recommended Posts

Ive been trying to adjust wheel position to be higher, I was changing "car" shape dimensions, weight. Nothing worked.

Link to comment

Hi Marin,

Seems like one thing is missing in the example code - enabling physics intersection for the ground (by default it is disabled).

Try replacing the following lines in the AppWorldLogic::init() method:

if (ground)
	checked_ptr_cast<Object>(ground)->setCollision(1, 0);

with these:

if (ground) 
{
	checked_ptr_cast<Object>(ground)->setCollision(1, 0);
	checked_ptr_cast<Object>(ground)->setPhysicsIntersection(1, 0);
}

Or you can enable the PhysicsIntersection option for the ground's surface via the UnigineEditor.

This should solve your problem.

Well update the docs ASAP, sorry for the inconvenience caused!

Thanks!

  • Like 2
Link to comment
13 hours ago, fox said:

Hi Marin,

Seems like one thing is missing in the example code - enabling physics intersection for the ground (by default it is disabled).

Try replacing the following lines in the AppWorldLogic::init() method:


if (ground)
	checked_ptr_cast<Object>(ground)->setCollision(1, 0);

with these:


if (ground) 
{
	checked_ptr_cast<Object>(ground)->setCollision(1, 0);
	checked_ptr_cast<Object>(ground)->setPhysicsIntersection(1, 0);
}

Or you can enable the PhysicsIntersection option for the ground's surface via the UnigineEditor.

This should solve your problem.

Well update the docs ASAP, sorry for the inconvenience caused!

Thanks!

Thanks, that was it. I eventually went back in the Unigine Editor and enabled physics for the "ground"

Link to comment

I tried everything except the physics intersection... But finaly it work, not made by code but with editor, notice how you have to set up axis 00,01,11 to make the wheels stay in the good axis.

also i set other parameters like in the code, i added a bit more of spring because the car is heavier

challenge.thumb.jpg.3a3481051b42dd7c7254904e40c0ba20.jpg

Edited by samuel.bruner
Link to comment
×
×
  • Create New...