Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 5 files). Show all
Unified · Split
| @@ -1184,6 +1184,40 @@ QVector<QUuid> EntityScriptingInterface::getChildrenIDsOfJoint(const QUuid& pare · 1183 unmodified lines | ||
| 1184 | 1184 | return result; |
| 1185 | 1185 | } |
| 1186 | 1186 | |
| 1187 | +QUuid EntityScriptingInterface::getKeyboardFocusEntity() const { | |
| 1188 | + QUuid result; | |
| 1189 | + QMetaObject::invokeMethod(qApp, "getKeyboardFocusEntity", Qt::DirectConnection, Q_RETURN_ARG(QUuid, result)); | |
| 1190 | + return result; | |
| 1191 | +} | |
| 1192 | + | |
| 1193 | +void EntityScriptingInterface::setKeyboardFocusEntity(QUuid id) { | |
| 1194 | + QMetaObject::invokeMethod(qApp, "setKeyboardFocusEntity", Qt::QueuedConnection, Q_ARG(QUuid, id)); | |
| 1195 | +} | |
| 1196 | + | |
| 1197 | +void EntityScriptingInterface::sendEntityMouseMoveEvent(QUuid id, glm::vec3 intersectionPoint) { | |
| 1198 | + QMetaObject::invokeMethod(qApp, "sendEntityMouseMoveEvent", Qt::QueuedConnection, Q_ARG(QUuid, id), Q_ARG(glm::vec3, intersectionPoint)); | |
| 1199 | +} | |
| 1200 | + | |
| 1201 | +void EntityScriptingInterface::sendEntityLeftMouseDownEvent(QUuid id, glm::vec3 intersectionPoint) { | |
| 1202 | + QMetaObject::invokeMethod(qApp, "sendEntityLeftMouseDownEvent", Qt::QueuedConnection, Q_ARG(QUuid, id), Q_ARG(glm::vec3, intersectionPoint)); | |
| 1203 | +} | |
| 1204 | + | |
| 1205 | +void EntityScriptingInterface::sendEntityLeftMouseUpEvent(QUuid id, glm::vec3 intersectionPoint) { | |
| 1206 | + QMetaObject::invokeMethod(qApp, "sendEntityLeftMouseUpEvent", Qt::QueuedConnection, Q_ARG(QUuid, id), Q_ARG(glm::vec3, intersectionPoint)); | |
| 1207 | +} | |
| 1208 | + | |
| 1209 | +void EntityScriptingInterface::sendEntityTouchUpdateEvent(QUuid entityID, int fingerID, glm::vec3 intersectionPoint) { | |
| 1210 | + QMetaObject::invokeMethod(qApp, "sendEntityTouchUpdateEvent", Qt::QueuedConnection, Q_ARG(QUuid, entityID), Q_ARG(int, fingerID), Q_ARG(glm::vec3, intersectionPoint)); | |
| 1211 | +} | |
| 1212 | + | |
| 1213 | +void EntityScriptingInterface::sendEntityTouchBeginEvent(QUuid entityID, int fingerID, glm::vec3 intersectionPoint) { | |
| 1214 | + QMetaObject::invokeMethod(qApp, "sendEntityTouchBeginEvent", Qt::QueuedConnection, Q_ARG(QUuid, entityID), Q_ARG(int, fingerID), Q_ARG(glm::vec3, intersectionPoint)); | |
| 1215 | +} | |
| 1216 | + | |
| 1217 | +void EntityScriptingInterface::sendEntityTouchEndEvent(QUuid entityID, int fingerID, glm::vec3 intersectionPoint) { | |
| 1218 | + QMetaObject::invokeMethod(qApp, "sendEntityTouchEndEvent", Qt::QueuedConnection, Q_ARG(QUuid, entityID), Q_ARG(int, fingerID), Q_ARG(glm::vec3, intersectionPoint)); | |
| 1219 | +} | |
| 1220 | + | |
| 1187 | 1221 | float EntityScriptingInterface::calculateCost(float mass, float oldVelocity, float newVelocity) { |
| 1188 | 1222 | return std::abs(mass * (newVelocity - oldVelocity)); |
| 1189 | 1223 | } |