Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OPC_RayCollider.cpp File Reference
#include "Stdafx.h"
#include "OPC_RayAABBOverlap.h"
#include "OPC_RayTriOverlap.h"

Go to the source code of this file.

Macros

#define SET_CONTACT(prim_index, flag)
 
#define HANDLE_CONTACT(prim_index, flag)
 
#define UPDATE_CACHE
 
#define SEGMENT_PRIM(prim_index, flag)
 
#define RAY_PRIM(prim_index, flag)
 

Detailed Description

Contains code for a ray collider.

Author
Pierre Terdiman
Date
June, 2, 2001

Definition in file OPC_RayCollider.cpp.

Macro Definition Documentation

#define HANDLE_CONTACT (   prim_index,
  flag 
)
Value:
SET_CONTACT(prim_index, flag) \
\
if(mHitCallback) (mHitCallback)(mStabbedFace, mUserData);else{}

Definition at line 132 of file OPC_RayCollider.cpp.

#define RAY_PRIM (   prim_index,
  flag 
)
Value:
/* Request vertices from the app */ \
VertexPointers VP; mIMesh->GetTriangle(VP, prim_index); \
\
/* Perform ray-tri overlap test and return */ \
if(RayTriOverlap(*VP.Vertex[0], *VP.Vertex[1], *VP.Vertex[2])) \
{ \
HANDLE_CONTACT(prim_index, flag) \
}else{}

Definition at line 190 of file OPC_RayCollider.cpp.

#define SEGMENT_PRIM (   prim_index,
  flag 
)
Value:
/* Request vertices from the app */ \
VertexPointers VP; mIMesh->GetTriangle(VP, prim_index); \
\
/* Perform ray-tri overlap test and return */ \
if(RayTriOverlap(*VP.Vertex[0], *VP.Vertex[1], *VP.Vertex[2])) \
{ \
/* Intersection point is valid if dist < segment's length */ \
/* We know dist>0 so we can use integers */ \
if(IR(mStabbedFace.mDistance)<IR(mMaxDist)) \
{ \
HANDLE_CONTACT(prim_index, flag) \
} \
}else{}

Definition at line 175 of file OPC_RayCollider.cpp.

#define SET_CONTACT (   prim_index,
  flag 
)
Value:
mNbIntersections++; \
/* Set contact status */ \
mFlags |= flag; \
/* In any case the contact has been found and recorded in mStabbedFace */ \
mStabbedFace.mFaceID = prim_index;

Definition at line 123 of file OPC_RayCollider.cpp.

#define UPDATE_CACHE
Value:
if(cache && GetContactStatus()) \
{ \
*cache = mStabbedFace.mFaceID; \
}else{}

Definition at line 137 of file OPC_RayCollider.cpp.