njCollisionCheckCC Japanese
<-|INDEX|->
Checks collision for two capsules

FORMAT

#include <Ninja.h>
Int njCollisionCheckCC( *h1, *h2 )
NJS_CAPSULE *h1
NJS_CAPSULE *h2

PARAMETERS

*h1
Collision checked object capsule #1
*h2
Collision checked object capsule #2

RETURN VALUE

1: Hit
0: Not hit

ERROR VALUE

None

FUNCTION

Checks collision for two capsules.

EXAMPLE

Check collision for two capsules h1 and h2.
NJS_CAPSULE h1,h2;

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

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

njCollisionCheckCC(&h1, &h2);

Result
Return value: 1

NOTES

NJS_CAPSULE structure (capsule type)
typedef struct{
    NJS_POINT3 c1;
    NJS_POINT3 c2;
    Float      r; 
} NJS_CAPSULE;
A capsule consists 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.

RELATED TOPICS


njCollisionCheckCC
<-|INDEX|->

Copyright SEGA ENTERPRISES, LTD., 1997