am b4f054a8: Merge "Remove invalid UTF-8 chars from source."
* commit 'b4f054a894790f68f991c1034fb9c5cb75fe546e': Remove invalid UTF-8 chars from source.
This commit is contained in:
@@ -165,7 +165,7 @@ public class AccelerometerPlayActivity extends Activity {
|
|||||||
final float gy = -sy * m;
|
final float gy = -sy * m;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <EFBFBD>F = mA <=> A = <EFBFBD>F / m We could simplify the code by
|
* F = mA <=> A = F / m We could simplify the code by
|
||||||
* completely eliminating "m" (the mass) from all the equations,
|
* completely eliminating "m" (the mass) from all the equations,
|
||||||
* but it would hide the concepts from this sample code.
|
* but it would hide the concepts from this sample code.
|
||||||
*/
|
*/
|
||||||
@@ -175,12 +175,12 @@ public class AccelerometerPlayActivity extends Activity {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Time-corrected Verlet integration The position Verlet
|
* Time-corrected Verlet integration The position Verlet
|
||||||
* integrator is defined as x(t+<EFBFBD>t) = x(t) + x(t) - x(t-<EFBFBD>t) +
|
* integrator is defined as x(t+dt) = x(t) + x(t) - x(t-dt) +
|
||||||
* a(t)<EFBFBD>t<EFBFBD>2 However, the above equation doesn't handle variable
|
* a(t).t^2 However, the above equation doesn't handle variable
|
||||||
* <EFBFBD>t very well, a time-corrected version is needed: x(t+<EFBFBD>t) =
|
* dt very well, a time-corrected version is needed: x(t+dt) =
|
||||||
* x(t) + (x(t) - x(t-<EFBFBD>t)) * (<EFBFBD>t/<EFBFBD>t_prev) + a(t)<EFBFBD>t<EFBFBD>2 We also add
|
* x(t) + (x(t) - x(t-dt)) * (dt/dt_prev) + a(t).t^2 We also add
|
||||||
* a simple friction term (f) to the equation: x(t+<EFBFBD>t) = x(t) +
|
* a simple friction term (f) to the equation: x(t+dt) = x(t) +
|
||||||
* (1-f) * (x(t) - x(t-<EFBFBD>t)) * (<EFBFBD>t/<EFBFBD>t_prev) + a(t)<EFBFBD>t<EFBFBD>2
|
* (1-f) * (x(t) - x(t-dt)) * (dt/dt_prev) + a(t)t^2
|
||||||
*/
|
*/
|
||||||
final float dTdT = dT * dT;
|
final float dTdT = dT * dT;
|
||||||
final float x = mPosX + mOneMinusFriction * dTC * (mPosX - mLastPosX) + mAccelX
|
final float x = mPosX + mOneMinusFriction * dTC * (mPosX - mLastPosX) + mAccelX
|
||||||
|
|||||||
Reference in New Issue
Block a user