intersecting bodys on impact and in rest

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

intersecting bodys on impact and in rest

Postby M1tch » Tue Nov 11, 2008 11:42 am

hi !

I'm new to this forum so goodday to all :wink:
This topic is also posted on the ogrenewt forums but i think it's better siuted here

I'm working on an arcade game and because I had some experience with newton, I decided to work with Ogrenewt.

I'm working with newton 1.53


There is one major problem i'm dealing with now. I can solve it using some workarounds but it has major effects on how the physics respond.

Here's the problem:

http://www.mitchvl.net/Problem.JPG


As you can see, my player has an ellipsoid collision mesh. That collision mesh works great on horizontal platforms, although i had to correct the player's Y position when impacting on ground, because it was intersecting with the ground and almost didn't correct itself.

As you might think that's a pretty big problem when the ground level suddenly changes from horizontal to a slope (hangbridge) like on the screenshot. Even worse, in this case the ground is dynamic and has it's own physics, so i had some really weird looking physics when the Y correction was enabled.

So i disabled the Y correction for the bridge and all looked great. except when the player is not moving, it started to slowly dig itself in the ground. You should probably know there is a constant gravital force on the player, if i disable this, the hangbridge physics are all screwed because the bridge needs the playerforce to hang.


I hope you all understand my problem. What's the point in collision physics using a physics library when you have to manually correct positions on impact?


I hope there is someone out here that can help me. :)


greets
M1tch
 
Posts: 6
Joined: Wed Feb 20, 2008 1:59 pm

Re: intersecting bodys on impact and in rest

Postby JernejL » Tue Nov 11, 2008 1:50 pm

M1tch wrote:What's the point in collision physics using a physics library when you have to manually correct positions on impact?


Obviously you are using it wrong that you got that weird behavior.. how are you moving the body? can we see a video of the bug in action?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1531
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: intersecting bodys on impact and in rest

Postby M1tch » Tue Nov 11, 2008 5:18 pm

That's what i hope :)


i hope this does it: http://www.mitchvl.net/movie.wmv

I always use addforce, except for jumping i use setvelocity. continuous collision mode is on for the player and the bridge....

i used a demo video capture program so i hope you can see through the bad quality
M1tch
 
Posts: 6
Joined: Wed Feb 20, 2008 1:59 pm

Re: intersecting bodys on impact and in rest

Postby JernejL » Tue Nov 11, 2008 5:43 pm

it looks as if you apply some powerful gravity forces that makes the body start sinking into the bridge, but hopefully julio can look at your problem more thorroughly, it is difficult to imagine for me on what exactly is happening there.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1531
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: intersecting bodys on impact and in rest

Postby M1tch » Tue Nov 11, 2008 6:59 pm

so you also agree that this isn't normal newton physics behaviour...

The gravitational force is quite big, it's -198000.0f
but that amount is needed for gameplay purposes and it forces the bridge to hang (i presume).

One cube in the level is size 100.0f...


edit: just read somewhere that in newton one unit (1.0f) is 1 real world meter? is this correct? if it is, i don't see why this could be a problem though :)
M1tch
 
Posts: 6
Joined: Wed Feb 20, 2008 1:59 pm

Re: intersecting bodys on impact and in rest

Postby Dave Gravel » Tue Nov 11, 2008 8:08 pm

Anyway from newton side it's not so important if your self engine have a lot gravity.
Because from the newton callback forceandtorque you can set a lower gravity on custom object's data and the player data object.
On this way with the same simulation scene some object can have zero gravity, or axial gravity like liquide...
I'm just not so sure how you mix your physics system with newton but maybe a little description can give more idea for help.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://www.facebook.com/dave.gravel1
http://orionx3d.googlepages.com/
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 725
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: intersecting bodys on impact and in rest

Postby M1tch » Wed Nov 12, 2008 7:47 am

All forces are applied with the newton forcecallback, including gravity.

There is'nt any general gravity force. That gives me more control

If i could give you more info i would, but i don't really know what else to say :p
M1tch
 
Posts: 6
Joined: Wed Feb 20, 2008 1:59 pm

Re: intersecting bodys on impact and in rest

Postby M1tch » Thu Nov 13, 2008 11:53 am

nobody? :)
M1tch
 
Posts: 6
Joined: Wed Feb 20, 2008 1:59 pm

Re: intersecting bodys on impact and in rest

Postby Dave Gravel » Thu Nov 13, 2008 12:06 pm

How do you make the Elliptical shape and the transform for this shape ?
Do you have some code exemple ?
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://www.facebook.com/dave.gravel1
http://orionx3d.googlepages.com/
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 725
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: intersecting bodys on impact and in rest

Postby M1tch » Sat Nov 15, 2008 1:49 pm

I've scaled everything down with factor 0.01.


Now everything works perfectly, so it was idd a scaling problem.


golden tip:
ALSWAYS CHECK YOUR SCALE WHEN WORKING WITH A NON SCALABLE PHYSICS ENGINE :p


thx 4 all the help !! especially k00m :)
M1tch
 
Posts: 6
Joined: Wed Feb 20, 2008 1:59 pm

Re: intersecting bodys on impact and in rest

Postby JernejL » Sat Nov 15, 2008 3:32 pm

If scale was the problem, then you gor hit by the floating point precision problem, that's not a newton problem but fundemental issue with 32 bit floating point limit.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1531
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron