bool BoneNode::intersectRay(const Math::Ray &ray) const { Math::Ray localRay = ray; localRay.translate(-_animPos); localRay.rotate(_animRot.inverse()); return localRay.intersectAABB(_boundingBox); }
bool VisualProp::intersectRay(const Math::Ray &ray, const Math::Vector3d position, float direction) { Math::Matrix4 inverseModelMatrix = getModelMatrix(position, direction); inverseModelMatrix.inverse(); // Build an object local ray from the world ray Math::Ray localRay = ray; localRay.transform(inverseModelMatrix); return localRay.intersectAABB(_boundingBox); }