org.xith3d.utility.camera
Class BasicPlaceableVerticalFocuser

java.lang.Object
  extended by org.xith3d.utility.camera.BasicPlaceableVerticalFocuser
All Implemented Interfaces:
Updatable
Direct Known Subclasses:
SmoothPlaceableVerticalFocuser

public class BasicPlaceableVerticalFocuser
extends java.lang.Object
implements Updatable

A Camera which follows a Placeable object, so that it is always at the center of the screen. The height of the camera is adjustable, up vector is always +Y.


Field Summary
protected  org.openmali.vecmath2.Vector3f move
           
 
Constructor Summary
BasicPlaceableVerticalFocuser(View view, Placeable placeable, float height, Updater updater)
          Creates a new BasicPlaceableVerticalFocuser.
 
Method Summary
protected  org.openmali.vecmath2.Tuple3f getFocusPoint()
          Returns the focus point.
 float getHeight()
          Returns the height.
protected  void lookAt(org.openmali.vecmath2.Tuple3f pos)
          Makes the camera look at the given position.
 void setHeight(float height)
          Sets the new height.
 void update(long gameTime, long frameTime, UpdatingThread.TimingMode timingMode)
          Updates this Updatable object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

move

protected org.openmali.vecmath2.Vector3f move
Constructor Detail

BasicPlaceableVerticalFocuser

public BasicPlaceableVerticalFocuser(View view,
                                     Placeable placeable,
                                     float height,
                                     Updater updater)
Creates a new BasicPlaceableVerticalFocuser.

Parameters:
view - the view on which to act
placeable - the placeable to focus on
height - the initial height of the Camera
updater - an Updater on which to register
Method Detail

setHeight

public void setHeight(float height)
Sets the new height.

Parameters:
height - the new height to set

getHeight

public final float getHeight()
Returns the height.

Returns:
the height

getFocusPoint

protected org.openmali.vecmath2.Tuple3f getFocusPoint()
Returns the focus point.

Returns:
the focus point

lookAt

protected void lookAt(org.openmali.vecmath2.Tuple3f pos)
Makes the camera look at the given position.

Parameters:
pos - the position to look at.

update

public void update(long gameTime,
                   long frameTime,
                   UpdatingThread.TimingMode timingMode)
Updates this Updatable object.

Specified by:
update in interface Updatable
Parameters:
gameTime - the gameTime in Milliseconds
frameTime - the frameTime in Milliseconds (needed time for the last frame)
timingMode - the TimingMode to use for frameTime.