Macros
OPC_RayCollider.cpp File Reference
#include "Stdafx.h"
#include "OPC_RayAABBOverlap.h"
#include "OPC_RayTriOverlap.h"
Include dependency graph for OPC_RayCollider.cpp:

Go to the source code of this file.

Macros

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

Detailed Description

Contains code for a ray collider.

Author
Pierre Terdiman
Date
June, 2, 2001

Definition in file OPC_RayCollider.cpp.

Macro Definition Documentation

◆ HANDLE_CONTACT

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

Definition at line 131 of file OPC_RayCollider.cpp.

◆ RAY_PRIM

#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) \
}

Definition at line 189 of file OPC_RayCollider.cpp.

◆ SEGMENT_PRIM

#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) \
} \
}

Definition at line 174 of file OPC_RayCollider.cpp.

◆ SET_CONTACT

#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 122 of file OPC_RayCollider.cpp.

◆ UPDATE_CACHE

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

Definition at line 136 of file OPC_RayCollider.cpp.

IR
#define IR(x)
Integer representation of a floating-point value.
Definition: IceFPU.h:18
flag
png_infop png_uint_32 flag
Definition: png.h:2156
SET_CONTACT
#define SET_CONTACT(prim_index, flag)
Definition: OPC_RayCollider.cpp:122


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:05