History

eventBridge for web entities.

Anthony J. Thibault committed 10 years ago

Commit 21bf9311 parent 823420a6 files · +73 −6Browse files

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 6 files). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+12−0
@@ -1289,6 +1289,17 @@ bool EntityScriptingInterface::wantsHandControllerPointerEvents(QUuid id) { · 1288 unmodified lines
1289 return result;1289 return result;
1290}1290}
1291 1291
1292void EntityScriptingInterface::emitScriptEvent(const EntityItemID& entityID, const QVariant& message) {
1293 if (_entityTree) {
1294 _entityTree->withReadLock([&] {
1295 EntityItemPointer entity = _entityTree->findEntityByEntityItemID(EntityItemID(entityID));
1296 if (entity) {
1297 entity->emitScriptEvent(message);
1298 }
1299 });
1300 }
1301}
1302
1292float EntityScriptingInterface::calculateCost(float mass, float oldVelocity, float newVelocity) {1303float EntityScriptingInterface::calculateCost(float mass, float oldVelocity, float newVelocity) {
1293 return std::abs(mass * (newVelocity - oldVelocity));1304 return std::abs(mass * (newVelocity - oldVelocity));
1294}1305}
@@ -1305,3 +1316,4 @@ float EntityScriptingInterface::getCostMultiplier() { · 10 unmodified lines
1305void EntityScriptingInterface::setCostMultiplier(float value) {1316void EntityScriptingInterface::setCostMultiplier(float value) {
1306 costMultiplier = value;1317 costMultiplier = value;
1307}1318}
1319