glm::vec3 EntityScriptingInterface::voxelCoordsToWorldCoords(const QUuid& entityID, glm::vec3 voxelCoords) { if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::PolyVox)) { auto polyVoxEntity = std::dynamic_pointer_cast<PolyVoxEntityItem>(entity); return polyVoxEntity->voxelCoordsToWorldCoords(voxelCoords); } else { return glm::vec3(0.0f); } }
glm::vec3 EntityScriptingInterface::voxelCoordsToWorldCoords(const QUuid& entityID, glm::vec3 voxelCoords) { if (!_entityTree) { return glm::vec3(0.0f); } EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID); if (!entity) { qCDebug(entities) << "EntityScriptingInterface::voxelCoordsToWorldCoords no entity with ID" << entityID; return glm::vec3(0.0f); } EntityTypes::EntityType entityType = entity->getType(); if (entityType != EntityTypes::PolyVox) { return glm::vec3(0.0f); } auto polyVoxEntity = std::dynamic_pointer_cast<PolyVoxEntityItem>(entity); return polyVoxEntity->voxelCoordsToWorldCoords(voxelCoords); }