Fixed MotionTrack setEnabled method
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8954 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
9232c71cd7
commit
1b1bad7da5
@ -69,13 +69,11 @@ public class MotionTrack extends AbstractCinematicEvent implements Control {
|
||||
protected Direction directionType = Direction.None;
|
||||
protected MotionPath path;
|
||||
private boolean isControl = true;
|
||||
|
||||
/**
|
||||
* the distance traveled by the spatial on the path
|
||||
*/
|
||||
protected float traveledDistance = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Enum for the different type of target direction behavior
|
||||
*/
|
||||
@ -203,8 +201,6 @@ public class MotionTrack extends AbstractCinematicEvent implements Control {
|
||||
vars.release();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void onUpdate(float tpf) {
|
||||
traveledDistance = path.interpolatePath(time, this);
|
||||
computeTargetDirection();
|
||||
@ -434,7 +430,11 @@ public class MotionTrack extends AbstractCinematicEvent implements Control {
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
if (enabled) {
|
||||
play();
|
||||
} else {
|
||||
pause();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
@ -459,6 +459,4 @@ public class MotionTrack extends AbstractCinematicEvent implements Control {
|
||||
public float getTraveledDistance() {
|
||||
return traveledDistance;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user