| 698 | } |
| 699 | |
| 700 | SceneNode* Scene::getSceneNodeByPosition(const Transform::UnitVector& position) const |
| 701 | { |
| 702 | for (auto& gameObject : m_gameObjectArray) |
| 703 | { |
| 704 | const Transform::UnitVector sceneNodePosition |
| 705 | = gameObject->getSceneNode().getPosition(); |
| 706 | const Transform::UnitVector pVec |
| 707 | = position.to<Transform::Units::SceneUnits>(); |
| 708 | const Transform::UnitVector pTolerance |
| 709 | = Transform::UnitVector(6, 6, Transform::Units::ScenePixels) |
| 710 | .to<Transform::Units::SceneUnits>(); |
| 711 | |
| 712 | if (Utils::Math::isBetween(pVec.x, sceneNodePosition.x - pTolerance.x, |
| 713 | sceneNodePosition.x + pTolerance.x)) |
| 714 | { |
| 715 | if (Utils::Math::isBetween(pVec.y, sceneNodePosition.y - pTolerance.x, |
| 716 | sceneNodePosition.y + pTolerance.y)) |
| 717 | return &gameObject->getSceneNode(); |
| 718 | } |
| 719 | } |
| 720 | return nullptr; |
| 721 | } |
| 722 | |
| 723 | std::pair<Collision::PolygonalCollider*, int> Scene::getColliderPointByPosition( |
| 724 | const Transform::UnitVector& position) |
nothing calls this directly
no test coverage detected