IrrNewt irrlicht\newton framework >> SVN access
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
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
-
- Posts: 269
- Joined: Tue Oct 31, 2006 3:24 pm
- Contact:
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.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?
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
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 irrnewtThe 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.
bye
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....
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....
-
- Posts: 269
- Joined: Tue Oct 31, 2006 3:24 pm
- Contact:
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 offsetI 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.
-
- Posts: 269
- Joined: Tue Oct 31, 2006 3:24 pm
- Contact:
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).
-
- Posts: 269
- Joined: Tue Oct 31, 2006 3:24 pm
- Contact:
fixed thanks 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
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
Last edited by white tiger on Sun Dec 31, 2006 1:05 pm, edited 2 times in total.
-
- Posts: 269
- Joined: Tue Oct 31, 2006 3:24 pm
- Contact:
-
- Posts: 269
- Joined: Tue Oct 31, 2006 3:24 pm
- Contact:
i implemented all newton joints except one. here is a screen shot
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.
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.
i'm glad to hear thatThis is an amazing thing you have going,and it is quite useful.
This is looking good.