Jeospace API

org.jeospace.navigation
Class SphericalInterpolator

java.lang.Object
  extended byorg.jeospace.navigation.SphericalInterpolator
All Implemented Interfaces:
Position, PositionInterpolator

public class SphericalInterpolator
extends java.lang.Object
implements PositionInterpolator

A position interpolator that takes Polar coordinates as arguments. The interpolation follows the shortest path from initial position to final position along a "great circle" path.

Version:
$Revision: 1.2 $
Author:
Rex Melton
See Also:
Alpha, Cartesian, Polar

Constructor Summary
SphericalInterpolator(Polar startPosition, Polar endPosition, Length scale)
          Construct an instance
 
Method Summary
 void addInterpolationListener(InterpolationListener il)
          Add a listener to this interpolator
 void enablePosition(boolean enabled)
          Set the state of the interpolator to update it's Alpha in response to update( ) calls.
protected  void fireInterpolationEvent(int id)
          Deliver events to the listeners
 void get(Cartesian cartesian)
          Return the position as a Cartesian
 Alpha getAlpha()
          Return the Alpha object
 Polar getPolar()
          Return the positioning data in a Polar coordinate object.
 void removeInterpolationListener(InterpolationListener il)
          Remove a listener from this interpolator
 void setAlpha(Alpha alpha)
          Set the Alpha object to drive the interpolator
 void updatePosition(double timeValue)
          Process any position changes for the next simulation frame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SphericalInterpolator

public SphericalInterpolator(Polar startPosition,
                             Polar endPosition,
                             Length scale)
Construct an instance

Parameters:
startPosition - the initial position at alpha value of 0.0
endPosition - the final position at alpha value of 1.0
Method Detail

setAlpha

public void setAlpha(Alpha alpha)
Set the Alpha object to drive the interpolator

Specified by:
setAlpha in interface PositionInterpolator
Parameters:
alpha - the Alpha object to install

getAlpha

public Alpha getAlpha()
Return the Alpha object

Specified by:
getAlpha in interface PositionInterpolator
Returns:
the Alpha object

updatePosition

public void updatePosition(double timeValue)
Process any position changes for the next simulation frame. This method updates the Alpha of this interpolator by a single increment.

Specified by:
updatePosition in interface Position
Parameters:
timeValue - the time value is ignored

enablePosition

public void enablePosition(boolean enabled)
Set the state of the interpolator to update it's Alpha in response to update( ) calls.

Specified by:
enablePosition in interface Position
Parameters:
enabled - true if the object should update it's Alpha in response to update( ) calls, false if the object should NOT update it's Alpha in response to update( ) calls.

get

public void get(Cartesian cartesian)
Return the position as a Cartesian

Specified by:
get in interface Position
Parameters:
cartesian - the Cartesian object to initialize with the position calculated at the fraction value of the Alpha

getPolar

public Polar getPolar()
Return the positioning data in a Polar coordinate object.

Specified by:
getPolar in interface Position
Returns:
the positioning data in a Polar coordinate object.

addInterpolationListener

public void addInterpolationListener(InterpolationListener il)
Add a listener to this interpolator

Specified by:
addInterpolationListener in interface PositionInterpolator
Parameters:
il - the InterpolationListener

removeInterpolationListener

public void removeInterpolationListener(InterpolationListener il)
Remove a listener from this interpolator

Specified by:
removeInterpolationListener in interface PositionInterpolator
Parameters:
il - the InterpolationListener

fireInterpolationEvent

protected void fireInterpolationEvent(int id)
Deliver events to the listeners

Parameters:
id - the InterpolationEvent id

Jeospace API

Copyright © 2006 - jeospace.org