Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -1550,3 +1550,16 @@ bool EntityScriptingInterface::AABoxIntersectsCapsule(const glm::vec3& low, cons · 1549 unmodified lines | ||
| 1550 | 1550 | AABox aaBox(low, dimensions); |
| 1551 | 1551 | return aaBox.findCapsulePenetration(start, end, radius, penetration); |
| 1552 | 1552 | } |
| 1553 | + | |
| 1554 | +glm::mat4 EntityScriptingInterface::getEntityTransform(const QUuid& entityID) { | |
| 1555 | + glm::mat4 result; | |
| 1556 | + if (_entityTree) { | |
| 1557 | + _entityTree->withReadLock([&] { | |
| 1558 | + EntityItemPointer entity = _entityTree->findEntityByEntityItemID(EntityItemID(entityID)); | |
| 1559 | + if (entity) { | |
| 1560 | + result = entity->getEntityToWorldMatrix(); | |
| 1561 | + } | |
| 1562 | + }); | |
| 1563 | + } | |
| 1564 | + return result; | |
| 1565 | +} | |