Skip to content

Commit bf0941d

Browse files
committed
Unported the getFrameVelocity() method from PositionTransition3f and
PositionTransition3d since a) it's not a velocity and b) embeds a few too many assumptions on how to handle half a frame... assumptions the caller wouldn't have to make and could easily do the calculation themselves. Officially deprecated it on PositionTransition (even though the class is already completely deprecated) just for documentation purposes.
1 parent 05b87a6 commit bf0941d

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

release-notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Version 1.3.0 (unreleased)
1010
* Added PositionTransition3f and PositionTransition3d.
1111
* Deprecated PositionTransition in favor of PositionTransition3f or
1212
PositionTransition3d.
13+
* Deprecated PositionTransition.getFrameVelocity() and did not port it
14+
to PositionTransition3f or PositionTransition3d.
1315

1416

1517
Version 1.2.0 (latest)

src/main/java/com/simsilica/mathd/trans/PositionTransition.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ protected final float tween( long time ) {
120120
return part / length;
121121
}
122122

123+
/**
124+
* @deprecated This is actually not a velocity and doesn't properly cover
125+
* the case where an end is null. The caller can easily calculate
126+
* this information themselves and decide what to do with a null
127+
* end point.
128+
*/
129+
@Deprecated
123130
public Vector3f getFrameVelocity() {
124131
return new Vector3f( endPos.x - startPos.x, endPos.y - startPos.y, endPos.z - startPos.z );
125132
}

src/main/java/com/simsilica/mathd/trans/PositionTransition3d.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ protected final double tween( long time ) {
109109
return part / length;
110110
}
111111

112-
public Vec3d getFrameVelocity() {
113-
return new Vec3d( endPos.x - startPos.x, endPos.y - startPos.y, endPos.z - startPos.z );
114-
}
115-
116112
public Vec3d getPosition( long time ) {
117113
return getPosition(time, false);
118114
}

src/main/java/com/simsilica/mathd/trans/PositionTransition3f.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@ protected final float tween( long time ) {
117117
return part / length;
118118
}
119119

120-
public Vector3f getFrameVelocity() {
121-
return new Vector3f( endPos.x - startPos.x, endPos.y - startPos.y, endPos.z - startPos.z );
122-
}
123-
124120
public Vector3f getPosition( long time ) {
125121
return getPosition(time, false);
126122
}

0 commit comments

Comments
 (0)