MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / Update

Method Update

GTE/Samples/Physics/KeplerPolarForm/PhysicsModule.cpp:89–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void PhysicsModule::Update()
90{
91 if (mSolver)
92 {
93 // Apply a single step of the ODE solver.
94 mSolver->Update(mTime, mState[0], mTime, mState[0]);
95
96 // Compute dot(theta) for application access.
97 float sn = std::sin(mState[0]);
98 float cs = std::cos(mState[0]);
99 float v = mAux[0] * sn + mAux[1] * cs - mAux[2];
100 mState[1] = mAux[3] * v * v;
101
102 // Compute radius for application access.
103 mState[2] = mEccentricity * mRho / (1.0f + mEccentricity * cs);
104
105 // Compute dot(radius) for application access.
106 mState[3] = mState[2] * mState[2] * mState[1] * sn / mRho;
107 }
108}
109
110

Callers 1

Calls 2

sinFunction · 0.50
cosFunction · 0.50

Tested by

no test coverage detected