A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by ropeguy » Wed Apr 01, 2009 3:32 pm
I need to simulate machinery operating on a vessel that moves forward at a constant velocity, but which can also pitch and roll.
In Newton it appears that you have to set a finite world size. Will the physics stop working once the vessel leaves the world 'bounding box'? If so, can I simply re-position the world bbox? Some confusion here, e.g.
from the faq
http://newtondynamics.com/forum/viewtopic.php?f=15&t=2121&start=0My bodies freeze in mid air.
With 1.5 as soon as a body is completely outside of the world in is remove for the active list and the function callback is called once to notify the application.
To prevent this form happening the application should set the appropriate world size by calculating the size of the active world and padding with some reasonable values, and calling the funtion NewtonSetWorldSize.
The default world size is the box p0 (-100, -100, -100) p1 (100, 100, 100)
It is recommended that the world size is set appropriately, a box twice or 4 time the size of the world is a good value, extremely large sizes will severally degrade the performance of the course resolution collision culling phase resulting in a n body collision problem.
From the wiki on NewtonSetWorldSize:
Some things will work outside the limits of the world (like basic object collision, etc
Just what is it that stops working if an object leaves the world bbox? (the wiki mentions raycasts stop working - anything else?)
-
ropeguy
-
- Posts: 8
- Joined: Wed Apr 01, 2009 1:11 pm
by Stucuk » Wed Apr 01, 2009 4:48 pm
If an object leaves the world then it will just freeze. You can always increase the world's size. You could always do what someone else did with a ship and just simulate the "movement" that the ship does(Rocking about). That way your ship never moves.
-
Stucuk
-
- Posts: 801
- Joined: Sat Mar 12, 2005 3:54 pm
- Location: Scotland
-
by ropeguy » Thu Apr 02, 2009 8:42 am
Thanks Stucuk, but having the ship move profressively forwards is essential (other ships will be in the simulation, but they will not interact physically, but they will 'see' each other).
The documentation suggests that collisions to work outside the world. But in the demos, any object hitting the world limits just freezes, as you say. This could be a major limitation, unless one could dynamically re-position the world extents to follow the ship, for example.
-
ropeguy
-
- Posts: 8
- Joined: Wed Apr 01, 2009 1:11 pm
by Stucuk » Thu Apr 02, 2009 8:44 pm
Well unless you try something you will never know if there is any noticable slowdown or not.
-
Stucuk
-
- Posts: 801
- Joined: Sat Mar 12, 2005 3:54 pm
- Location: Scotland
-
by JernejL » Fri Apr 03, 2009 11:27 am
ropeguy wrote:Thanks Stucuk, but having the ship move profressively forwards is essential (other ships will be in the simulation, but they will not interact physically, but they will 'see' each other).
The documentation suggests that collisions to work outside the world. But in the demos, any object hitting the world limits just freezes, as you say. This could be a major limitation, unless one could dynamically re-position the world extents to follow the ship, for example.
You CAN change the world size at any time at runtime.
You can also set a enoremously huge world size and never worry about boundaries again.
Just beware that using huge objects may lead to instability, floating point math is not like "real" math and starts to lose precision too far from world origin.
-
JernejL
-
- Posts: 1578
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by ropeguy » Fri Apr 03, 2009 12:16 pm
Delfi wrote:
You CAN change the world size at any time at runtime.
That's good news. However, it is not the size of the world that is the problem (with two ships close together, my actual size is quite small). The problem is the ships keep moving forwards, and I would like the simulation world to move along with them as well. So can I change the world location to something other than (0,0,0) ?
I don't even need to do a 'world shift' that often. As the ships get near the world limits, I would set a new location for the world. But the physics shouldn't go bananas when that is done!
Delfi wrote:
You can also set an enoremously huge world size and never worry about boundaries again.
just beware that using huge objects may lead to instability, floating point math is not like "real" math and starts to lose precision too far from world origin
Would using doubles instead of floats help? Can Bullet be told to use doubles?
-
ropeguy
-
- Posts: 8
- Joined: Wed Apr 01, 2009 1:11 pm
by agi_shi » Fri Apr 03, 2009 4:44 pm
Two questions:
1) are these ships dynamically simulated by Newton?
2) are these ships ever in contact with each other?
-
agi_shi
-
- Posts: 263
- Joined: Fri Aug 17, 2007 6:54 pm
by Aphex » Sat Apr 04, 2009 4:13 am
There's a double precision build of Newton that I use successfully in a huge world (+/- 300km)
-
Aphex
-
- Posts: 144
- Joined: Fri Jun 18, 2004 6:08 am
- Location: UK
-
by ropeguy » Mon Apr 06, 2009 5:35 am
agi_shi wrote:Two questions:
1) are these ships dynamically simulated by Newton?
2) are these ships ever in contact with each other?
1) are these ships dynamically simulated by Newton? - No, but the machinery on them will be.
2) are these ships ever in contact with each other? - This can happen. More importantly, the machinery spans the ships (rope from one to the other, for example)
-
ropeguy
-
- Posts: 8
- Joined: Wed Apr 01, 2009 1:11 pm
by ropeguy » Mon Apr 06, 2009 5:40 am
Aphex wrote:There's a double precision build of Newton that I use successfully in a huge world (+/- 300km)
Thanks, Aphex. At 10m/s, this would give me a max simulation time of (300 x 1000) / (10 x 60 x 60) = 8.3 hours.
That should do fine!
Did you notice any slowdown in the collision detection / dynamics performance?
-
ropeguy
-
- Posts: 8
- Joined: Wed Apr 01, 2009 1:11 pm
by Aphex » Mon Apr 06, 2009 2:47 pm
Well, I've not benchmarked it fully, and my world is split into discrete islands with groups of around 100 bodies each. I dynamically create & destroy the bodies on the islands when they gain/lose interactivity (and a lot of them are static) so it may not be comparable with your system. With a few such islands Newton takes about 1.4ms (including app callbacks) on my machine (Intel E4400).
-
Aphex
-
- Posts: 144
- Joined: Fri Jun 18, 2004 6:08 am
- Location: UK
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 12 guests