A bunch of business related to moving the camera along paths. Also repackaged

camera handling stuff into com.threerings.jme.camera.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3751 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2005-11-09 20:01:28 +00:00
parent 6dc12423ee
commit 86abf1675f
6 changed files with 213 additions and 2 deletions
+31 -1
View File
@@ -51,7 +51,8 @@ import com.jme.light.PointLight;
import com.jme.math.Vector3f;
import com.jme.util.Timer;
import com.threerings.jme.input.GodViewHandler;
import com.threerings.jme.camera.CameraPath;
import com.threerings.jme.camera.GodViewHandler;
/**
* Defines a basic application framework providing integration with the
@@ -180,6 +181,27 @@ public class JmeApp
}
}
/**
* Starts the camera moving along a path which will be updated every tick
* until it is complete.
*/
public void moveCamera (CameraPath path)
{
if (_campath != null) {
_campath.abort();
}
_campath = path;
}
/**
* Returns true if the camera is currently animating along a path, false if
* it is not.
*/
public boolean cameraIsMoving ()
{
return (_campath != null);
}
/**
* Instructs the application to stop the main loop, cleanup and exit.
*/
@@ -394,6 +416,13 @@ public class JmeApp
float timePerFrame = _timer.getTimePerFrame();
_root.updateGeometricState(timePerFrame, true);
// if there's a camera path, update that as well
if (_campath != null) {
if (_campath.tick(timePerFrame)) {
_campath = null;
}
}
// update our stats display if we have one
if (_stats != null) {
_stats.update(_timer, _display.getRenderer());
@@ -509,6 +538,7 @@ public class JmeApp
protected PropertiesIO _properties;
protected DisplaySystem _display;
protected Camera _camera;
protected CameraPath _campath;
protected InputHandler _input;
protected BRootNode _rnode;