19 BulletClosestHitRayResult::
20 BulletClosestHitRayResult(
const btVector3 &from_pos,
const btVector3 &to_pos,
const CollideMask &mask)
21 : btCollisionWorld::ClosestRayResultCallback(from_pos, to_pos), _mask(mask) {
33 btCollisionObject *obj0 = (btCollisionObject *) proxy0->m_clientObject;
37 return (_mask & mask0) != 0;
44 addSingleResult(btCollisionWorld::LocalRayResult& rayResult,
bool normalInWorldSpace) {
47 if (rayResult.m_localShapeInfo) {
48 _shapePart = rayResult.m_localShapeInfo->m_shapePart;
49 _triangleIndex = rayResult.m_localShapeInfo->m_triangleIndex;
53 return btCollisionWorld::ClosestRayResultCallback::addSingleResult(rayResult, normalInWorldSpace);
59 bool BulletClosestHitRayResult::
68 PN_stdfloat BulletClosestHitRayResult::
69 get_hit_fraction()
const {
71 return (PN_stdfloat)m_closestHitFraction;
80 const btCollisionObject *objectPtr = m_collisionObject;
81 return (objectPtr) ? (
PandaNode *)objectPtr->getUserPointer() :
nullptr;
87 LPoint3 BulletClosestHitRayResult::
90 return btVector3_to_LPoint3(m_hitPointWorld);
96 LVector3 BulletClosestHitRayResult::
97 get_hit_normal()
const {
99 return btVector3_to_LVector3(m_hitNormalWorld);
105 LPoint3 BulletClosestHitRayResult::
106 get_from_pos()
const {
108 return btVector3_to_LPoint3(m_rayFromWorld);
114 LPoint3 BulletClosestHitRayResult::
117 return btVector3_to_LPoint3(m_rayToWorld);
123 int BulletClosestHitRayResult::
124 get_shape_part()
const {
132 int BulletClosestHitRayResult::
133 get_triangle_index()
const {
135 return _triangleIndex;
A basic node of the scene graph or data graph.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool needsCollision(btBroadphaseProxy *proxy0) const
Override default implementation.
virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult &rayResult, bool normalInWorldSpace)
Override default implementation.