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
10371037 return result;
10381038 }
10391039
1040−void EntityScriptingInterface::addCostFunction(QScriptValue costFunction) {
1041− _costFunction = &costFunction;
1042−}
1043−
1044−double EntityScriptingInterface::calculateCost(float mass, float oldVelocity,float newVelocity) {
1040+float EntityScriptingInterface::calculateCost(float mass, float oldVelocity,float newVelocity) {
10451041 return std::abs(mass * (newVelocity - oldVelocity));
10461042 }
10471043