Page 1 of 23

IPhysics - Newton/Irrlicht framework

Posted: Wed Sep 27, 2006 8:41 pm
by Nick_Japan
I've just released the first version of IPhysics, which is a set of classes for using Newton and Irrlicht together. It is also the spiritual successor to the 'Newton Vehicles in Irrlicht tutorial' which I wrote, oooh, two years ago? (For Irrlicht 0.6! Back in the day...)

There have been and indeed still are a few Newton / Irrlicht things around, but here's what I'm designing for with IPhysics:

- Designed wholly for Irrlicht use - everything uses native Irrlicht classes like vector3df.
- Really easy to use - no need to wrestle with Newton callbacks.
- Seamless integration into your project - the interface design is inspired by Irrlicht's: you have one root object through which all calls are made, and you are returned pointers to abstract interface classes so you can only call the functions that you need.
- Supports all the usual functionality that everyone's always trying to implement - terrain, collision tree, vehicles...

So that's the plan, anyway. The current release supports:
- cubes
- spheres
- terrain
- static meshes (levels etc)
- (simple) vehicles

Screenshot:
Image

The download package contains the full source, documentation, some examples and example code, and a precompiled static library so you can use it in your own projects.

Clickys:
Website | Direct Download

The next big things on my to-do list are:
- character controller
- timing / update fix

To all Newton users: how do you run Newton with a correct timestep? From what I can see, passing Newton a 'correct' timestep makes it run in slow-motion, and passing it a stupidly big value just makes it decide for itself what the timestep should be (you can check with NewtonGetTimeStep() what it actually used), based on what minimum frame rate you specified with NewtonSetMinimumFrameRate().

To everyone else: the above is why I'm creating IPhysics - so we don't have to go through all that ever again!

Posted: Wed Sep 27, 2006 8:46 pm
by JPulham
COOOL :shock:
love it... thanks.
BTW... any chance of ragdolls aswell? :D :roll:

Posted: Wed Sep 27, 2006 11:35 pm
by monkeycracks
Your my hero for the day!

The examples are good and it runs fast and easy to use :D

Posted: Thu Sep 28, 2006 4:52 am
by monkeycracks
I have everything linked properly and the DLLs are in the same folder etc. however when I try to compile example 1 in my project...

[Linker error] undefined reference to `CPhysics::CPhysics()'
[Linker error] undefined reference to `CPhysics::init()'
[Linker error] undefined reference to `CPhysics::addEntity(SPhysicsCube*)'
[Linker error] undefined reference to `CPhysics::addEntity(SPhysicsCube*)'
[Linker error] undefined reference to `CPhysics::~CPhysics()'
[Linker error] undefined reference to `CPhysics::~CPhysics()'

I also have all the Newton libs linked. I use Irrlicht 1.1 and Newton 1.53

Posted: Thu Sep 28, 2006 8:05 am
by Lee Zhi Eng
it seems like much easier to use than the original newton engine!

Posted: Thu Sep 28, 2006 8:17 am
by zeno60
This will come in very handy for a lot of people, good work, and good luck on future updates.

As far as your timestep question, a lot of questions asked about how to update newton with a correct timestep get responces linking to http://www.gaffer.org/fix-your-timestep

No doubt you have seen it if you have scoured around the Newton forums. I've glanced over it a few times, haven't tried implementing it though. :?

Posted: Thu Sep 28, 2006 8:32 am
by Nick_Japan
@zeno60: Nice one - thanks for the link. Hadn't seen that one - I found lots of things on the Newton forum about time splicing, which looked a bit odd because from what I could tell you ended up calling NewtonUpdate several times per frame.

@monkeycracks: do you have the line:

Code: Select all

#pragma comment(lib, "IPhysics.lib")
in your header?

Posted: Thu Sep 28, 2006 11:30 am
by gfxstyler
hi!

do you plan to support ode, too :D ? im just curious

Posted: Thu Sep 28, 2006 12:06 pm
by TheGameMaker
Hey Thx.. plus source!!! Big thanks...
But you didn´t got constrains to work, did you??
Well i´ll have a look, if im able to do them...
Greetz TGM

Posted: Thu Sep 28, 2006 12:29 pm
by Nick_Japan
@gfxstyler: No plans for ODE.

@TheGameMaker: No constraints yet - my plan is to go through and implement all the Newton basic types first, and then a character controller. The main reason for this is that a lot of this stuff is floating around already - Mercior's original tutorial, my vehicle stuff, and then people like dhenton have made some great FPS character controllers, so hopefully it should all come together quite quickly.

Posted: Thu Sep 28, 2006 12:59 pm
by nasty
Wow Nick, really a great work.
I'm looking for a good wrapper for Irr/Newton .. until now!

Really thanks again!

Posted: Thu Sep 28, 2006 2:50 pm
by Emil_halim
i did not use Newton from befor but this make me want to start that way.

Nick it is very easy , so keep up that good work.

have small question, i sow you impliment Cube Sphere and Car Objects, so could it be a bit more general , i.e. the Car Object has child Objects those built in the Library , and i want it to allow us to Make the hirarrchy system .

thanks

Bey.

Posted: Thu Sep 28, 2006 3:42 pm
by Nick_Japan
I've just updated IPhysics to 1.1 - the only real fix is the timing issues, which now work properly. Everything now moves a little bit slowly, and at the moment I'm still working out why, but it's definitely more correct than it was ;)

Also a couple of interface tweaks: firstly, the IPhysics constructor now needs a pointer to the ITimer in your IrrlichtDevice. Secondly, update() doesn't take any arguments any more - it works out the timestep itself!

@Emil_halim: At the moment each entity is considered seperate - when I start adding the rest of the Newton primitives, of course I'll also add the ability to have compound primitives. More complex hierarchies are a little way off though!

Posted: Thu Sep 28, 2006 3:52 pm
by RapchikProgrammer
I am dnldin it rit now, but if it doesnt hav it please do add support for physics of fps cameras! Applying physics on camera has been a major problem for me, and if that is supported in ur code then itll definetly be really really useful for me! And BTW r u planning to make it opensource??

Posted: Thu Sep 28, 2006 4:06 pm
by Nick_Japan
Support for character control, as in the player in an FPS game, is not currently implemented but is the next feature I want to add. Shouldn't take too long as there are a couple of working implementations around. The source code is included, so yes, it is open source.