And another one! Physics engine, that is!
- psyclonist
- OGRE Expert User
- Posts: 286
- Joined: Fri Nov 01, 2002 3:54 pm
- Location: Berlin & Nuremberg, Germany
- x 1
- Contact:
And another one! Physics engine, that is!
http://www.physicsengine.com/
Just stumbled over it. I don't know anything about it. The author seems to very vague about the internals ... or perhaps I just didn't find the information.
Anyway, maybe it's of use to someone.
I'll stay with ODE for now but I want to implement at least one other physics plugin for Yake (probably Novodex or Tokamak).
-psy
Just stumbled over it. I don't know anything about it. The author seems to very vague about the internals ... or perhaps I just didn't find the information.
Anyway, maybe it's of use to someone.
I'll stay with ODE for now but I want to implement at least one other physics plugin for Yake (probably Novodex or Tokamak).
-psy
- psyclonist
- OGRE Expert User
- Posts: 286
- Joined: Fri Nov 01, 2002 3:54 pm
- Location: Berlin & Nuremberg, Germany
- x 1
- Contact:
-
- Gnoblar
- Posts: 3
- Joined: Wed Apr 07, 2004 1:05 am
There is a demo of Newton used with the Irrlicht engine here with source
http://www.mercior.com/tut-newton.shtml
http://www.mercior.com/tut-newton.shtml
- psyclonist
- OGRE Expert User
- Posts: 286
- Joined: Fri Nov 01, 2002 3:54 pm
- Location: Berlin & Nuremberg, Germany
- x 1
- Contact:
- monster
- OGRE Community Helper
- Posts: 1098
- Joined: Mon Sep 22, 2003 2:40 am
- Location: Melbourne, Australia
- Contact:
And, just to prove that you could use it with Ogre. Here's Newton dropping 121 crates onto an 8000 triangle grassy knoll;
According to the Newton forums there's some interesting developments promised in the Ragdoll and Vehicle areas. Lets see what happens!
According to the Newton forums there's some interesting developments promised in the Ragdoll and Vehicle areas. Lets see what happens!
Last edited by monster on Sat Apr 24, 2004 8:08 am, edited 1 time in total.
- temas
- OGRE Retired Team Member
- Posts: 390
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: The Woodlands, TX
- Contact:
- monster
- OGRE Community Helper
- Posts: 1098
- Joined: Mon Sep 22, 2003 2:40 am
- Location: Melbourne, Australia
- Contact:
- Balthorn
- Gnoblar
- Posts: 9
- Joined: Sat Apr 24, 2004 10:41 am
- Location: Abbottstown, PA
- Contact:
- monster
- OGRE Community Helper
- Posts: 1098
- Joined: Mon Sep 22, 2003 2:40 am
- Location: Melbourne, Australia
- Contact:
I'd certainly like to share my code with anyone who's interested. But at the moment it's sooo hacky that you'd run away, screaming terror, if you saw it now! Also, Newton seems to be evolving quite quickly so I'm a bit loathed to spend too much time coding nice interface classes only to have them broken by a new version!
Having said that, obviously I'll help if I can.
Some of the problems I faced were;
Having said that, obviously I'll help if I can.
Some of the problems I faced were;
If I ever get the code into a sensible state I'll definately release it, and if you've got some specific problems I'll help if I can. The basic box/sphere/mesh collisions were quite easy to set up though and the NewtonCreateTreeCollision seems OK, even ifmonster wrote:COMMENTS DELETED
I've pretty much based my stuff on the Irrlicht demo code. As an example, my transformation callback looks something like this;monster wrote:COMMENTS DELETED
Code: Select all
void Body::TransformEvent(const float* matrix)
{
Matrix3 rot
(
matrix[ 0],matrix[ 4],matrix[ 8],
matrix[ 1],matrix[ 5],matrix[ 9],
matrix[ 2],matrix[ 6],matrix[10]
);
Quaternion q;
q.FromRotationMatrix(rot);
_node->setOrientation(q);
_node->setPosition(matrix[12],matrix[13],matrix[14]);
}
Last edited by monster on Sat Jan 08, 2005 2:03 pm, edited 1 time in total.
-
- Gnoblar
- Posts: 8
- Joined: Thu May 06, 2004 5:37 pm
Hi, Monster can u send me the code you used to post the screen-shots?
Only the traslation unsing Ogre of this part (taken from the irrlitch demo):
How can I trasform my mesh in a Newton body polygon per polygon like the map in this exaple?
Thanks! my email is eclipse@playerworld.it
Only the traslation unsing Ogre of this part (taken from the irrlitch demo):
How API can i use instead getMeshBufferCount(), getIndices() etc?//////////////////////////////////////////////////////////////////////////
//
// load map
//
//////////////////////////////////////////////////////////////////////////
video::IVideoDriver* driv;
driv = device->getVideoDriver();
g_map = smgr->getMesh("data/physicstest.bsp");
g_mapnode = smgr->addOctTreeSceneNode(g_map->getMesh(0));
g_mapnode->setMaterialTexture(0, driver->getTexture("data/land2.jpg"));
g_mapnode->setMaterialFlag(EMF_LIGHTING, false);
g_mapnode = smgr->addOctTreeSceneNode(g_map->getMesh(0));
g_mapnode->setMaterialFlag(video::EMF_FOG_ENABLE,1);
//////////////////////////////////////////////////////////////////////////
//
// Create the newton collision tree from the map mesh
//
// Remember to use (video::S3DVertex) if you are loading a mesh without lightmaps
// for your level. (Like a .x or .3ds level)
//
//////////////////////////////////////////////////////////////////////////
NewtonCollision* newtonmap;
newtonmap = NewtonCreateTreeCollision(nWorld, NULL);
NewtonTreeCollisionBeginBuild(newtonmap);
int cMeshBuffer, j, i;
int v1i, v2i, v3i;
IMeshBuffer *mb;
vector3df vArray[3]; // vertex array (3*3 floats)
int tmpCount = 0;
IMesh *mesh = g_map->getMesh(0);
int buffCount = mesh->getMeshBufferCount();
for (i = 0; i < buffCount; i ++) {
for (cMeshBuffer=0; cMeshBuffer<g_map->getMesh(i)->getMeshBufferCount(); cMeshBuffer++) {
mb = g_map->getMesh(0)->getMeshBuffer(cMeshBuffer);
video::S3DVertex* mb_vertices = (irr::video::S3DVertex*)mb->getVertices();
u16* mb_indices = mb->getIndices();
// add each triangle from the mesh
for (j=0; j<mb->getIndexCount(); j+=3)
{
v1i = mb_indices[j];
v2i = mb_indices[j+1];
v3i = mb_indices[j+2];
// to make thing easier, her we can use engine data type
vArray[0] = mb_vertices[v1i].Pos * IrrToNewton;
vArray[1] = mb_vertices[v2i].Pos * IrrToNewton;
vArray[2] = mb_vertices[v3i].Pos * IrrToNewton;
// make sure we do not add degenerated polygons to the tree
vector3df e0 (vArray[1] - vArray[0]);
vector3df e1 (vArray[2] - vArray[0]);
// the area of the face is the cross product
vector3df area (e0.crossProduct (e1));
// skip faces with very small area
float mag = area.dotProduct (area);
if (mag > 1.0e-6f) {
NewtonTreeCollisionAddFace(newtonmap, 3, &vArray[0].X, sizeof (vector3df), 1);
}
}
}
}
// we definilte wan to optimize the mesh (improve performace and vehaviuor a lot)
NewtonTreeCollisionEndBuild(newtonmap, 1);
// create a ridid body to represent the world
NewtonBody* newtonmapbody;
newtonmapbody = NewtonCreateBody(nWorld, newtonmap);
// release the collsion tree (this way the application does not have to do book keeping of Newton objects
NewtonReleaseCollision (nWorld, newtonmap);
// set the newton world size based on the bsp size
vector3df boxP0;
vector3df boxP1;
matrix4 matrix;
NewtonBodyGetMatrix (newtonmapbody, &matrix.M[0]);
NewtonCollisionCalculateAABB (newtonmap, &matrix.M[0], &boxP0.X, &boxP1.X);
NewtonSetWorldSize (nWorld, &boxP0.X, &boxP1.X);
// write the level geometry
//NewtonBodyForEachPolygonDo (newtonmapbody, WriteLevel);
How can I trasform my mesh in a Newton body polygon per polygon like the map in this exaple?
Thanks! my email is eclipse@playerworld.it
Last edited by Eclipse on Fri Jun 25, 2004 2:47 pm, edited 1 time in total.
-
- Gnoblar
- Posts: 8
- Joined: Thu May 06, 2004 5:37 pm
ohh... emm monster, someone is really angry with you for your comment about Newton: http://www.physicsengine.com/forum/viewtopic.php?t=443 ...lol....
my English sucks
my English sucks
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
Wow, I think the Newton guy was over vociferous there. More people have used ODE because it's been around longer and is open-source, so is bound to have had more exposure. If Newton is better, great, but being closed source it's in a similar situation to Tokamak and Novodex in that less casual users are likely to use it if they think they'll have to pay for it later. It seems to me the best way to counter that and raise Newton's profile would be to do positive marketing, rather than to lash out at your potential users.
Personally I think all 4 affordable physics engines look interesting, and if I was in the market for one I'd test all 4 myself before making the decision, I wouldn't listen to the 'smear campaigns' the Newton guys seem to think they've been the victim of - results are everything. It's a shame they feel so bitter about their position because I don't think that projects a very positive image of their project, which is unfortunate because if it's as stable as they claim, it's very exciting. Guys, think about toning down the extreme reactions and concentrate on promoting your product - nobody wins in a flame war.
Personally I think all 4 affordable physics engines look interesting, and if I was in the market for one I'd test all 4 myself before making the decision, I wouldn't listen to the 'smear campaigns' the Newton guys seem to think they've been the victim of - results are everything. It's a shame they feel so bitter about their position because I don't think that projects a very positive image of their project, which is unfortunate because if it's as stable as they claim, it's very exciting. Guys, think about toning down the extreme reactions and concentrate on promoting your product - nobody wins in a flame war.
- leedgitar
- OGRE Community Helper
- Posts: 61
- Joined: Wed Jan 22, 2003 1:58 am
- Location: Baltimore, MD
- Contact:
...except those who like to kick back during their lunch break and read a good flame war .sinbad wrote:nobody wins in a flame war.
jk. Anyway, his comments about Ogre being difficult to get up and running were a bit odd. Now I haven't used VC6 in like 4 years, but with VS.net 2003 it works for me exactly as he says he wishes it would work for him: download, extract (the code and dependencies for your platform of course), build, run, smile.
- tonyzahn
- Gnoblar
- Posts: 11
- Joined: Sun Jan 18, 2004 5:09 pm
- Location: Maryland, USA
Wow!
That guy needs some major sedatives or something. It seems like monster was being very tactful and this guy was just looking for an argument. I have to say it's the kind of thing that makes it hard to get interested in a project.
Just lends more creedence to Gabe's Theory I guess...
That guy needs some major sedatives or something. It seems like monster was being very tactful and this guy was just looking for an argument. I have to say it's the kind of thing that makes it hard to get interested in a project.
Just lends more creedence to Gabe's Theory I guess...
-
- Google Summer of Code Student
- Posts: 228
- Joined: Mon Mar 17, 2003 12:02 am
- Location: San Jose, CA, USA
Obviously he did get carried away a bit but it doesn't mean that you guys have to insult him behind his back. I think he has a valid concern even though it feels to us that he is exagerating it a bit too much.
I hope that doesn't make people feel like they shouldn't try newton and see if it would work for their project as it looks to be a very good product, from what I've seen and tried.
I hope that doesn't make people feel like they shouldn't try newton and see if it would work for their project as it looks to be a very good product, from what I've seen and tried.
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
Wow, that was quite a read!
He's obviously an intelligent guy, but his passion for his work is a tad bit extreme. I wonder if ol' Julio has forgotten to take his chill pill this week?
Defending and promoting your work is one thing, but this guy is just advertising himself as both exceptionally arrogant and haunted by some form of extreme paranoia.
How dare he confront Monster so aggressively!? Look at the beginning of this very post. What is Monster doing? Well, he's only gone and made a post about Newton, and he's claimed that yes, it IS possible to get OGRE and Newton running together. Look, he's even posted a nice screenshot of it in action! If anything, I do believe that monster is actually PROMOTING Newton. Tsk tsk, I don’t think he'll be making THAT mistake again, do you?
I used to think Monster was a bit too cocky for my taste. He never held any ‘influence’ over me, like Julio is imagining. But after all this un-instigated abuse, Monster, I say big respect to you! You refused to engage Julio in a schoolyard slapping match; you did not lower yourself to his self-absorbed schizophrenic level, but instead said your part and politely took your leave.
Check elsewhere on the Newton forums:
http://www.physicsengine.com/forum/view ... t=449#2293
Yes, there’s competition out there Julio, get used to it! Let your work speak for it self.
Or in the very least, get a spokesperson: I don’t think your ranting does you or you’re your physics engine any favors.
He's obviously an intelligent guy, but his passion for his work is a tad bit extreme. I wonder if ol' Julio has forgotten to take his chill pill this week?
Defending and promoting your work is one thing, but this guy is just advertising himself as both exceptionally arrogant and haunted by some form of extreme paranoia.
How dare he confront Monster so aggressively!? Look at the beginning of this very post. What is Monster doing? Well, he's only gone and made a post about Newton, and he's claimed that yes, it IS possible to get OGRE and Newton running together. Look, he's even posted a nice screenshot of it in action! If anything, I do believe that monster is actually PROMOTING Newton. Tsk tsk, I don’t think he'll be making THAT mistake again, do you?
I used to think Monster was a bit too cocky for my taste. He never held any ‘influence’ over me, like Julio is imagining. But after all this un-instigated abuse, Monster, I say big respect to you! You refused to engage Julio in a schoolyard slapping match; you did not lower yourself to his self-absorbed schizophrenic level, but instead said your part and politely took your leave.
Check elsewhere on the Newton forums:
http://www.physicsengine.com/forum/view ... t=449#2293
Yes, there’s competition out there Julio, get used to it! Let your work speak for it self.
Or in the very least, get a spokesperson: I don’t think your ranting does you or you’re your physics engine any favors.
-
- Gnoblar
- Posts: 8
- Joined: Thu May 06, 2004 5:37 pm
-
- Gnoblar
- Posts: 8
- Joined: Thu May 06, 2004 5:37 pm
Ok... i have tried Newton with Irrlicht, with Ogre and with simple OpenGL Demo.... it is really more simple of Ode, for example in a corversion to a mesh in a physic body.
It is stable and not slow (tested with 500 boxes, 25 ragdolls and a 35000 poly mesh for the terrain).
I choose to use this now instead Ode, because Ode is too difficult for me.
Try Newton, it isn't a non stable engine.
It is stable and not slow (tested with 500 boxes, 25 ragdolls and a 35000 poly mesh for the terrain).
I choose to use this now instead Ode, because Ode is too difficult for me.
Try Newton, it isn't a non stable engine.
- monster
- OGRE Community Helper
- Posts: 1098
- Joined: Mon Sep 22, 2003 2:40 am
- Location: Melbourne, Australia
- Contact: