njCollisionCheckSC Japanese
<-|INDEX|->
Checks collision for a sphere and a capsule.

FORMAT

#include <Ninja.h>
Int njCollisionCheckSC( *sphere,  *capsule)
NJS_SPHERE *sphere
NJS_CAPSULE *capsule

PARAMETERS

*sphere
Sphere to be collision checked
*capsule
Capsule to be collision checked

RETURN VALUE

1: Hit
0: Not hit

ERROR VALUE

None

FUNCTION

Checks collision for a sphere and a capsule.

EXAMPLE

Checks collision for a sphere and a capsule.
NJS_SPHERE *sphere
NJS_CAPSULE *capsule

sphere.c.x = -80.f;
sphere.c.y = 0.f;
sphere.c.z = 0.f;
sphere.r = 100.f;

capsule.c1.x = 80.f;
capsule.c1.y = 0.f;
capsule.c1.z = 0.f;
capsule.c2.x = 180.f;
capsule.c2.y = 0.f;
capsule.c2.z = 0.f;
capsule.r = 100.f;

njCollisionCheckSC(&sphere, &capsule);

Result
Return value: 1

NOTES

NJS_CAPSULE structure (capsule type)
typedef struct{
    NJS_POINT3 c1;
    NJS_POINT3 c2;
    Float      r; 
} NJS_CAPSULE;
A capsule consisted of a half sphere with center coordinate = c1 and radius = r on the one side, and another half sphere with center coordinate = c2 and radius = r on the other side.

NJS_SPHERE structure (sphere)
typedef struct{
    NJS_POINT3 c;/* center of sphere */
    Float      r;/* radius of sphere */
} NJS_SPHERE;
A sphere consists of center coordinate c and radius r.

RELATED TOPICS


njCollisionCheckSC
<-|INDEX|->

Copyright SEGA ENTERPRISES, LTD., 1997