MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / getColliderPointByPosition

Method getColliderPointByPosition

src/Core/Scene/Scene.cpp:723–739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

721 }
722
723 std::pair<Collision::PolygonalCollider*, int> Scene::getColliderPointByPosition(
724 const Transform::UnitVector& position)
725 {
726 const Transform::UnitVector pPos = position.to<Transform::Units::ScenePixels>();
727 const Transform::UnitVector pTolerance
728 = Transform::UnitVector(6, 6, Transform::Units::ScenePixels);
729 for (const auto& collider : m_colliderArray)
730 {
731 // TODO: Fix here
732 if (auto point = collider->getPointAroundPosition(pPos, pTolerance);
733 point.has_value())
734 {
735 return std::make_pair(collider.get(), point.value()->index);
736 }
737 }
738 return std::pair<Collision::PolygonalCollider*, int>(nullptr, 0);
739 }
740
741 Collision::PolygonalCollider* Scene::getColliderByCentroidPosition(
742 const Transform::UnitVector& position)

Callers

nothing calls this directly

Calls 5

UnitVectorClass · 0.85
has_valueMethod · 0.45
getMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected