Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -81,6 +81,8 @@ EntityItemProperties convertLocationToScriptSemantics(const EntityItemProperties · 80 unmodified lines | ||
| 81 | 81 | entitySideProperties.getParentID(), |
| 82 | 82 | entitySideProperties.getParentJointIndex(), |
| 83 | 83 | success); |
| 84 | + // TODO -- handle velocity and angularVelocity | |
| 85 | + | |
| 84 | 86 | scriptSideProperties.setPosition(worldPosition); |
| 85 | 87 | scriptSideProperties.setRotation(worldRotation); |
| 86 | 88 | |
| @@ -94,6 +96,8 @@ EntityItemProperties convertLocationFromScriptSemantics(const EntityItemProperti · 7 unmodified lines | ||
| 94 | 96 | EntityItemProperties entitySideProperties = scriptSideProperties; |
| 95 | 97 | bool success; |
| 96 | 98 | |
| 99 | + // TODO -- handle velocity and angularVelocity | |
| 100 | + | |
| 97 | 101 | if (scriptSideProperties.localPositionChanged()) { |
| 98 | 102 | entitySideProperties.setPosition(scriptSideProperties.getLocalPosition()); |
| 99 | 103 | } else if (scriptSideProperties.positionChanged()) { |
| @@ -128,14 +132,14 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties · 28 unmodified lines | ||
| 128 | 132 | auto newVelocity = propertiesWithSimID.getVelocity().length(); |
| 129 | 133 | float cost = calculateCost(density * volume, 0, newVelocity); |
| 130 | 134 | cost *= costMultiplier; |
| 131 | − | |
| 135 | + | |
| 132 | 136 | if(cost > _currentAvatarEnergy) { |
| 133 | 137 | return QUuid(); |
| 134 | 138 | } else { |
| 135 | 139 | //debit the avatar energy and continue |
| 136 | 140 | emit debitEnergySource(cost); |
| 137 | 141 | } |
| 138 | − | |
| 142 | + | |
| 139 | 143 | EntityItemID id = EntityItemID(QUuid::createUuid()); |
| 140 | 144 | |
| 141 | 145 | // If we have a local entity tree set, then also update it. |