double Hamiltonian::computeLocalEnergy(std::vector<Particle*> particles) { if (m_useNumerical) { m_kineticEnergy = computeKineticEnergy(particles); } else { m_kineticEnergy = computeAnalyticalKineticEnergy(particles); } m_potentialEnergy = computePotentialEnergy(particles); return m_kineticEnergy + m_potentialEnergy; }
//============================================================================== double Joint::getPotentialEnergy() const { return computePotentialEnergy(); }
//============================================================================== double MetaSkeleton::computeLagrangian() const { return computeKineticEnergy() - computePotentialEnergy(); }
//============================================================================== double MetaSkeleton::getPotentialEnergy() const { return computePotentialEnergy(); }
scalar TwoDScene::computeTotalEnergy() const { return computeKineticEnergy()+computePotentialEnergy(); }