v0.6: ODE physics!
Hi,
here is another update to the Irrlicht Xtra, v0.6, 807Kb in size, and now with the ODE physics engine on board.
Grab the new Xtra, toss it into the Xtras folder of your Director installation, and run the demo movie (make sure you got the media folder right next to it).
Enjoy!
Added methods:
- createPhysics() — initializes the physics engine
- shutdownPhysics() — shuts down the physics engine
- addBody(TYPE, position, rotation, size, density) — adds a model TYPE to the physics simulation - TYPE can be #sphere,#box, #cylinder, #capsule, #character_avatar (for fps cameras) - position. rotation and size are optional vectors, density an optional float describing the mass of the object
- setWorld(TriangleSelection)
- getWorld() — returns the triangleselection which makes up the physics world
- updateWorld() — updates only a segment of the physics world
- collidesRayWithWorld(from,to) — from, to = vectors, returns true or false if a physics world segment is hit
- getBody(idx) — idx is a number>0 and idx
- removeBody(idx) — removes the body from the physics engine
- setSimulationHz() — sets the speed of the simulation
- getSimulationHz() — gets the speed of the physics simulation, default is 60
- getType() — returns name of physics engine, now only #ODE
- createPhysicsAvatarAnimator() — ties a fps cam to a physics object so that you can interact with the 3d world
Here is code on how to initialize the physics engine:
wrld=sprite(1).member
cam=wrld.newCamera(”mycam”,#fps)
cam.setPosition(10,50,10)mdl=sprite(1).quakeMap — just fetching the model from the sprite, nothing 3d here…
mesh=sprite(1).quakeMesh — same here, but for the mesh
— just fetched the model and mesh of the map so that it can be submitted to the triangle selectortriangleSelector=wrld.createTriangleSelector(mesh, mdl)
— got the triangle selector, now doing the assignmentwrld.createPhysics() — create the physics engine
wrld.setWorld(triangleSelector) — submit the quake mesh triangle selector to the engine
wrld.createPhysicsAvatarAnimator(cam,4,2, vector(10,10,75)) — creates a fps cam tied to a physics object with eyeheight 4, density 2 and size vector(10,10,75)



April 9th, 2007 at 8:50 pm
Well done, everything going well ^_^
But trying to run your demo movie or a compilation of it just crash whatever display mode I choose (???)
April 9th, 2007 at 11:49 pm
You have to put the media folder next to the irrlichttest.dir. If you have no media folder next to the file it crashed. I use director 2004 and it works but i got Handler not found in Object for the addphysics button and the addCollisonDet button.
The engine feels stable and smooth a awesome update!
April 10th, 2007 at 12:06 am
You have to put the media folder next to the irrlichttest.dir. If you have no media folder next to the file it crashed. I use director 2004 and it works but i got Handler not found in Object for the addCollisonDet button.
The engine feels stable and smooth a awesome update!
April 17th, 2007 at 5:16 pm
Hi there Angel3d,
first you say “well done, everything going well”, then you say that the movie is crashing for you?
I´d need more info on that.
The Xtra only works in auhtoring for the time being. Also make sure that the media folder is next to the demo movie (in the same folder actually), so that the assets can be loaded and showed.
Which version of Director are you using? The Xtras was compiled using the latest version of the XDK.
Greets,
Christophe Leske
April 20th, 2007 at 10:37 pm
Problem solved ! Thanks !
Really great update !
April 20th, 2007 at 10:38 pm
Great!
Good to read that.
Greets,
C
May 20th, 2007 at 11:17 pm
as I’m thinking that we could use something like that perfectly for a project where we need dx 9 compatibility which adobe itself does not offer til now:
is it already shockwave safe?
is the beta stable? Are u already able to say when a final release will be likely to happen?
PS: I know, I know it’s OS, so don’t consider my questions as demands but just as questions =)
PSPS: ah yes, found no other way to contact you, just via the comments section
May 21st, 2007 at 9:34 am
Hi Erhard
the Xtra is not Shockwave safe, but for the heck of it, i am gonna to do this next. Niko and I would like to meet sometimes in Juli and finish this Xtra with the latest additiobs (Irrklangm IrrEdit and of course Irrlicht).
So a final release is likely to be happening in August. If you want to contact me directly, you can do so at info _at_ multimedial.de.
Thanks, and greets,
C
May 29th, 2007 at 5:54 pm
Hi C,
The OpenSource Bullet Physics library seems to be a good match for ODE, is updated more often, and has advanced features ( bullet through paper etc ) that ODE doesn’t.
It might be worth having a look at Bullet as an alternative to ODE - I know the main developer, Erwin, very well ( currently working at Sony, used to work for Havok ), and he’s a very cool guy.
Here’s the link…
http://www.continuousphysics.com/Bullet/
Keep up the great work with the 3D Xtra! If you could abstract the 3D engines ( eg display / update scenegraph in OGRE3D/Irrlicht/CrystalSpace etc ), and the physics ( auto-update the scenegraph depending on physical interactions, either in Bullet/ODE etc ), you would have a kick-arse Game Xtra! Of course, it’s difficult even getting a single 3D/physics Xtra ready!!!
Mal
May 29th, 2007 at 11:00 pm
Love what you guys are doing here! I’ve been playing with Irrlicht a little using C Sharp, and the thing that has me completely stumped now is how to create skeletal animations using 3DStudio Max (that work in Irrlicht’s engine). I’m assuming that you are exclusively using pre-built media as opposed to creating any of this on your own, so it’s a long shot that anyone here is familiar with a method that works well, since the Irrlicht forums seem to be stumped also. Regardless, I’m very interested in developing something similar to 3DPI to help me get my head around using the Irrlicht Xtra. I’d rather be using the Irrlicht Xtra instead of W3D.. that’s for sure!
June 1st, 2007 at 11:03 pm
Hi. I can’t find a better way to contact you guys about questsions, so I’m posting it here (I’m expecting you to not allow it to make it into the comments, since it might not be appropriate for here). I’ve seen Chris on the Dir-3d forums, but this is specific to your Irrlicht Xtra. I regularly make a run at understanding how to use the Xtra but keep hitting walls as I try to cross reference the Lingo you’ve written in the Director example file and the Irrlicht API documentation. For instance, I find this in the Director file:
cam=wrld.newCamera(”mycam”,#fps)
But I can’t track down a comparable function as newCamera. Instead I find addCameraSceneNodeFPS(). Am I being clueless as to how Irrlicht works (or the Xtra), or is this simply something that doesn’t have documentation, so i’m wasting my time? Thanx for any tips!