AnyLogic
Expand
Font size
All Implemented Interfaces:
com.anylogic.engine.internal.Child, AggregatableAnimationElement, HasLevel, LevelElement, Serializable, Cloneable

public class Camera3D
extends Object
3D camera object. Used in 3D windows. Has location and view direction.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Constructor Summary

ConstructorDescription
Camera3D()
This constructor calls update() and should be used in the cameras changing at a model run-time
Camera3D(double x, double y, double z, double rotationX, double rotationZ) 
Camera3D(Camera3D c)
Creates a copy of the given camera
Camera3D(ShapeGroup group, double x, double y, double z, double rotationX, double rotationZ)
Creates new camera object

Method Summary

Modifier and TypeMethodDescription
Camera3Dclone() 
voidcopyToClipboard()
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.
booleanequals(Object obj)
Returns true if the given obj is 3D camera with the same location/rotation parameters.
LevelgetLevel()
Returns the level containing this shape.
PresentablegetPresentable() 
doublegetRotationX()
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).
doublegetRotationZ()
Returns the rotation of the camera in radians around Z axis (CW from +X to +Y)
doublegetX()
Returns the x coordinate of the camera location
doublegetY()
Returns the y coordinate of the camera location
doublegetZ()
Returns the z coordinate of the camera location
voidonAggregatorVisibilityChanged()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
final voidrestoreOwner(Object owner)
Deprecated.
voidsetContextReference_xjal(Presentable contextReference)
Deprecated.
voidsetLevel(Level level)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
voidsetPos(double x, double y, double z)
Sets the camera location
voidsetRotationX(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).
voidsetRotationZ(double rotationZ)
Sets the rotation of the camera in radians around Z axis (CW from +X to +Y)
voidsetX(double x)
Sets the x coordinate of the camera location
voidsetY(double y)
Sets the y coordinate of the camera location
voidsetZ(double z)
Sets the z coordinate of the camera location
StringtoString() 
voidupdate()
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
booleanupdateDynamicPropertiesStructural(boolean publicOnly) 

Methods inherited from class java.lang.Object

getClass, hashCode, notify, notifyAll, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

initializeInternal, postInitialize

Constructor Details

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(ShapeGroup 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 Details

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()

equals

public boolean equals(Object obj)
Returns true if the given obj is 3D camera with the same location/rotation parameters.
Overrides:
equals in class Object

copyToClipboard

@AnyLogicLegacyAPI
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 String toString()
Overrides:
toString in class Object

onAggregatorVisibilityChanged

public void onAggregatorVisibilityChanged()
Description copied from interface: AggregatableAnimationElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.

updateDynamicPropertiesStructural

@AnyLogicInternalAPI
public boolean updateDynamicPropertiesStructural(boolean publicOnly)
Returns:
true if update was done (usually for visible elements, respecting public flag etc.)

getPresentable

public Presentable getPresentable()

getLevel

public Level getLevel()
Returns the level containing this shape. The returned value is null for shapes in the experiments.
Specified by:
getLevel in interface HasLevel
Returns:
the level containing this shape

setLevel

@AnyLogicInternalAPI
public void setLevel(Level level)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. Please use Level.add(Shape) instead.
Specified by:
setLevel in interface LevelElement

restoreOwner

@AnyLogicInternalCodegenAPI
@Deprecated
public final void restoreOwner(Object owner)
Deprecated.
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.anylogic.engine.internal.Child
Parameters:
owner - owner of this object, usually Agent, Experiment or ShapeGroup

setContextReference_xjal

@AnyLogicInternalAPI
@Deprecated
public void setContextReference_xjal(Presentable contextReference)
Deprecated.