Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 3 files). Show all
Unified · Split
| @@ -1037,11 +1037,7 @@ QStringList EntityScriptingInterface::getJointNames(const QUuid& entityID) { · 1036 unmodified lines | |||
| 1037 | return result; | 1037 | return result; |
| 1038 | } | 1038 | } |
| 1039 | 1039 | ||
| 1040 | void EntityScriptingInterface::addCostFunction(QScriptValue costFunction) { | 1040 | float EntityScriptingInterface::calculateCost(float mass, float oldVelocity,float newVelocity) { |
| 1041 | _costFunction = &costFunction; | ||
| 1042 | } | ||
| 1043 | |||
| 1044 | double EntityScriptingInterface::calculateCost(float mass, float oldVelocity,float newVelocity) { | ||
| 1045 | return std::abs(mass * (newVelocity - oldVelocity)); | 1041 | return std::abs(mass * (newVelocity - oldVelocity)); |
| 1046 | } | 1042 | } |
| 1047 | 1043 | ||