19BulletAllHitsRayResult::
20BulletAllHitsRayResult(
const btVector3 &from_pos,
const btVector3 &to_pos,
const CollideMask &mask)
21 : btCollisionWorld::AllHitsRayResultCallback(from_pos, to_pos), _mask(mask) {
31 btCollisionObject *obj0 = (btCollisionObject *) proxy0->m_clientObject;
35 return (_mask & mask0) != 0;
42addSingleResult(btCollisionWorld::LocalRayResult& rayResult,
bool normalInWorldSpace) {
45 if (rayResult.m_localShapeInfo) {
46 _shapePart.push_back(rayResult.m_localShapeInfo->m_shapePart);
47 _triangleIndex.push_back(rayResult.m_localShapeInfo->m_triangleIndex);
50 _shapePart.push_back(-1);
51 _triangleIndex.push_back(-1);
55 return btCollisionWorld::AllHitsRayResultCallback::addSingleResult(rayResult, normalInWorldSpace);
61LPoint3 BulletAllHitsRayResult::
64 return btVector3_to_LPoint3(m_rayFromWorld);
70LPoint3 BulletAllHitsRayResult::
73 return btVector3_to_LPoint3(m_rayToWorld);
79bool BulletAllHitsRayResult::
88PN_stdfloat BulletAllHitsRayResult::
89get_closest_hit_fraction()
const {
91 return (PN_stdfloat)m_closestHitFraction;
97int BulletAllHitsRayResult::
100 return m_collisionObjects.size();
107get_hit(
int idx)
const {
113 hit._object = m_collisionObjects[idx];
114 hit._normal = m_hitNormalWorld[idx];
115 hit._pos = m_hitPointWorld[idx];
116 hit._fraction = m_hitFractions[idx];
118 hit._shapePart = _shapePart[idx];
119 hit._triangleIndex = _triangleIndex[idx];
127PN_stdfloat BulletRayHit::
128get_hit_fraction()
const {
130 return (PN_stdfloat)_fraction;
139 return (_object) ? (
PandaNode *)_object->getUserPointer() :
nullptr;
145LPoint3 BulletRayHit::
148 return btVector3_to_LPoint3(_pos);
154LVector3 BulletRayHit::
155get_hit_normal()
const {
157 return btVector3_to_LVector3(_normal);
164get_shape_part()
const {
173get_triangle_index()
const {
175 return _triangleIndex;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
get_into_collide_mask
Returns the "into" collide mask for this node.
virtual bool needsCollision(btBroadphaseProxy *proxy0) const
Override default implementation.
virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult &rayResult, bool normalInWorldSpace)
Override default implementation.
static BulletRayHit empty()
Named constructor intended to be used for asserts with have to return a concrete value.