History

Bug fixes and debt reductions on energy calculations. - removed superfluous code interfacing with scripts - favor floats over doubles in cost calculations - default avatar energy is maximum float value for cases where energy script is not loaded in order to still manipulate entities.

Babiuch, Ryan Nicholas committed 10 years ago

Commit 7dd5bca1 parent 47f7d553 files · +4 −14Browse files

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

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+1−5
@@ -1037,11 +1037,7 @@ QStringList EntityScriptingInterface::getJointNames(const QUuid& entityID) { · 1036 unmodified lines
1037 return result;1037 return result;
1038}1038}
1039 1039
1040void EntityScriptingInterface::addCostFunction(QScriptValue costFunction) {1040float EntityScriptingInterface::calculateCost(float mass, float oldVelocity,float newVelocity) {
1041 _costFunction = &costFunction;
1042}
1043
1044double 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