Page 3 of 29

Posted: Wed Dec 20, 2006 4:29 pm
by DavidR
Hi there.

This framework looks really promising, just like the many others out there, and I'm currently just 'floating around' trying each one and seeing which one is 'best for me'/my project.

I was just wondering, could you possibly create a very simple example of the framework (a 'hello world' equivalent in physics) so I can get the gist of your framework?

The current demo's are very nice, but it's hard to get down to the nuts and bolts of what commands to use etc. without a simple example to show how.

Thanks :)

Posted: Wed Dec 20, 2006 6:17 pm
by white tiger
I was just wondering, could you possibly create a very simple example of the framework (a 'hello world' equivalent in physics) so I can get the gist of your framework?
yes. in the next release there will be a very simple example. currently you can see the example "materials and shapes" (it's quite simple also in my hopinion) However, this is the basic steps to create a simple physics.

1)create your program normally, insert all nodes, tree nodes (addTreeSceneNode), terrain exc...

2)create a physics world using irr::newton::createPhysicsWorld(device); assign the returned value to a variable, like "p_world"

3)create the relative bodies for your nodes. Currently you need to call p_world->createBodyAuto and pass it the scene node as first parameter and, only if your node is a tree node(addOctTreeSceneNode) also the mesh as second parameter. Then IrrNewt choose automatically the correct body type (simple,tree or tree terrain) and create it

4)add a force to a body, use body::addForce somewhere after create the body

5)last step: in the main loop (while(device->run()){ generally) insert P_world->update() somewhere, (p_world is your irr::newton::World object, you can assign at it the name wich you want) to update newton

with this you can see a rigid body affected by a force. If in your scene there is also a oct tree scene node and you create the relative body, if the body affected by force falls on it, it will bounce a bit for default
The current demo's are very nice, but it's hard to get down to the nuts and bolts of what commands to use etc. without a simple example to show how.
demo illustrates principally character controller. I wrote here full character controlling documentation with many examples. you can also find in the previous link full documentation of irrnewt

bye

Posted: Sun Dec 24, 2006 10:51 am
by Espanol
This is another good work for used physics easier in Irrlicht.

But please excute to this simple advice of me. I would like IrrNewt project owner to add "core::vector3df originOfPhysicsBody" as the last parameter when create body to adjust the origin of physics for some case that someone has exported their character from 3d max which its feet at 0,0,0(in common, they should position its hip at 0,0,0) and after they set a physic body to their node, the node will over the floor equal to the half of character height.

This case was happened in IPhysics too, but I modefy it by myself easily because IPhysics code didn't complex to under stand as your more expert project.

Thank you very much for your useful work.

P.S. I hope to see some ODE wrapper for Irrlicht like this for a very long time....

Posted: Sun Dec 24, 2006 12:43 pm
by DavidR
Hi again.

Thanks very much for the step-by-step guide. I've successfully implemented IrrNewt into my project, and it is working beautifully.

Thanks again for this brilliant framework :)

Posted: Sun Dec 24, 2006 3:21 pm
by white tiger
I would like IrrNewt project owner to add "core::vector3df originOfPhysicsBody" as the last parameter when create body to adjust the origin of physics for some case that someone has exported their character from 3d max which its feet at 0,0,0(in common, they should position its hip at 0,0,0) and after they set a physic body to their node, the node will over the floor equal to the half of character height.
currently this doesn't happen in IrrNewt. IrrNewt calculates automatically the offset from the real oring of the node and 0,0,0 (local to the body). So if in your model file the center of your model is at 0,0,0 or at any position the body is created corretly and circumscribes completely only and all the node. If you open "irr_newt/media/rigell.md2" you can see that the model feet is at 0,0,0. However for extremely rare case i will insert a offset matrix as parametrs of createbody and in SBody struct. a matrix allow you to specify position and rotation offset :D

Posted: Mon Dec 25, 2006 12:00 am
by benny53
One thing I would like from this that would make it amazing,is the ability to have the character controller,when stopped,not slide down slopes. That is the only semi-annoying thing about this,and its not even that annoying.

Posted: Tue Dec 26, 2006 12:06 pm
by white tiger
@benny53: set character linear damping to 0

Posted: Tue Dec 26, 2006 5:07 pm
by benny53
Thats not what I'm talking about. I'm saying like if the body is stopped,it will have infinite friction against static objects,like in the PhysX sdk. Because linear damping has no control over whether something slides down a slope with no friction(because you disabled the friction to be able to move the controller,I think). So that is the problem with that. Because any game you play with physics,I guarantee they will not slide down small slopes(unless its steep enough).

Posted: Sat Dec 30, 2006 5:37 pm
by white tiger
fixed thanks :D in the next release the character doesn't slides down a slope.

I set a high static friction coefficent. This mean that the force needed to move the stopped character is high. This also mean that the body doesn't slide down.

Also a relative low kinematic friction coefficent allows a fluid movement.

I also reduce gravity (to scramble up better the slope) and improve friction coefficents to compensate more small normal force

(shaving friction=friction_coefficent*normal_force (with normal_force=height_force*cos(a) if the body in on a slope when a is angular coefficent of the slope)

Sorry for the "set linear damping to 0" answer, I didn't understand your question.

News:
I ported all newton world functions, i implemented all newton primitives (chamfer cylinder, cylinder, ellipsoid, box, cone, capsule and also null). all primitives size is automatically calculated, simply pass the node, i also implemented body-scene node offset matrix, beyond the feature previously implemented

Posted: Sat Dec 30, 2006 6:33 pm
by white tiger
hinge joint and universal joint implemented (hinge joint in the screen)

Image

now implementing the other joints

Posted: Sat Dec 30, 2006 9:51 pm
by BlindSide
This is looking good.

Posted: Sun Dec 31, 2006 7:29 am
by benny53
I knew you didn't understand it:) And it is quite alright. This is an amazing thing you have going,and it is quite useful.

Posted: Sun Dec 31, 2006 12:39 pm
by white tiger
i implemented all newton joints except one. here is a screen shot

Image

They are (ordered)

hinge joint (the 1st)
universal joint (the 2nd)
corksrew joint (the 3rd) (a corksrew joint is a hinge+slider joint)
slider joint (the 4th)

now implementing the last joint, called "ball and socket joint". afterwards i will release a new version of IrrNewt.
This is an amazing thing you have going,and it is quite useful.
This is looking good.
i'm glad to hear that :D

Posted: Mon Jan 01, 2007 8:41 pm
by DavidR
Hmm, I'm having a problem with IrrNewt at the moment. It seems that it is dependent on Frame rate somehow - if my FPS gets very high, all physics interactions occur very quickly :?

Is it supposed to be FPS independent? Or is this something IrrNewt doesn't do?

Posted: Mon Jan 01, 2007 10:06 pm
by benny53
@DavidR - you could probably change it. It updates newton according to the framerate,but you could edit the upate function and set it to about 100.0f or so and it would work. When I used newton in one of my projects I set the update rate to 100.0f and it worked fine.