Here is some code I wrote. The idea behind it is to move the object a certain step distance in a loop and check the collision (intersection) instead of using ray/sphere casts.
D3DXVECTOR3 old_pos = pos;
pos = pos + v;
int collision = 0;
int iterations = 100;
D3DXVECTOR3 p = old_pos;
for ( float x = 1; x <= iterations; x++ )
{
dbPositionObject ( object, p.x, p.y, p.z );
SC_UpdateObject ( object );
collision = SC_GroupCollision( object, GROUP_STATIC );
if ( collision != 0 )
break;
else
p = old_pos + ( ( pos - old_pos ) * ( ( 1 / iterations ) * x ) );
}
if ( collision )
dbPositionObject ( object, p.x, p.y, p.z );
else
dbPositionObject ( object, pos.x, pos.y, pos.z );
Unfortunatly it doesn't work as I expected it to. There is a collision happening and the object stops moving, but it stops in a location where it is still intersecting with the scene (GROUP_STATIC) like it would with ray casting from the objects center.
Any ideas?
Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.