Here's an update of my Runge-Kutta 4 Numerical Integrator example for Physics simulation.

I've updated it to support 3D and to support REAL8 time.

It's not OOP !! It's just structs and procs, easy on beginners.

(Well, as easy as Physics gets, just breath deeply and dive in..)

Note - this is JUST a demo - the 'acceleration' function provided is for demo purposes only - it implements 'a Spring with Dampening' in order to drive the simulation.

Also note that the democode is NOT implemented in realtime - it uses fixed VIRTUAL timesteps of 1/10 seconds.

If you are interested in helping me to expand this framework to support Rotations, or if you're merely interested in this topic, let me know :)

For anyone who IS interested in this stuff, I have amassed a decent stable of code for intersections and collisions of 'geometric primitives' which would be highly suitable, given the right impetus.

I've updated it to support 3D and to support REAL8 time.

It's not OOP !! It's just structs and procs, easy on beginners.

(Well, as easy as Physics gets, just breath deeply and dive in..)

Note - this is JUST a demo - the 'acceleration' function provided is for demo purposes only - it implements 'a Spring with Dampening' in order to drive the simulation.

Also note that the democode is NOT implemented in realtime - it uses fixed VIRTUAL timesteps of 1/10 seconds.

If you are interested in helping me to expand this framework to support Rotations, or if you're merely interested in this topic, let me know :)

For anyone who IS interested in this stuff, I have amassed a decent stable of code for intersections and collisions of 'geometric primitives' which would be highly suitable, given the right impetus.

We wants a demo with purrdy graphix!

:P

:P

The posted code is important because its being driven by a Spring - and we can use Springs to implement 'ball and socket Joints'... a pity it doesn't include Rotational physics code !!

I'm currently adding code for 3D Rotation, along with some code for several 'Rigid Body' geometric primitives, and fusing it all with my existing 'intersection tests for geometric primitives'.

Last time I tried this I got stuck at 'obtaining the Eigen Vectors for an arbitrary 3x3 Matrix' - hopefully this time I won't :P

Note that the RigidBody stuff supports constrained Joints as WELL as 'combined primitives' (think metal axe head and wooden handle).

Once that's done I'll certainly post a graphical demo, then later it'll be time to fuse the framework with my 'Animated SkinMesh' stuff - resulting in RagDoll physics.. that is to say, I'm working back towards my previously-posted work with ragdolls and 'bonebox hierarchies'.. main difference there being that the hierarchy of collision hulls (boxes) is automatically constructed by analysing the animated model's Skeleton ;)

I'm currently adding code for 3D Rotation, along with some code for several 'Rigid Body' geometric primitives, and fusing it all with my existing 'intersection tests for geometric primitives'.

Last time I tried this I got stuck at 'obtaining the Eigen Vectors for an arbitrary 3x3 Matrix' - hopefully this time I won't :P

Note that the RigidBody stuff supports constrained Joints as WELL as 'combined primitives' (think metal axe head and wooden handle).

Once that's done I'll certainly post a graphical demo, then later it'll be time to fuse the framework with my 'Animated SkinMesh' stuff - resulting in RagDoll physics.. that is to say, I'm working back towards my previously-posted work with ragdolls and 'bonebox hierarchies'.. main difference there being that the hierarchy of collision hulls (boxes) is automatically constructed by analysing the animated model's Skeleton ;)