Home
last modified time | relevance | path

Searched refs:newVelocity (Results 1 – 3 of 3) sorted by relevance

/external/replicaisland/src/com/replica/replicaisland/
DPhysicsComponent.java75 Vector2 newVelocity = vectorPool.allocate(currentVelocity); in update() local
76 newVelocity.add(impulseVector); in update()
78 if (newVelocity.length2() < inertiaSquared) { in update()
86 if (touchingFloor && currentVelocity.y <= 0.0f && Math.abs(newVelocity.x) > 0.0f in update()
101 if (maxFriction > Math.abs(newVelocity.x)) { in update()
102 newVelocity.x = (0.0f); in update()
104 newVelocity.x = (newVelocity.x in update()
105 - (maxFriction * Utils.sign(newVelocity.x))); in update()
109 if (Math.abs(newVelocity.x) < 0.01f) { in update()
110 newVelocity.x = (0.0f); in update()
[all …]
DInterpolator.java75 float newVelocity = oldVelocity + (directionalAcceleration * secondsDelta); in interpolate() local
79 if (passedTarget(oldVelocity, newVelocity, mTarget)) { in interpolate()
80 newVelocity = mTarget; in interpolate()
83 mCurrent = newVelocity; in interpolate()
92 private boolean passedTarget(float oldVelocity, float newVelocity, float targetVelocity) { in passedTarget() argument
95 if (oldVelocity < targetVelocity && newVelocity > targetVelocity) { in passedTarget()
97 } else if (oldVelocity > targetVelocity && newVelocity < targetVelocity) { in passedTarget()
DHitReactionComponent.java179 Vector2 newVelocity = pool.allocate(parent.getPosition()); in receivedHit() local
180 newVelocity.subtract(attacker.getPosition()); in receivedHit()
181 newVelocity.set(0.5f * Utils.sign(newVelocity.x), in receivedHit()
182 0.5f * Utils.sign(newVelocity.y)); in receivedHit()
183 newVelocity.multiply(mBounceMagnitude); in receivedHit()
184 parent.setVelocity(newVelocity); in receivedHit()
186 pool.release(newVelocity); in receivedHit()