# ObjectSphereSlide

## Description

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 GetObjectRayCastNumHits 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 collision indices 1 to 3 i.e. GetObjectRayCastX(1) (2) or (3). The final collision point, normal and slide point are in index 0, i.e. GetObjectRayCastSlideX(0).

## Definition

integer ObjectSphereSlide( objID, oldx, oldy, oldz, newx, newy, newz, radius )

int agk::ObjectSphereSlide( UINT objID, float oldx, float oldy, float oldz, float newx, float newy, float newz, float radius )

## Parameters

- objID - The ID of the object to check, 0 for all objects.
- oldx - The X component of the start position.
- oldy - The Y component of the start position.
- oldz - The Z component of the start position.
- newx - The X component of the end position.
- newy - The Y component of the end position.
- newz - The Z component of the end position.
- radius - The radius of the sphere to cast.