Game Development Community

Newton Physics Engine integrated (Part 1)

by William Bryan · in Torque Game Engine · 03/19/2004 (3:39 pm) · 54 replies

Ive integraded the 1.01 version of the free Newton physics engine with Torque (www.physicsengine.com)

Ill try to get a demo of something available, but below is the list of calls available for those of you who are physics junkies.

World interface
NewtonCreate Create an instance of the Newton world.
NewtonDestroy Destroy an instance of the Newton world.
NewtonUpdate Advance the simulation by an amount of time.
NewtonSetMinimumFrameRate Set the minimum frame rate at witch the simulation can run.
NewtonDestroyAllBodies Remove all bodies and joints from the newton world.
NewtonSetWorldSize Set the size of the Newton world.
NewtonSetBodyLeaveWorldEvent Set the event callback function to be called in the event a body escaping the limits of the world during simulation time.
NewtonWorldFreezeBody Remove the body from the active simulation list.
NewtonWorldUnfreezeBody Add the body to the active simulation list.
GroupID interface
NewtonMaterialGetDefaultGroupID Get the value of the default MaterialGroupID.
NewtonMaterialCreateGroupID Create a new MaterialGroupID.
NewtonMaterialDestroyAllGroupID Remove all groups ID from the Newton world.
Material setup interface
NewtonMaterialSetDefaultCollidable Set the material defined by the interaction between two physics groups to be collidable or non-collidable by default.
NewtonMaterialSetDefaultFriction Set the default coefficients of friction for the material defined by the interaction between two physics groups.
NewtonMaterialSetDefaultElasticity Set the default coefficents of restitution (elasticity) for the material defined by the interaction between two physics groups.
NewtonMaterialSetDefaultSoftness Set the default softness coefficents for the material defined by the interaction between two physics groups.
NewtonMaterialSetCollisionCallback Set userData and the functions event handles for the material defined by the interaction between two physics groups.
Contact behaviour control interface
NewtonMaterialDisableContact Disable processing for the contact.
NewtonMaterialGetContactUserData Get the userData set by the application when it created this material pair.
NewtonMaterialGetContactNormalSpeed Calculate the speed of this contact along the normal vector of the contact.
Page«First 1 2 3 Next»
#41
04/12/2006 (1:47 pm)
I'd say that NOvodex/PhysX is probably better than Newton, seems to work a bit faster...
But, you can't make PhysX crossplatform unless you have the license...
#42
04/13/2006 (7:34 am)
Yeah but PhysX has already been implemented into TGE so its great even if its just as a temporary solution
#43
04/13/2006 (8:36 am)
Hey guys,

@James - I don't think that the PhysX integration was ever made into a resource...so is it really available? (I apologize in advance if I am "search-impaired", but I didn' t see it...)

ODE concerns me becaused there hasn't been an update since May-04.

Physx concerns me because "supporting the PPU" and getting them to take the time to waive the $50K price tag, may entail more than it seems.

That makes Newton a prime candidate, in my mind. Does anyone have any negatives on Newton? It seems to be in active development and it looks like some people prefer it to ODE.

Todd
#44
04/13/2006 (6:26 pm)
Newton is pretty damned good, search for the 'newton playground' and take a look!
I prefer Newton over ODE most of the time, some things ode does better (not alot really) and somethings newton does better (collisions and joints).
PhysX is the faster out of them all, but the license issue will hold you back a bit.
#45
02/11/2007 (2:54 pm)
Hi, sorry if i am a bit late on this one. Has the Newton Physics been successfully done with TGE? Thanks.
#46
04/16/2007 (5:03 am)
BUMP ...

Has anyone persued Newton within TGE any further ?

I've implemented the ODEscript resource and that works reasonably well, but what I need to work with is buoyancy and ODE doesn't appear to support this (Newton does).

I followed some of the discussions on the Newton forum and the issue seemed to be around replacing the Torque collision stuff with Newton's collision code. Too bad that I'm not an experienced C/C++ coder, or else I would try to tackle this myself ... (but it's also good to know one's limits ;) ).

Cheers,
Andreas
#47
04/16/2007 (2:11 pm)
More or less on a whim, I just added buoyancy to ODEScript. *giggle*

Gary (-;
#48
04/16/2007 (3:18 pm)
OK, Mr. Whimsical Giggles ... just tell it to me straight ... ;-)

Wadda ya mean ???????

Cheers,
Andreas
#50
04/16/2007 (3:52 pm)
OK ... so I'm dense ... and confused. I couldn't find anything related to buoyancy in the ODE docs, yet it is in the "old" ODEScript ??? Way cool !

You are a gentleman and a scholar ... and darn fast making those videos *grin*

Did you ever look at NGD ? *coming back to the original thread*

Obviously, I'm no expect (just in case you hadn't guessed), but from what I read so far, NGD is supposed to be very robust and extremely fast (both ODE and NGD use physics jargon that's way beyond me, so as far as that goes, they could be telling me that it turns lead into gold and I'd believe that ;-) )

Cheers,
Andreas
#51
04/16/2007 (4:07 pm)
What version of the ODE do I use
#52
04/16/2007 (4:14 pm)
It's because ODE doesn't support bouyancy, and until a couple hours ago, ODEScript didn't support buoyancy either.

I just wrote, uh, something like 20 lines of code to apply appropriate forces at appropriate times, and magically, stuff floats :-). I also pushed up a new ODEScript code bundle on that resource, so it's not technically the "old" ODEScript so much as a "shiny new one with the same old body of text below it"

I have never used Newton. Back when I was evaluating toolkits for adding a physics engine to torque, I found Newton to be lacking regarding my personal requirements. I downloaded and tried the demos and they seemed decent enough, but didn't find myself moved to use it in the face of its deficiencies.

Honestly, if Newton is what you wanna use, go ahead. I think there have been several goes at implementing it in torque, and while I haven't tried them myself, I'm told they're more than sufficient for most tasks :-)

Gary (-;
#53
04/16/2007 (4:24 pm)
Gary,
thanks so much
... I truly appreciate what you're doing for us !

While the issue ob buoyancy now longer nags me (I'll try it tomorrow), I'm really baffled because I thought that NGD had, in fact, NOT been successfully implemented in Torque. From the threads I found, it appears that there have been attempts, but none completed.

In any event ... something else to try !

Gn8,
Andreas
#54
04/16/2007 (5:28 pm)
Oh. In that case, maybe no-one has finished a Newton implementation. I dunno! I never really looked into it too hard because, like I said, Newton is lacking for my personal use :-)

Gary (-;
Page«First 1 2 3 Next»