Changed the other two-vector version of interpolate

to interpolateLocal also since it also stores it back
to the same vector.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10796 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
PSp..om 12 years ago
parent b73d42e654
commit 1fc55d2eb0
  1. 2
      engine/src/core/com/jme3/bounding/BoundingSphere.java
  2. 4
      engine/src/core/com/jme3/math/Transform.java
  3. 2
      engine/src/core/com/jme3/math/Vector3f.java

@ -336,7 +336,7 @@ public class BoundingSphere extends BoundingVolume {
private void setSphere(Vector3f O, Vector3f A) {
radius = FastMath.sqrt(((A.x - O.x) * (A.x - O.x) + (A.y - O.y)
* (A.y - O.y) + (A.z - O.z) * (A.z - O.z)) / 4f) + RADIUS_EPSILON - 1f;
center.interpolate(O, A, .5f);
center.interpolateLocal(O, A, .5f);
}
/**

@ -181,8 +181,8 @@ public final class Transform implements Savable, Cloneable, java.io.Serializable
*/
public void interpolateTransforms(Transform t1, Transform t2, float delta) {
this.rot.slerp(t1.rot,t2.rot,delta);
this.translation.interpolate(t1.translation,t2.translation,delta);
this.scale.interpolate(t1.scale,t2.scale,delta);
this.translation.interpolateLocal(t1.translation,t2.translation,delta);
this.scale.interpolateLocal(t1.scale,t2.scale,delta);
}
/**

@ -869,7 +869,7 @@ public final class Vector3f implements Savable, Cloneable, java.io.Serializable
* @param changeAmnt An amount between 0.0 - 1.0 representing a precentage
* change from beginVec towards finalVec
*/
public Vector3f interpolate(Vector3f beginVec,Vector3f finalVec, float changeAmnt) {
public Vector3f interpolateLocal(Vector3f beginVec,Vector3f finalVec, float changeAmnt) {
this.x=(1-changeAmnt)*beginVec.x + changeAmnt*finalVec.x;
this.y=(1-changeAmnt)*beginVec.y + changeAmnt*finalVec.y;
this.z=(1-changeAmnt)*beginVec.z + changeAmnt*finalVec.z;

Loading…
Cancel
Save