AnyLogic
Expand
Font size
  • java.lang.Object
    • com.anylogic.engine.presentation.Camera3D
All Implemented Interfaces:
com.anylogic.engine.internal.Child, AggregatableAnimationElement, HasLevel, LevelElement, 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:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Constructor Summary

Constructors 
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
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods 
Camera3D clone()  
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.
boolean equals​(java.lang.Object obj)
Returns true if the given obj is 3D camera with the same location/rotation parameters.
Level getLevel()
Returns the level containing this shape.
Presentable getPresentable()  
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).
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 onAggregatorVisibilityChanged()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
void restoreOwner​(java.lang.Object owner)
Deprecated.
void setContextReference_xjal​(Presentable contextReference)
Deprecated.
void setLevel​(Level level)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
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).
Zero rotation value corresponds to horizontal orientation of the camera (parallel with XY-plane).
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.
Default implementation does nothing
boolean updateDynamicPropertiesStructural​(boolean publicOnly)  
Modifier and Type Method Description

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

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

@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 java.lang.String toString()
Overrides:
toString in class java.lang.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​(java.lang.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.
How can we improve this article?