Skip to content

Posts tagged ‘verlet’

SDF: Resolving spherical and circular collision at high speeds in a verlet system.

January 17, 2009

Charles

The method ive found  to resolve spherical and circular collisions at high speed is borrowed from the spherical bounding box method. I first store the current distance between the two spheres/circles and then the  future distance between the two  .

cd = |p0_{1} - p1_{1}|

 

fd = |(p0_{1} + (p0_{1} - p0_{1-1})) - (p1_{1} + (p1_{1} - p1_{1-1})) |  

if this future distance is smaller than the combined radius’s I re imagine the current distance

cd = (cd \frac{cd}{fd})

and continue to do the standard method.

Simple Dynamics framework: verlet

January 6, 2009

Charles

The basic verlet algorithm im using is,

x_{1+1} = x_{1} +(x_{1} - x_{1-1}) + a dt^2

where x is the current and previous position a the accumulated forces, and dt, the timestep or period over frequency. This is great if the simulation is un-fluctuating i.e baked; if it was realtime i’d introduce the TCV (time corrected verlet) version,

x_{1+1} = x_{1} + (x_{1} - x_{1-1}) (frac{dt_{1}}{dt_{1-1}}) + a dt_{1}^2

The nice thing about verlet is that velocity is calculated from the current and old positions, and because of this you can keep throwing collsion and constraint methods at it. It handles the rest. My current approach is to fire the integrator ( verlet) then collisions and constraints – the latter two iterated several times.

 

A simple framework for dynamics

December 20, 2008

Charles

I started to think about building a very simple framework for dynamics based on this article: http://www.gamasutra.com/resource_guide/20030121/jacobson_01.shtml

It uses the verlet method and then successive systems to check for constraints, collisions etc. – I like this approach as it seems pretty modular. I think the basic method ill go for is defining objects/verts/lines/etc with attributes, whether there masses or constraints connecting masses together. Then the main system calls the general functions on them.

Im not sure if this is correct but i think the aproach with the main system is to:

1. Calculate all the forces of all the masses
2. Apply verlet algorithm with a timeStep
3. Do a scene check i.e if the masses are in a box if its simple or/and
do some collision/friction checking
4. satisfy the constraints

Im not sure if 4 & 3 are the right order so, ill have to think on that – but this is my basic approach to building a simple system. I thought of attributes because they could be place on anything then, and i could add some function for display methods, like cylinders and spheres.