MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / testPointInside

Method testPointInside

src/collision/Collider.cpp:58–64  ·  view source on GitHub ↗

Return true if a point is inside the collision shape * @param worldPoint Point to test in world-space coordinates * @return True if the point is inside the collision shape */

Source from the content-addressed store, hash-verified

56 * @return True if the point is inside the collision shape
57 */
58bool Collider::testPointInside(const Vector3& worldPoint) {
59 const Transform localToWorld = mBody->mWorld.mTransformComponents.getTransform(mBody->getEntity()) *
60 mBody->mWorld.mCollidersComponents.getLocalToBodyTransform(mEntity);
61 const Vector3 localPoint = localToWorld.getInverse() * worldPoint;
62 const CollisionShape* collisionShape = mBody->mWorld.mCollidersComponents.getCollisionShape(mEntity);
63 return collisionShape->testPointInside(localPoint, this);
64}
65
66// Set the collision category bits
67/**

Callers

nothing calls this directly

Calls 3

getEntityMethod · 0.45
getInverseMethod · 0.45
getCollisionShapeMethod · 0.45

Tested by

no test coverage detected