com.threerings.tudey.config
Class CameraConfig

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.tudey.config.CameraConfig
All Implemented Interfaces:
Exportable, com.threerings.io.Streamable, Copyable, Cloneable

public class CameraConfig
extends DeepObject
implements Exportable, com.threerings.io.Streamable

Contains the parameters of the camera (field of view, coordinates, etc.) and allows for interpolation.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
com.threerings.io.Streamable.Closure
 
Field Summary
 SphereCoords coords
          The camera's coordinates about the target.
 float far
          The distances to the camera's near and far clip planes.
 float fov
          The camera's vertical field of view, in radians.
 float near
          The distances to the camera's near and far clip planes.
 Vector3f offset
          The camera's offset from the target.
 int priority
          The priority of the parameters, for when multiple configs are active.
 
Constructor Summary
CameraConfig()
          Creates a new config with default values.
CameraConfig(CameraConfig other)
          Copy constructor.
CameraConfig(int priority, float fov, float near, float far, SphereCoords coords, Vector3f offset)
          Creates a new config with the supplied values.
 
Method Summary
 void apply(OrbitCameraHandler camhand)
          Applies this config (minus the offset) to the specified camera handler.
 CameraConfig lerp(CameraConfig other, float t)
          Interpolates between this and the specified other config.
 CameraConfig lerp(CameraConfig other, float t, CameraConfig result)
          Interpolates between this and the specified other config, storing the result in the object provided.
 CameraConfig lerpLocal(CameraConfig other, float t)
          Interpolates between this and the specified other config, storing the result in this config.
 CameraConfig set(CameraConfig other)
          Copies the parameters of another config.
 CameraConfig set(int priority, float fov, float near, float far, SphereCoords coords, Vector3f offset)
          Sets the parameters of this config.
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy, copy, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

priority

@Editable
public int priority
The priority of the parameters, for when multiple configs are active.


fov

@Editable(min=0.0,
          max=180.0,
          scale=0.017453292519943295,
          hgroup="f")
public float fov
The camera's vertical field of view, in radians.


near

@Editable(min=0.0,
          step=0.01,
          hgroup="f")
public float near
The distances to the camera's near and far clip planes.


far

@Editable(min=0.0,
          step=0.01,
          hgroup="f")
public float far
The distances to the camera's near and far clip planes.


coords

@Editable
public SphereCoords coords
The camera's coordinates about the target.


offset

@Editable
public Vector3f offset
The camera's offset from the target.

Constructor Detail

CameraConfig

public CameraConfig(int priority,
                    float fov,
                    float near,
                    float far,
                    SphereCoords coords,
                    Vector3f offset)
Creates a new config with the supplied values.


CameraConfig

public CameraConfig(CameraConfig other)
Copy constructor.


CameraConfig

public CameraConfig()
Creates a new config with default values.

Method Detail

apply

public void apply(OrbitCameraHandler camhand)
Applies this config (minus the offset) to the specified camera handler.


lerpLocal

public CameraConfig lerpLocal(CameraConfig other,
                              float t)
Interpolates between this and the specified other config, storing the result in this config.

Returns:
a reference to this config, for chaining.

lerp

public CameraConfig lerp(CameraConfig other,
                         float t)
Interpolates between this and the specified other config.

Returns:
a new config containing the result.

lerp

public CameraConfig lerp(CameraConfig other,
                         float t,
                         CameraConfig result)
Interpolates between this and the specified other config, storing the result in the object provided.

Returns:
a reference to the result config, for chaining.

set

public CameraConfig set(CameraConfig other)
Copies the parameters of another config.

Returns:
a reference to this config, for chaining.

set

public CameraConfig set(int priority,
                        float fov,
                        float near,
                        float far,
                        SphereCoords coords,
                        Vector3f offset)
Sets the parameters of this config.

Returns:
a reference to this config, for chaining.


Copyright © 2011. All Rights Reserved.