Open Physics Abstraction Layer sample app
-
- Gnoblar
- Posts: 24
- Joined: Thu Apr 21, 2005 7:23 pm
Open Physics Abstraction Layer sample app
Just to give some background, here's a message I recently posted on the ODE message board:
----------------------------
Open Physics Abstraction Layer is a library I've been working on for a
few months with Andres Reinot and Alan Fischer. The goal of the
project is to make it easy for people to start using physics
simulation in their applications by providing a simple interface over
the top of existing physics engines (ODE only for now, but it could be
extended to use others in the future). It's mainly helpful for people
getting started with physics that don't want/need to tweak tons of
parameters. It also provides a set of high-level constructs (various
sensors and motors) for things like robotics simulations.
I just posted a new version (0.3.0), including a source release and a
precompiled win32 binary version. Also included is a sample app that
uses the Ogre rendering engine (www.ogre3d.org).
If you're interested, read more details on the website (I have posted
tutorials and full API documentation), and let me know what you think.
http://opal.sourceforge.net
----------------------------
The sample app that uses Ogre is a fun little arena with simple physical objects, a wall of blocks, a tower of blocks, and a ragdoll, complete with a spring-based picking system for dragging things around. If you're interested, there's a source and win32 binary version available here (get the 0.3.0 version):
http://sourceforge.net/project/showfile ... _id=134434
Tyler
----------------------------
Open Physics Abstraction Layer is a library I've been working on for a
few months with Andres Reinot and Alan Fischer. The goal of the
project is to make it easy for people to start using physics
simulation in their applications by providing a simple interface over
the top of existing physics engines (ODE only for now, but it could be
extended to use others in the future). It's mainly helpful for people
getting started with physics that don't want/need to tweak tons of
parameters. It also provides a set of high-level constructs (various
sensors and motors) for things like robotics simulations.
I just posted a new version (0.3.0), including a source release and a
precompiled win32 binary version. Also included is a sample app that
uses the Ogre rendering engine (www.ogre3d.org).
If you're interested, read more details on the website (I have posted
tutorials and full API documentation), and let me know what you think.
http://opal.sourceforge.net
----------------------------
The sample app that uses Ogre is a fun little arena with simple physical objects, a wall of blocks, a tower of blocks, and a ragdoll, complete with a spring-based picking system for dragging things around. If you're interested, there's a source and win32 binary version available here (get the 0.3.0 version):
http://sourceforge.net/project/showfile ... _id=134434
Tyler
-
- Halfling
- Posts: 40
- Joined: Fri May 23, 2003 10:46 pm
- Location: Warsaw, Poland
Looks quite nice though you should post some screens here I suppose - it's Showcase forum.
One thing bothers me. Why do I get _1_ fps when pressing 8? Yeah, I know, it's because of these objects created, but hell, there's P4 3GHz inside my box, it should be enough. It gets a little bit better (5 fps?) when the stack collapses but it's too slow anyway.
And I think it's OPAL doing something really bad, because when I run OgreODE and Helicopter vs Wall demo (there's a lot of boxes creating a wall) I get ~100 fps.
I haven't had time to check the sources, maybe these bricks are trimeshes or something and that's the cause of poor performance.
Anyway - nice one. I'm waiting for other physic engines support
One thing bothers me. Why do I get _1_ fps when pressing 8? Yeah, I know, it's because of these objects created, but hell, there's P4 3GHz inside my box, it should be enough. It gets a little bit better (5 fps?) when the stack collapses but it's too slow anyway.
And I think it's OPAL doing something really bad, because when I run OgreODE and Helicopter vs Wall demo (there's a lot of boxes creating a wall) I get ~100 fps.
I haven't had time to check the sources, maybe these bricks are trimeshes or something and that's the cause of poor performance.
Anyway - nice one. I'm waiting for other physic engines support

Marcin Jakubowski
jabber://myak@chrome.pl
jabber://myak@chrome.pl
-
- Platinum Sponsor
- Posts: 1186
- Joined: Sat Apr 17, 2004 2:49 am
- x 3
I had a lot of fun playing with your demo.
I don't know muc about the technical stuff of how ragdoll works and its limitations, etc. I tortured the ragdoll in your demo with some pretty high velocity impacts into the giant block and found that his limbs tend to fligh off if he hits hard enough. Is this an unintended accident or a demonstration of breaking joints?
I don't know muc about the technical stuff of how ragdoll works and its limitations, etc. I tortured the ragdoll in your demo with some pretty high velocity impacts into the giant block and found that his limbs tend to fligh off if he hits hard enough. Is this an unintended accident or a demonstration of breaking joints?
-
- OGRE Expert User
- Posts: 286
- Joined: Fri Nov 01, 2002 3:54 pm
- Location: Berlin & Nuremberg, Germany
- x 1
Did you take a look at ODF, Rocket etc?
Check here: http://www.physicstools.org/.
Rocket is like a RAD environment for physics apps. Is that what you're aiming at?
-psy
Check here: http://www.physicstools.org/.
Rocket is like a RAD environment for physics apps. Is that what you're aiming at?
-psy
-
- Gnoblar
- Posts: 24
- Joined: Thu Apr 21, 2005 7:23 pm
We started OPAL around the same time that ODF was getting off the ground. At that time there was no ODE support in ODF, and we wanted something that would work on all platforms (like ODE). OPAL has been tested on multiple platforms (Win32, Mac OS X, Linux, and IRIX); ODF, it seems, is mainly focused on the Win32 platform. OPAL also has a few features that ODF currently doesn't have, like some of the motors and sensors (e.g. incline sensor, volume sensor).Did you take a look at ODF, Rocket etc?
Check here: http://www.physicstools.org/.
Rocket is like a RAD environment for physics apps. Is that what you're aiming at?
That's the breakable joints feature. This can be turned off/adjusted. This demo loads the ragdoll from an OPAL XML file, so if you want, you can open ragdoll.xml and tweak the "BreakThresh" value.I don't know muc about the technical stuff of how ragdoll works and its limitations, etc. I tortured the ragdoll in your demo with some pretty high velocity impacts into the giant block and found that his limbs tend to fligh off if he hits hard enough. Is this an unintended accident or a demonstration of breaking joints?
Not totally sure on that. I have a PentiumM 1.6 GHz, and in 1024x768 with a tower of blocks I get 166fps, 36fps, and 22fps with no shadows, shadows w/ 1 light source, and shadows w/ 2 light sources, respectively. Did you run it with or without shadows? What's your video card?One thing bothers me. Why do I get _1_ fps when pressing 8? Yeah, I know, it's because of these objects created, but hell, there's P4 3GHz inside my box, it should be enough. It gets a little bit better (5 fps?) when the stack collapses but it's too slow anyway.
And I think it's OPAL doing something really bad, because when I run OgreODE and Helicopter vs Wall demo (there's a lot of boxes creating a wall) I get ~100 fps.
I haven't had time to check the sources, maybe these bricks are trimeshes or something and that's the cause of poor performance.
Sorry, I'm new.Looks quite nice though you should post some screens here I suppose - it's Showcase forum.




-
- Halfling
- Posts: 40
- Joined: Fri May 23, 2003 10:46 pm
- Location: Warsaw, Poland
Geforce 6600GT/PCI-E - I can assure that's not the problemtylerstreeter wrote:Not totally sure on that. I have a PentiumM 1.6 GHz, and in 1024x768 with a tower of blocks I get 166fps, 36fps, and 22fps with no shadows, shadows w/ 1 light source, and shadows w/ 2 light sources, respectively. Did you run it with or without shadows? What's your video card?

Others don't seem to report this so maybe it's just my comp, crappy and installed ages ago Windows or aliens invading my motherboard

Strange thing it' that only when all the bricks are on their place - when they form a tower. When the tower collapses everything seems to be fine.
Marcin Jakubowski
jabber://myak@chrome.pl
jabber://myak@chrome.pl
-
- Gnoblar
- Posts: 24
- Joined: Thu Apr 21, 2005 7:23 pm
The tower should definitely slow things down a lot since there are so many contact points being generated continually, but I don't know why it slows down that much on your machine. If anyone else sees the same problem, please post your computer specs too.Geforce 6600GT/PCI-E - I can assure that's not the problem Smiletylerstreeter wrote:
Not totally sure on that. I have a PentiumM 1.6 GHz, and in 1024x768 with a tower of blocks I get 166fps, 36fps, and 22fps with no shadows, shadows w/ 1 light source, and shadows w/ 2 light sources, respectively. Did you run it with or without shadows? What's your video card?
Others don't seem to report this so maybe it's just my comp, crappy and installed ages ago Windows or aliens invading my motherboard Wink
Strange thing it' that only when all the bricks are on their place - when they form a tower. When the tower collapses everything seems to be fine.
-
- Platinum Sponsor
- Posts: 1186
- Joined: Sat Apr 17, 2004 2:49 am
- x 3
That's cool.That's the breakable joints feature. This can be turned off/adjusted. This demo loads the ragdoll from an OPAL XML file, so if you want, you can open ragdoll.xml and tweak the "BreakThresh" value
Am I the only person who has -way- too much fun abusing the poor ragdolls in demos like this?
I've had no performance problems with the demo.
-
- Gnoblar
- Posts: 24
- Joined: Tue Mar 15, 2005 8:03 pm
Same Problem with D3D9 and OpenGL.tylerstreeter wrote:The tower should definitely slow things down a lot since there are so many contact points being generated continually, but I don't know why it slows down that much on your machine. If anyone else sees the same problem, please post your computer specs too.Geforce 6600GT/PCI-E - I can assure that's not the problem Smiletylerstreeter wrote:
Not totally sure on that. I have a PentiumM 1.6 GHz, and in 1024x768 with a tower of blocks I get 166fps, 36fps, and 22fps with no shadows, shadows w/ 1 light source, and shadows w/ 2 light sources, respectively. Did you run it with or without shadows? What's your video card?
Others don't seem to report this so maybe it's just my comp, crappy and installed ages ago Windows or aliens invading my motherboard Wink
Strange thing it' that only when all the bricks are on their place - when they form a tower. When the tower collapses everything seems to be fine.
My PC:
Athlon XP 2GHZ
Geforce 4 Ti 4200
1 GB RAM
-
- Hobgoblin
- Posts: 593
- Joined: Fri Apr 08, 2005 6:08 pm
- Location: WA, USA
-
- Gnoblar
- Posts: 24
- Joined: Thu Apr 21, 2005 7:23 pm
Could you post the window resolution and the fps you're seeing with and without shadows? Again, here's my setup and performance:Same Problem with D3D9 and OpenGL.
My PC:
Athlon XP 2GHZ
Geforce 4 Ti 4200
1 GB RAM
Windows XP w/ SP2, PentiumM 1.6 GHz, 512mb ram, Radeon Mobility 9000, 1024x768 window (not fullscreen), single block tower, camera looking at the tower
No shadows, 1 light source: 166fps
Shadows, 1 light source: 36fps
Shadows, 2 light sources: 22fps
-
- Gnome
- Posts: 351
- Joined: Wed Oct 13, 2004 8:22 am
Really nice demo! 
It would be cool if the plane was a bit bigger. I enjoy taking the ragdoll and dropping him from really high or throwing him around until his limbs rip off, hehehe.
Only performance problems I got was when I went inside the brick wall thingy, went down to something like 8fps, from far away things were fine though.

It would be cool if the plane was a bit bigger. I enjoy taking the ragdoll and dropping him from really high or throwing him around until his limbs rip off, hehehe.
Only performance problems I got was when I went inside the brick wall thingy, went down to something like 8fps, from far away things were fine though.
-
- Halfling
- Posts: 40
- Joined: Fri May 23, 2003 10:46 pm
- Location: Warsaw, Poland
Windows XP SP2, P4 3GHz, Geforce 6600GT, 512 MB RAMtylerstreeter wrote: Could you post the window resolution and the fps you're seeing with and without shadows?
1024x768x32bpp (fullscreen):
D3D9:
Shadows: 13fps
No shadows: 45fps
GL:
Shadows: 0.9fps
No shadows: 45fps
Windowed mode gets almost the same results in GL and a little bit better in D3D9.
Camera is in the same place (default, starting position), light sources - default number (= 1, I guess).
I know it's because of many contact points but you can also notice (well, I can) that the bricks in the tower are moving (the tower would collapse without applying any forces to bricks). Seems to me that those bricks should stay at where they are until something hits them - means they should be freezed until that moment. It may be ODE related problem and it's not OPAL's fault.
[EDIT]
Nevermind the results. /me is just dumb


Sorry for troubles

But moving bricks are still a little bit strange.
[/EDIT]
Marcin Jakubowski
jabber://myak@chrome.pl
jabber://myak@chrome.pl
-
- Hobgoblin
- Posts: 593
- Joined: Fri Apr 08, 2005 6:08 pm
- Location: WA, USA
-
- Gnoblar
- Posts: 24
- Joined: Thu Apr 21, 2005 7:23 pm
No problem.Nevermind the results. /me is just dumb Smile With Einstein@Home & some really heavy calculations working in background the results were just ok Smile
Sorry for troubles Embarassed

ODE's box stacking is not perfect, but it's still pretty good with motion damping and autodisabling enabled (i.e. OPAL's linear/angular damping and sleeping features). You'll notice that the wall of blocks goes to "sleep" after just a little bit because of these features. ...But the tower never goes to sleep. The more blocks touching, the harder it is to get everything to go to sleep (with the current state of ODE, anyway). Actually, I could have just started the whole tower asleep and it would look nice initially, but the slightest nudge would wake up everything again, so I just left it.I know it's because of many contact points but you can also notice (well, I can) that the bricks in the tower are moving (the tower would collapse without applying any forces to bricks). Seems to me that those bricks should stay at where they are until something hits them - means they should be freezed until that moment. It may be ODE related problem and it's not OPAL's fault.
-
- Hobgoblin
- Posts: 593
- Joined: Fri Apr 08, 2005 6:08 pm
- Location: WA, USA
-
- Gnoblar
- Posts: 24
- Joined: Thu Apr 21, 2005 7:23 pm
No, sorry. No plans for that at the moment.Do you guys have a forum?
What's the performance hit? The damping and autodisabling algorithms, or the fact that things don't come to rest very quickly?Yeah, it's always a nagging problem with ODE, trying to get everything to come to rest.
It's also a serious performance hit. But OPAL demo handles it quite well.
That demo uses the default OPAL parameters for damping and autodisabling (sleeping). One of our goals is to provide a really good set of default parameters so users only have to tweak a few things for their apps.
No, it uses ODE's quickstep and worldstep solvers. OPAL's Simulators have an "accuracy level" parameter: the less accurate (but quicker) accuracy levels use the quickstep solver with different numbers of iterations (the least accurate level uses fewer iterations than the medium accuracy level). The most accurate level uses the worldstep solver.I have looked at the API, and my understanding is that you use ODE stepFast1(), right?
-
- Gnome
- Posts: 351
- Joined: Wed Oct 13, 2004 8:22 am
-
- Hobgoblin
- Posts: 593
- Joined: Fri Apr 08, 2005 6:08 pm
- Location: WA, USA
The fact that bodies dont come to rest quickly is a serious perfomance hit. Creation of all those collision-contact-joints is really quite a problem once you have about 300+ objects in close proximity.What's the performance hit? The damping and autodisabling algorithms, or the fact that things don't come to rest very quickly?
For example, when I throw in 3-4 towers, app just dies (<1 fps). Those boxes just keep moving around, very slowly, but yet still creating contact joints.
How does tower behave under lowest accuracy? My goal is try to reach about 1000+ objects with acceptable performance, even if I have to sucrifice accuracy.
Anybody recall "Painkiller" demo boss? It had a LOT of boxes flying around with very good perfomance.
-
- OGRE Expert User
- Posts: 1422
- Joined: Sat May 22, 2004 5:28 am
- Location: Bucharest
- x 8
-
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
-
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
Nice.
What facilites do you intend provide in regards of network games/simulation ?
(get pos/quat/accel/vel of all objects, time rewind, make simulation deterministic, etc..)
Check this a good addition to your ragdolls : http://www.mmandel.com/gdc
What facilites do you intend provide in regards of network games/simulation ?
(get pos/quat/accel/vel of all objects, time rewind, make simulation deterministic, etc..)
Check this a good addition to your ragdolls : http://www.mmandel.com/gdc
-
- Halfling
- Posts: 40
- Joined: Fri May 23, 2003 10:46 pm
- Location: Warsaw, Poland
I'm also very interested in this, especially in making simulation deterministic.tuan kuranes wrote:What facilites do you intend provide in regards of network games/simulation ?
Marcin Jakubowski
jabber://myak@chrome.pl
jabber://myak@chrome.pl
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
-
- OGRE Contributor
- Posts: 570
- Joined: Mon Mar 01, 2004 10:35 am
- Location: Hamburg, Germany
Re: Open Physics Abstraction Layer sample app
For the planned feature "OPAL XML exporter for Blender" it would be very nice if one could import it as a Python module and call it on a per Blender object level. This way a seamless integration with the DotScene exporter would be very easy.