mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 03:04:40 +02:00
only set simulationID on scripted entity creation if the entity has velocity or rotation
This commit is contained in:
parent
d330319ed9
commit
b5bfbba759
1 changed files with 5 additions and 2 deletions
|
@ -68,10 +68,13 @@ EntityItemID EntityScriptingInterface::addEntity(const EntityItemProperties& pro
|
||||||
// This Node is creating a new object. If it's in motion, set this Node as the simulator.
|
// This Node is creating a new object. If it's in motion, set this Node as the simulator.
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
const QString myNodeID = nodeList->getSessionUUID().toString();
|
const QString myNodeID = nodeList->getSessionUUID().toString();
|
||||||
// QString simulatorID = _entity->getSimulatorID();
|
|
||||||
|
|
||||||
EntityItemProperties propertiesWithSimID = properties;
|
EntityItemProperties propertiesWithSimID = properties;
|
||||||
propertiesWithSimID.setSimulatorID(myNodeID);
|
|
||||||
|
// if this object is moving, set this Node as the simulation owner
|
||||||
|
if (properties.velocityChanged() || properties.rotationChanged()) {
|
||||||
|
propertiesWithSimID.setSimulatorID(myNodeID);
|
||||||
|
}
|
||||||
|
|
||||||
EntityItemID id(NEW_ENTITY, creatorTokenID, false );
|
EntityItemID id(NEW_ENTITY, creatorTokenID, false );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue