SC_sphereSlide
SYNTAX
return integer=SC_sphereSlide ( objNum, oldx, oldy, oldz, x, y, z, radius, excludeObj )
-objNum: the object you want to check for collision use 0 for all objects
-oldx...z: the start and end points of the sphere to check.
-radius: the radius of the sphere you want to cast.
-excludeObj: an object to exclude from the collision check.
returns: if objNum=0 then the object number collided with is returned
if checking a specific object then a 1 is returned if a collision occured.
returns 0 if no collision occured.
This command does the same as SC_sphereCast but over multiple iterations to produce
a slide point for use in sliding collisions.
SC_sphereCast produces a slide point that must be checked again to make sure this new
point does not collide with any objects. This produces another point, which must be checked
and so on. SC_sphereSlide uses a maximum of three iterations to finalize a point that
will keep the sphere outside all objects checked.
The command SC_getNumCollisions can be used to get the number of iterations used by
this command. Details of the collision point, normal, and slide point for each iteration
are also available using getCollisionNormal(1) (2) or (3). The final collision point, normal and slide point are in getCollisionSlide(0), or by using
no parameter getCollisionSlide() (defaults to 0). see the sliding demo for an example usage of this command.
RELATED INFO
Collision Commands Menu
Index