IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by Brainsaw »

Oops .. the package does really not contain the IrrOdEditExample sources ... I'll add them tonight when I'm back home. But at least the provided binary should run. I don't know about the calling conventions as I didn't change them. They are the same as in the download packages.

The tutorials were completely outdated so I removed them to re-add in the future, but ... no time at the moment, too much work and such :(
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by ulao »

Hey Brainsaw, I know your busy but wanted to see if there was a problem with the tuts? Does not look like anything new is up for download. thx!
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by Brainsaw »

Well ... no tutorials at the moment. I guess I should take some time and at least re-add some basic tutorial ... I see what I can do.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by ulao »

Oh, sorry I meant examples. Just want to see if your examples give this error.
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by Brainsaw »

Well ... I updated the tutorials yesterday, but just the very basic ones (setup + hello world). I also added the "IrrOdEditExample" example in VC version again, and it works (at least on my system). I'll think about adding all necessary lib files (including the ODE stuff) to the package.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by ulao »

ah.. ok now it works?

I grabbed your latest source and I did a rebuild on the lib. Now it works.
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by ulao »

Does anyone know how to pin an object upright? That is so it will not wobble or tilt. In this case the Y axis should turn but Z and X should always point to the north star. I could do this easily in code but fighting the phys eng. sounds wrong.


Ok so I got the answer on the ODE message system
The Angular Motor (AMotor) joint is what you want. It constraints
rotations only.

1. Attach between the body and the world.
2. Set it to Euler mode.
3. Set the first axis to (1,0,0), anchored on body 1.
4. Set the thrid axis to (0,0,1), anchored to the world.
5. Constrain both first and third axis to stop rotations.

In code:

dJointID j = dJointCreateAMotor(world, 0);
// 1
dJointAttach(j, body, 0);
// 2
dJointSetAMotorMode(j, dAMotorEuler);
// 3
dJointSetAMotorAxis(j, 0, 1, 1, 0, 0);
// 4
dJointSetAMotorAxis(j, 2, 0, 0, 1, 0);
// 5
dJointSetAMotorParam(j, dParamLoStop, 0);
dJointSetAMotorParam(j, dParamHiStop, 0);
dJointSetAMotorParam(j, dParamLoStop3, 0);
dJointSetAMotorParam(j, dParamHiStop3, 0);
I want to do this in irredit for starters. So I think I want a JF ( fixed ). and it goes under my body or above it? Then I guess I just do a getJointFromName in the code and set the params ( of not able to in irredit ).

update:: Hmmm maybe I wanted MT and CIrrOdeMotor ? -- to late for now...
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by Brainsaw »

I read this article in the ODE wiki already, but haven't yet tried it:

http://ode-wiki.org/wiki/index.php?titl ... ht_capsule

Maybe this helps?
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by ulao »

Well I'm not using capsule because of some bug I had in the past, so I'm not sure its working with box. Seems to ignore gravity or sticks the player way up above ground.

Ok here is the bug I get with capsule : The values at the break are ( (6),37,-38) | actually the second two are floats I truncated. As you may remember ODE hates negatives...

Image
Some talk about the issue here http://irrlicht.sourceforge.net/forum/v ... p?p=199607
and here http://irrlicht.sourceforge.net/forum/v ... &start=405

I see you attempted a fix here
@freetimecoder:
I found out why your capsule test is not working. It is a problem with the length and the radius of the capsule. You have to think of the capsule as a cylinder which has half a sphere added on both ends, so I calculate the radius of the capsule as it's "X" size and the length is it's "Z" size and two times the radius is subtracted. In your case this brought out a negative length, and ODE doesn't like that. I got it running by changing the Capsule Node's scale to

Node->setScale(vector3df(1.0f,1.0f,1.5f));
I tried to set (1.0f,1.0f,1.5f) after its read in from the irr file. The values seem to be all 1.0 and making Z 1.5 didnt help.


------------------------------------------------------
Still like to try this world joint idea... Where is ODE_API void dJointSetAMotorMode exposed? I can't find it, confused on irrOde here a bit?

I see how to make a motor, but dont see how to set mode "MotorEuler". [dJointSetAMotorMode(j, dAMotorEuler);]

once I have a motor I need to I see setAxis but it only take one parameter? [dJointSetAMotorAxis(j, 0, 1, 1, 0, 0);]
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by Brainsaw »

I think (although I don't use capsules myself) that you still get a negative value (1.5 - 2*1.0 = -0.5). The other issue (world joint): I didn't include that, I always only add things if I need them in my own projects (at the moment still just "IrrOdeCar" ;) ).
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by ulao »

Ok, then my last hope is that I can get capsule working.
I think (although I don't use capsules myself) that you still get a negative value (1.5 - 2*1.0 = -0.5).
I'm not sure what you are saying? In the links I sent, you mentioned ODE hates negatives. Now it sounds like you are saying it "should" work ? I know your busy, trust me, I know busy but I have no clue where to begin here. Regardless, there is a bug in irrODE as myself and one other guy has discovered. Based on the info I submitted do you have any suggestions ?
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by Brainsaw »

If I understand my comments correctly then it works like this:

radius = object.X
length = object.Z - (2*radius)

this means that if the length is smaller than 2 times the radius you'll get a negative value.

I think I might add a new test to the testbed application I have added. You can see the capsule as a sphere cut in half, and the two parts are moved away from each other by the length.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by ulao »

Right I do follow you on the math, and I agree with your logic. The point I'm missing is, why is it crashing? If its crashing because of the negative value then how can I fix it. I have tried to stretch the length of the capsule in irredit but I still fail at this point. I could try stretching my model and see if it passes? Is this the correct rabbit hole to look down?


( not really related to fixing the issue, but learning is good).
in irrlicht: If I'm a human for example.
X: From my left to my right. ( lets say 1.5 [with hands down].)
Y: From my toes to my head ( lets say 5 )
z: From my back to my front ( lets say .3 )

So in measuring a capsule I would first find the great of x vs z. In this case the radius is .75 ( half the 1.5 ). This would make a perfect circle around a 1.5 object. The the length for my capsule would be 5 - 1.5 ( diameter ). So I dont really see why ODE would want to use Z for the length? maybe it uses the Z/Y instead of Y/Z coordinated system?
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by Brainsaw »

I can't remember why I took "z" as the length value, but I think this is how the capsule is oriented in ODE. Maybe ODE uses the "z-up" version of the coordinate system (whereas Irrlicht uses Y-Up), but I can't say for sure. The capsule is the only object where this leads to problems. I'll try that when I find some time at home (which will most certainly not be before weekend :( ).

Edit: just googled for the problem and found a thread on the ODE users group (http://groups.google.com/group/ode-user ... 8f79664f61). I'll try to implement that so that the capsule's default orientation is "Y-Up" (like in Irrlicht) as soon as I find some time to.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Re: IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Post by ulao »

interesting, please do give me a shout once you try it out, I'm sill lost to where in the irrODE code it would go. Let me know when you find time ;) thx.
Post Reply