edu.eside.flingbox.graphics
Class RenderCamera

java.lang.Object
  extended by edu.eside.flingbox.graphics.RenderCamera

public class RenderCamera
extends java.lang.Object

Specifies OpenGL camera interface. By setting camera's position and width camera could be moved.


Field Summary
 float bottom
          Used by OpenGL
 boolean isChanged
          Flag to change OpenGL's camera
 float left
          Used by OpenGL
 float rigth
          Used by OpenGL
 float top
          Used by OpenGL
 
Constructor Summary
RenderCamera(float surfaceWidth, float surfaceHeight)
          Default constructor for a surface
 
Method Summary
 Vector2D getAperture()
           
 Vector2D getPosition()
           
 Vector2D project(Vector2D v)
           
 Vector2D scale(Vector2D v)
           
 void setAperture(Vector2D aperture)
          Sets camera's aperture
 void setPosition(Vector2D newPosition)
          Sets Camera's position.
 void setSurface(float surfaceWidth, float surfaceHeight)
          Changes surface size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

left

public float left
Used by OpenGL


rigth

public float rigth
Used by OpenGL


top

public float top
Used by OpenGL


bottom

public float bottom
Used by OpenGL


isChanged

public boolean isChanged
Flag to change OpenGL's camera

Constructor Detail

RenderCamera

public RenderCamera(float surfaceWidth,
                    float surfaceHeight)
Default constructor for a surface

Method Detail

setSurface

public void setSurface(float surfaceWidth,
                       float surfaceHeight)
Changes surface size


setPosition

public void setPosition(Vector2D newPosition)
Sets Camera's position.

Parameters:
x - Center of the focus, x
y - Center of the focus, y
width - Width of camera's frame. height is calculated to keep aspect ratio

setAperture

public void setAperture(Vector2D aperture)
Sets camera's aperture

Parameters:
horizontalAperture - camera's horizontal aperture

project

public Vector2D project(Vector2D v)
Returns:
projected vector

scale

public Vector2D scale(Vector2D v)
Returns:
scaled vector

getPosition

public Vector2D getPosition()
Returns:
camera's position

getAperture

public Vector2D getAperture()
Returns:
camera's aperture