Terrain <-> Compound Collision World Scale Problem [SOLVED]

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Terrain <-> Compound Collision World Scale Problem [SOLVED]

Postby MeltingPlastic » Mon Oct 15, 2018 1:06 pm

Hi Julio,

In my Api I have implemented a "physics world scaling" parameter. It is basically a single scalar that indicates how large every collision shape should be in the newton world and it's respective position and mass density.

So you can call
Code: Select all
PhysicsWorld->SetPhysicsScale(0.5f)


And everything in the physics world will be smaller.

This works well! And wasn't that hard to get running - however when I set the scale to 0.5 I start seeing missed collisions between compounds and my terrain collider (the problem is also there with generic tree colliders). Single body collisions work fine for some reason.

using SetPhysicsScale(1.0f) works fine.

When I manually create a small compound collision shape using physics scale 1.0f things still work fine.

I must be doing something wrong but for the life of me I cant find it :? .

Any chance you can debug and see why the objects are passing through the terrain? Here is the demo: with physics scale set to 0.5f
https://drive.google.com/open?id=1TNkp0bV0wbL1a_ZtkypOXzLWf2hWGCda

I don't get any calls to the AABB callback or the contacts callback for the compounds.


Best - Melting.
Last edited by MeltingPlastic on Mon Oct 29, 2018 1:02 pm, edited 1 time in total.
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm

Re: Terrain <-> Compound Collision World Scale Problem

Postby Julio Jerez » Mon Oct 15, 2018 1:52 pm

sure. I check it out as soon as I have time.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Terrain <-> Compound Collision World Scale Problem

Postby Julio Jerez » Tue Oct 16, 2018 12:24 am

Ok I downloaded the demo, and I see some pilars of boxes stacked over the terrain, I assume those are correct, then I see some objects in the background that go over the terrain, are the shapes that reproduce the bug?

you need to make a new build because when I click any where, I get the picking joint assert and I guess that was fixed, also you do not need to add all the boxes that do not reproduce the bug, it makes it more difficult to debug the problem. if you do that and put a new demo I can check it out.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Terrain <-> Compound Collision World Scale Problem

Postby Julio Jerez » Tue Oct 16, 2018 1:02 am

hey y Melting Plastic are you paying attention to the vehicle.
I just go the solver debug it and the vehicle stand on teh wheels.

does not do anything yet because ther are no lateral or longitudinal forces,
but check it out how it come a live as I start plugin the forces.

now teh next step is the dry tire friction forces, which some be very eassy. the vehicle will be able to cost like a Box stack car or a toy car,

also notice that the car has a short suspension span, tha can even be shorter or lower like sport car.
in fact the suspension will be even more stiff at the end, but for now we can leave like that.
I have vey high hope for this project.

anyway let me know when you recompile the demo.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Terrain <-> Compound Collision World Scale Problem

Postby MeltingPlastic » Tue Oct 16, 2018 1:23 pm

Yeah I just tried the vehicle demo in the sdk. Looks like its coming along!

Here is a better demo - There is only 1 compound. I also disable gravity so you can drag the compound down with the click and drag:
https://drive.google.com/open?id=18V-T22iCsR-lbl_unE0iRFf8yv-lurNB
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm

Re: Terrain <-> Compound Collision World Scale Problem

Postby Julio Jerez » Wed Oct 17, 2018 11:33 am

ok I got it set up,
you say you do no get the aabb overlap?
you soudl be getting in, whe I toud the compound the brake point is hit

file ../sdk\dgPhysics\dgBroadPhase.cpp line 1119
Code: Select all
   const dgContactMaterial* const material = contact->m_material;
   if (material->m_flags & dgContactMaterial::m_collisionEnable) {
      dgInt32 processContacts = 1;
      if (material->m_aabbOverlap) {
[color=#0040FF]// this is the call to the aabb overlap, this mean teh code is fine until here[/color]
         processContacts = material->m_aabbOverlap(*contact, timestep, threadIndex);
      }
      if (processContacts) {


can you set a break point there and verify this is correct?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Terrain <-> Compound Collision World Scale Problem

Postby MeltingPlastic » Wed Oct 17, 2018 12:33 pm

Oh - yes you are right I do get a breakpoint in AABBOverlapCallback.

I don't get a break in the ProcessContactsCallback though.
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm

Re: Terrain <-> Compound Collision World Scale Problem

Postby Julio Jerez » Wed Oct 17, 2018 2:26 pm

Ok I will check out tonigh
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Terrain <-> Compound Collision World Scale Problem

Postby Julio Jerez » Mon Oct 22, 2018 11:26 am

I did not have time to check this, I spend it debugging the vehicle and adding the brush tire model.
this is a simple compset, but difficult to get it right.
Ibelive I have a good start now, at least seem to behave like tuber tire, and this is one of the stages where to vehicle sepqrqte from the collection of rigid bodies and joints.

if every thing going as plan, one more week and it will usable.

after that I will re enable the multibody vehicle and move it to the library.

I see if I debug this bug tomorrow morning.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Terrain <-> Compound Collision World Scale Problem

Postby MeltingPlastic » Mon Oct 22, 2018 12:42 pm

Ok sounds good Thanks Julio.

I started integrating the vehicle - So I'm tracking with it.

It's apparent that the vehicle body should be able to interact seamlessly with my API because I can pass an existing newton body into the create vehicle function. This is great.

The interface for the wheels will just have to be its own custom thing.



Just some probing questions:

when tires are created does newton make a newtonbody for it?
Is the newtonbody accessible after creation?

Could an existing newtonbody be passed in as the body to use for a new tire via the AddTire() function? For example the body could already have a collision before being turned into a tire.

Is it possible that Outside world constraints could be attached to tire bodies? (I know I know why would I want that - but think sandbox game) If not that's fine - but would be cool :)
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm

Re: Terrain <-> Compound Collision World Scale Problem

Postby Julio Jerez » Mon Oct 22, 2018 1:56 pm

MeltingPlastic wrote:Ok sounds good Thanks Julio.

I started integrating the vehicle - So I'm tracking with it.

It's apparent that the vehicle body should be able to interact seamlessly with my API because I can pass an existing newton body into the create vehicle function. This is great.
The interface for the wheels will just have to be its own custom thing.

that's the idea, now you start to catch my drift, (oh drift there that word again)

for the other question, the answer is not on this model, but remember this model is geared for games, where high performance and stability are the higher priority.

The tire are virtual, the do all the calculation but they make lot of simplifications that are hard to do with the general rigid body solver.

however there is also the multibody car, that now is commented out but that will be enable after we get this one running stable.
In the model every thong is newton joint and newton body, you can do all the stuff that can be does to any other model.
by the model is a bet five time slower, but will be practical for stiff like construction machinery and stuff like that. geared more to simulation than real time.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Terrain <-> Compound Collision World Scale Problem

Postby MeltingPlastic » Mon Oct 22, 2018 7:17 pm

ok sounds good. Lets say I wanted to create a semi truck - would it be best to create 2 vehicles and attach their bodies together with a hinge constraint?
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm

Re: Terrain <-> Compound Collision World Scale Problem

Postby Julio Jerez » Wed Oct 24, 2018 9:36 am

they that will be perfectly possible.

Hey here is where the vehicle dynamics start to go separate away from the rigid body dynamics
I bet you never seem physic engine car drive like this, if you sync an drive a little, the are perfect drift condition, force by brake and steering (not cheats of any kind)
just way one the vehicle start move forward and turn, and if you do no believe me, check thsi out.
https://www.youtube.com/watch?v=kfsWoMpPtQ8

here are some driving tricks that I expect this vehicle to do without problems
https://www.youtube.com/channel/UC7lKD- ... jDQP5YQVNQ
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Terrain <-> Compound Collision World Scale Problem

Postby MeltingPlastic » Wed Oct 24, 2018 5:13 pm

I tried the demo and the front wheels are locked inducing the drift! Super cool to see!
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm

Re: Terrain <-> Compound Collision World Scale Problem

Postby Julio Jerez » Wed Oct 24, 2018 5:24 pm

It isn't asphalt kid, ... 8)
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Next

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 4 guests