Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualradioteeth

Posted 05 June 2013 - 09:07 AM

Once you detect intersection, you must find the surface normal of the voxel.. This can easily be done on-the-fly using gradient analysis by averaging the positions of all empty voxels surrounding the intersected voxel (edit: in a 3x3x3 area, relative to the intersected voxel), normalize that vector, and 'push' the intersecting object back out along that calculated surface-normal so that the intersecting object is 'corrected' to the surface - yielding a 'sliding' effect when the object collides with the voxel volume.

 

you might want to also create an elastic effect (for certain entities) which simply 'reflects' the object's velocity by the surface normal, perhaps simply have an 'elasticity' entity property value, which determines the ratio of slide-to-bounce.

 

the velocity of the colliding object will also need to be corrected, in a similar fashion.


#1radioteeth

Posted 05 June 2013 - 09:06 AM

Once you detect intersection, you must find the relative surface normal of the voxel.. This can easily be done on-the-fly by averaging the positions of all empty voxels surrounding the intersected voxel (relative to the intersected voxel), normalize that vector, and 'push' the intersecting object back out along that calculated surface-normal so that the intersecting object is 'corrected' to the surface - yielding a 'sliding' effect when the object collides with the voxel volume.

 

you might want to also create an elastic effect (for certain entities) which simply 'reflects' the object's velocity by the surface normal, perhaps simply have an 'elasticity' entity property value, which determines the ratio of slide-to-bounce.

 

the velocity of the colliding object will also need to be corrected, in a similar fashion.


PARTNERS