Blender V2.61 - r43446
|
#include <KX_RayCast.h>
Classes | |
class | Callback |
Public Member Functions | |
KX_RayCast (KX_IPhysicsController *ignoreController, bool faceNormal, bool faceUV) | |
virtual | ~KX_RayCast () |
virtual void | reportHit (PHY_RayCastResult *result) |
virtual bool | RayHit (KX_ClientObjectInfo *client)=0 |
Static Public Member Functions | |
static bool | RayTest (PHY_IPhysicsEnvironment *physics_environment, const MT_Point3 &frompoint, const MT_Point3 &topoint, KX_RayCast &callback) |
Public Attributes | |
bool | m_hitFound |
MT_Point3 | m_hitPoint |
MT_Vector3 | m_hitNormal |
const RAS_MeshObject * | m_hitMesh |
int | m_hitPolygon |
int | m_hitUVOK |
MT_Vector2 | m_hitUV |
Defines a function for doing a ray cast.
eg KX_RayCast::RayTest(ignore_physics_controller, physics_environment, frompoint, topoint, result_point, result_normal, KX_RayCast::Callback<KX_MyClass>(this, data)
Calls myclass->RayHit(client, hit_point, hit_normal, data) for all client between frompoint and topoint
myclass->RayHit should return true to end the raycast, false to ignore the current client.
Returns true if a client was accepted, false if nothing found.
Definition at line 57 of file KX_RayCast.h.
KX_RayCast::KX_RayCast | ( | KX_IPhysicsController * | ignoreController, |
bool | faceNormal, | ||
bool | faceUV | ||
) |
Definition at line 46 of file KX_RayCast.cpp.
virtual KX_RayCast::~KX_RayCast | ( | ) | [inline, virtual] |
Definition at line 69 of file KX_RayCast.h.
virtual bool KX_RayCast::RayHit | ( | KX_ClientObjectInfo * | client | ) | [pure virtual] |
ray test callback. either override this in your class, or use a callback wrapper.
Implemented in KX_RayCast::Callback< T >.
Referenced by RayTest().
bool KX_RayCast::RayTest | ( | PHY_IPhysicsEnvironment * | physics_environment, |
const MT_Point3 & | frompoint, | ||
const MT_Point3 & | topoint, | ||
KX_RayCast & | callback | ||
) | [static] |
Public interface. Implement bool RayHit in your class to receive ray callbacks.
Definition at line 62 of file KX_RayCast.cpp.
References MT_Vector3::dot(), PHY_IPhysicsController::GetMargin(), PHY_IController::getNewClientInfo(), MT_Vector3::length2(), m_hitFound, m_hitNormal, m_hitPoint, MT_abs(), MT_assert, MT_EPSILON(), NULL, RayHit(), PHY_IPhysicsEnvironment::rayTest(), MT_Tuple3::x(), MT_Tuple3::y(), and MT_Tuple3::z().
Referenced by GPC_RenderTools::applyTransform(), KX_BlenderRenderTools::applyTransform(), KX_RaySensor::Evaluate(), and KX_ConstraintActuator::Update().
void KX_RayCast::reportHit | ( | PHY_RayCastResult * | result | ) | [virtual] |
The physic environment returns the ray casting result through this function
Implements PHY_IRayCastFilterCallback.
Definition at line 51 of file KX_RayCast.cpp.
References m_hitFound, m_hitMesh, PHY_RayCastResult::m_hitNormal, m_hitNormal, PHY_RayCastResult::m_hitPoint, m_hitPoint, m_hitPolygon, PHY_RayCastResult::m_hitUV, m_hitUV, m_hitUVOK, PHY_RayCastResult::m_hitUVOK, PHY_RayCastResult::m_meshObject, PHY_RayCastResult::m_polygon, MT_Tuple3::setValue(), and MT_Tuple2::setValue().
Definition at line 60 of file KX_RayCast.h.
Referenced by KX_ConstraintActuator::RayHit(), RayTest(), and reportHit().
Definition at line 63 of file KX_RayCast.h.
Referenced by reportHit().
Definition at line 62 of file KX_RayCast.h.
Referenced by KX_BlenderRenderTools::RayHit(), KX_MouseFocusSensor::RayHit(), KX_RaySensor::RayHit(), GPC_RenderTools::RayHit(), RayTest(), reportHit(), and KX_ConstraintActuator::Update().
Definition at line 61 of file KX_RayCast.h.
Referenced by KX_BlenderRenderTools::RayHit(), KX_MouseFocusSensor::RayHit(), KX_RaySensor::RayHit(), GPC_RenderTools::RayHit(), RayTest(), reportHit(), and KX_ConstraintActuator::Update().
Definition at line 64 of file KX_RayCast.h.
Referenced by reportHit().
Definition at line 66 of file KX_RayCast.h.
Referenced by KX_MouseFocusSensor::RayHit(), and reportHit().
Definition at line 65 of file KX_RayCast.h.
Referenced by reportHit().