Defines
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.

Defines

#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.


Define Documentation

#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.

#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.

#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.

#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.

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

Definition at line 136 of file OPC_RayCollider.cpp.



openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:20