And another one! Physics engine, that is!

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
psyclonist
OGRE Expert User
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!

Post by psyclonist »

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

User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Hmm, no source code, windows only

User avatar
psyclonist
OGRE Expert User
OGRE Expert User
Posts: 286
Joined: Fri Nov 01, 2002 3:54 pm
Location: Berlin & Nuremberg, Germany
x 1
Contact:

Post by psyclonist »

Closed source doesn't trouble me. But I doubt it's mature enough for production work. Then again, they seem to make good progress. And what I read about the demos they are quite interesting (performance-wise, like 25 ragdolls).

-psy

User avatar
Ctaesis
Gnoblar
Posts: 14
Joined: Thu Apr 01, 2004 12:53 am
Contact:

Post by Ctaesis »

or Havok 2.0 ...

johnf
Gnoblar
Posts: 3
Joined: Wed Apr 07, 2004 1:05 am

Post by johnf »

There is a demo of Newton used with the Irrlicht engine here with source

http://www.mercior.com/tut-newton.shtml

labigne
Gnoblar
Posts: 21
Joined: Tue Nov 25, 2003 11:19 am
Location: France Paris

Post by labigne »

Hi

well I tryed a demo given on the newton site. Great until it crashed. So as Psy said: not mature enough IMHO
Still not the best there is at what I'm doing !

Benjamin

Post by Benjamin »

I trued the demos too. And they all were great. No crash.

User avatar
psyclonist
OGRE Expert User
OGRE Expert User
Posts: 286
Joined: Fri Nov 01, 2002 3:54 pm
Location: Berlin & Nuremberg, Germany
x 1
Contact:

Post by psyclonist »

They worked for me, too. Impressive demos though with perceptible and significant slow-down when a lot of collisions were going on.

-psy

EDIT: Impressive though nothing that couldn't be done with any of the other libraries :)

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

And, just to prove that you could use it with Ogre. Here's Newton dropping 121 crates onto an 8000 triangle grassy knoll;

Image
Image
Image

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.

User avatar
temas
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 390
Joined: Sun Oct 06, 2002 11:19 pm
Location: The Woodlands, TX
Contact:

Post by temas »

Where do you guys find the time to do all this great stuff! I swear, our community rocks.

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

*bump*

Now with added beach balls and ragdolly-robots!

User avatar
Balthorn
Gnoblar
Posts: 9
Joined: Sat Apr 24, 2004 10:41 am
Location: Abbottstown, PA
Contact:

Post by Balthorn »

Hey Monster.... I'm sitting here at 4:30am working on integrating Newton into the Nature Demo :shock: ... have you had any luck working with the terrain and Newton? Also.. would you care to share some of your code on how you went about integrating Newton with Ogre? Thanks!

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

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;
monster wrote:COMMENTS DELETED
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 if
monster 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;

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.

Eclipse
Gnoblar
Posts: 8
Joined: Thu May 06, 2004 5:37 pm

Post by Eclipse »

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):
//////////////////////////////////////////////////////////////////////////
//
// 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 API can i use instead getMeshBufferCount(), getIndices() etc?
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.

Eclipse
Gnoblar
Posts: 8
Joined: Thu May 06, 2004 5:37 pm

Post by Eclipse »

ohh... emm monster, someone is really angry with you for your comment about Newton: http://www.physicsengine.com/forum/viewtopic.php?t=443 :lol: ...lol.... :wink:


my English sucks :cry:

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

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.

_bad_camel_

Post by _bad_camel_ »

Sounds like a bit of a nut if you ask me. :)

User avatar
leedgitar
OGRE Community Helper
OGRE Community Helper
Posts: 61
Joined: Wed Jan 22, 2003 1:58 am
Location: Baltimore, MD
Contact:

Post by leedgitar »

sinbad wrote:nobody wins in a flame war.
...except those who like to kick back during their lunch break and read a good flame war :lol:.

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.

User avatar
tonyzahn
Gnoblar
Posts: 11
Joined: Sun Jan 18, 2004 5:09 pm
Location: Maryland, USA

Post by tonyzahn »

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...

Lodes
Google Summer of Code Student
Google Summer of Code Student
Posts: 228
Joined: Mon Mar 17, 2003 12:02 am
Location: San Jose, CA, USA

Post by Lodes »

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.

Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1
Contact:

Post by Vectrex »

well it sounds like he's a non-native english speaker which tends to confuse the apparent 'strength' of the language :) Still... I bet he jumps when someone taps him on the shoulder..

RudePolice

Post by RudePolice »

Wow, that was quite a read! :shock:

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.

Eclipse
Gnoblar
Posts: 8
Joined: Thu May 06, 2004 5:37 pm

Post by Eclipse »

Vectrex wrote:well it sounds like he's a non-native english speaker which tends to confuse the apparent 'strength' of the language :) Still... I bet he jumps when someone taps him on the shoulder..
Hey i'm a non-native english speaker too! :shock: :oops:
But Newton is or not Open-Source? :?:

Eclipse
Gnoblar
Posts: 8
Joined: Thu May 06, 2004 5:37 pm

Post by Eclipse »

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.

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

Hi, Monster can u send me the code you used to post the screen-shots?

Julio is apparently developing his own Newton to Ogre interface I suggest you use that, rather than my code.
I used to think Monster was a bit too cocky for my taste.
Oi! I'm not cocky. I'm great. And don't I just know it.
;)

Post Reply