Sweet Home 3D 2.5

com.eteks.sweethome3d.model
Class ObserverCamera

java.lang.Object
  extended by com.eteks.sweethome3d.model.Camera
      extended by com.eteks.sweethome3d.model.ObserverCamera
All Implemented Interfaces:
Selectable, Serializable, Cloneable

public class ObserverCamera
extends Camera
implements Selectable

Observer camera characteristics in home.

Author:
Emmanuel Puybaret
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.eteks.sweethome3d.model.Camera
Camera.Property
 
Constructor Summary
ObserverCamera(float x, float y, float z, float yaw, float pitch, float fieldOfView)
          Creates a camera at given location and angle.
 
Method Summary
 ObserverCamera clone()
          Returns a clone of this camera.
 boolean containsPoint(float x, float y, float margin)
          Returns true if this camera contains the point at (x, y) with a given margin.
 float getDepth()
          Returns the depth of this observer camera according to human proportions with an eyes elevation at z.
 float getHeight()
          Returns the height of this observer camera according to human proportions with an eyes elevation at z.
 float[][] getPoints()
          Returns the points of each corner of the rectangle surrounding this camera.
 float getWidth()
          Returns the width of this observer camera according to human proportions with an eyes elevation at z.
 boolean intersectsRectangle(float x0, float y0, float x1, float y1)
          Returns true if this camera intersects with the horizontal rectangle which opposite corners are at points (x0, y0) and (x1, y1).
 void move(float dx, float dy)
          Moves this camera of (dx, dy) units.
 void setX(float x)
          Sets the abscissa of this camera.
 void setY(float y)
          Sets the ordinate of this camera.
 void setYaw(float yaw)
          Sets the yaw angle in radians of this camera.
 void setZ(float z)
          Sets the elevation of this camera.
 
Methods inherited from class com.eteks.sweethome3d.model.Camera
addPropertyChangeListener, getFieldOfView, getPitch, getX, getY, getYaw, getZ, removePropertyChangeListener, setCamera, setFieldOfView, setPitch
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObserverCamera

public ObserverCamera(float x,
                      float y,
                      float z,
                      float yaw,
                      float pitch,
                      float fieldOfView)
Creates a camera at given location and angle.

Method Detail

setYaw

public void setYaw(float yaw)
Sets the yaw angle in radians of this camera.

Overrides:
setYaw in class Camera

setX

public void setX(float x)
Sets the abscissa of this camera.

Overrides:
setX in class Camera

setY

public void setY(float y)
Sets the ordinate of this camera.

Overrides:
setY in class Camera

setZ

public void setZ(float z)
Sets the elevation of this camera.

Overrides:
setZ in class Camera

getWidth

public float getWidth()
Returns the width of this observer camera according to human proportions with an eyes elevation at z.


getDepth

public float getDepth()
Returns the depth of this observer camera according to human proportions with an eyes elevation at z.


getHeight

public float getHeight()
Returns the height of this observer camera according to human proportions with an eyes elevation at z.


getPoints

public float[][] getPoints()
Returns the points of each corner of the rectangle surrounding this camera.

Specified by:
getPoints in interface Selectable
Returns:
an array of the 4 (x,y) coordinates of the camera corners.

intersectsRectangle

public boolean intersectsRectangle(float x0,
                                   float y0,
                                   float x1,
                                   float y1)
Returns true if this camera intersects with the horizontal rectangle which opposite corners are at points (x0, y0) and (x1, y1).

Specified by:
intersectsRectangle in interface Selectable

containsPoint

public boolean containsPoint(float x,
                             float y,
                             float margin)
Returns true if this camera contains the point at (x, y) with a given margin.

Specified by:
containsPoint in interface Selectable

move

public void move(float dx,
                 float dy)
Moves this camera of (dx, dy) units.

Specified by:
move in interface Selectable

clone

public ObserverCamera clone()
Returns a clone of this camera.

Specified by:
clone in interface Selectable
Overrides:
clone in class Camera

Sweet Home 3D 2.5

© Copyrights 2006-2010 eTeks - All rights reserved
Distributed under GNU General Public License