com.xj.anylogic.engine.presentation
Class Camera3D

java.lang.Object
  extended by com.xj.anylogic.engine.presentation.Camera3D
All Implemented Interfaces:
com.xj.anylogic.engine.internal.Child, com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal, com.xj.anylogic.engine.internal.presentation.WorldObject3D_xjal, java.io.Serializable, java.lang.Cloneable

public class Camera3D
extends java.lang.Object

3D camera object. Used in 3D windows. Has location and view direction.

Author:
XJ Technologies Company Ltd. www.anylogic.com
See Also:
Serialized Form

Constructor Summary
Camera3D()
          This constructor calls update() and should be used in the cameras changing at a model run-time
Camera3D(Camera3D c)
          Creates a copy of the given camera
Camera3D(double x, double y, double z, double rotationX, double rotationZ)
           
Camera3D(Shape3DGroup group, double x, double y, double z, double rotationX, double rotationZ)
          Creates new camera object
 
Method Summary
 Camera3D clone()
           
 void copyToClipboard()
          Copies camera settings to the system clipboard in the format supported by AnyLogic IDE.
 boolean equals(java.lang.Object obj)
          Returns true if the given obj is 3D camera with the same location/rotation parameters.
 Element3D_xjal get3DElement_xjal()
          This method is internal and shouldn't be accessed by user.
 Presentable getPresentable()
           
 double getRotationX()
          Returns the rotation of the camera around X axis (CW, from +Y to +Z).
 double getRotationZ()
          Returns the rotation of the camera in radians around Z axis (CW from +X to +Y)
 double getX()
          Returns the x coordinate of the camera location
 double getY()
          Returns the y coordinate of the camera location
 double getZ()
          Returns the z coordinate of the camera location
 void restoreOwner(java.lang.Object owner)
          This method normally should not be called by user
This method restores owner of this object
The method is used in snapshot saving/loading
 void set3DElement_xjal(Element3D_xjal element3D)
          This method is internal and shouldn't be accessed by user.
 void setContextReference_xjal(Presentable contextReference)
          This method is internal and shouldn't be accessed by user.
 void setPos(double x, double y, double z)
          Sets the camera location
 void setRotationX(double rotationX)
          Sets the rotation of the camera around X axis (CW, from +Y to +Z).
 void setRotationZ(double rotationZ)
          Sets the rotation of the camera in radians around Z axis (CW from +X to +Y)
 void setX(double x)
          Sets the x coordinate of the camera location
 void setY(double y)
          Sets the y coordinate of the camera location
 void setZ(double z)
          Sets the z coordinate of the camera location
 java.lang.String toString()
           
 void update()
          User extension point for cameras changing at a model run-time
This callback method should be overridden to set up-to-date values of camera properties using methods setX(double), setY(double) etc.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Camera3D

public Camera3D()
This constructor calls update() and should be used in the cameras changing at a model run-time

See Also:
update()

Camera3D

public Camera3D(Camera3D c)
Creates a copy of the given camera

Parameters:
c - the camera to copy, should be not null

Camera3D

public Camera3D(Shape3DGroup group,
                double x,
                double y,
                double z,
                double rotationX,
                double rotationZ)
Creates new camera object

Parameters:
group - the group owning this shape
x - the x coordinate of group
y - the y coordinate of group
z - the z coordinate of group
rotationX - the rotation of the camera in radians around X axis (CW from +Y to +Z).
Zero rotation value corresponds to horizontal orientation of the camera (parallel with XY-plane).
rotationZ - the rotation of the camera in radians around Z axis (CW from +X to +Y)

Camera3D

public Camera3D(double x,
                double y,
                double z,
                double rotationX,
                double rotationZ)
Method Detail

getX

public double getX()
Returns the x coordinate of the camera location

Returns:
the x coordinate of the camera location

setX

public void setX(double x)
Sets the x coordinate of the camera location

Parameters:
x - the x coordinate of the camera location

getY

public double getY()
Returns the y coordinate of the camera location

Returns:
the y coordinate of the camera location

setY

public void setY(double y)
Sets the y coordinate of the camera location

Parameters:
y - the y coordinate of the camera location

getZ

public double getZ()
Returns the z coordinate of the camera location

Returns:
the z coordinate of the camera location

setZ

public void setZ(double z)
Sets the z coordinate of the camera location

Parameters:
z - the z coordinate of the camera location

getRotationZ

public double getRotationZ()
Returns the rotation of the camera in radians around Z axis (CW from +X to +Y)

Returns:
the rotation of the camera in radians around Z axis (CW from +X to +Y)

setRotationZ

public void setRotationZ(double rotationZ)
Sets the rotation of the camera in radians around Z axis (CW from +X to +Y)

Parameters:
rotationZ - the new value of rotation in radians around Z axis (CW from +X to +Y)

getRotationX

public double getRotationX()
Returns the rotation of the camera around X axis (CW, from +Y to +Z).
Zero rotation value corresponds to horizontal orientation of the camera (parallel with XY-plane).

Returns:
the rotation around X axis (CW, from +Y to +Z), in radians

setRotationX

public void setRotationX(double rotationX)
Sets the rotation of the camera around X axis (CW, from +Y to +Z).
Zero rotation value corresponds to horizontal orientation of the camera (parallel with XY-plane).

Parameters:
rotationX - the new value of rotation around X axis (CW, from +Y to +Z), in radians

setPos

public void setPos(double x,
                   double y,
                   double z)
Sets the camera location

Parameters:
x - the x coordinate of the camera location
y - the y coordinate of the camera location
z - the z coordinate of the camera location

update

public void update()
User extension point for cameras changing at a model run-time
This callback method should be overridden to set up-to-date values of camera properties using methods setX(double), setY(double) etc.
Default implementation does nothing


clone

public Camera3D clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Returns true if the given obj is 3D camera with the same location/rotation parameters.

Overrides:
equals in class java.lang.Object

copyToClipboard

public void copyToClipboard()
Copies camera settings to the system clipboard in the format supported by AnyLogic IDE.
To paste the camera setting in the AnyLogic, please select the camera object, open "General" page of its Property View and press the button with clipboard icon ("Paste") located in the properties page.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPresentable

public Presentable getPresentable()
Specified by:
getPresentable in interface com.xj.anylogic.engine.internal.presentation.WorldObject3D_xjal

restoreOwner

public final void restoreOwner(java.lang.Object owner)
This method normally should not be called by user
This method restores owner of this object
The method is used in snapshot saving/loading

Specified by:
restoreOwner in interface com.xj.anylogic.engine.internal.Child
Parameters:
owner - owner of this object, usually ActiveObject, Experiment or ShapeGroup

setContextReference_xjal

public void setContextReference_xjal(Presentable contextReference)
Description copied from interface: com.xj.anylogic.engine.internal.presentation.WorldObject3D_xjal
This method is internal and shouldn't be accessed by user.
It is public due to technical reasons.

Specified by:
setContextReference_xjal in interface com.xj.anylogic.engine.internal.presentation.WorldObject3D_xjal

set3DElement_xjal

public void set3DElement_xjal(Element3D_xjal element3D)
Description copied from interface: com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal
This method is internal and shouldn't be accessed by user.
It is public due to technical reasons.

Specified by:
set3DElement_xjal in interface com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal

get3DElement_xjal

public Element3D_xjal get3DElement_xjal()
Description copied from interface: com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal
This method is internal and shouldn't be accessed by user.
It is public due to technical reasons.

Specified by:
get3DElement_xjal in interface com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal


Copyright © 1991-2008 XJ Technlogies. All Rights Reserved.