Package com.anylogic.engine.presentation
- Nested Class Summary
- Nested classes/interfaces inherited from class com.anylogic.engine.presentation.Light3D
- Field Summary
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- getX
- setX
- getY
- setY
- getZ
- setZ
- setPos
- getConstantAttenuation
- setConstantAttenuation
- getLinearAttenuation
- setLinearAttenuation
- getQuadraticAttenuation
- setQuadraticAttenuation
- setAttenuation
- getAngleZ
- setAngleZ
- getAngleX
- setAngleX
- getCutOffAngle
- setCutOffAngle
- getDropOffRate
- setDropOffRate
- clone
- updateDynamicPropertiesStructural
- getLevel
- setLevel
- restoreOwner
- setContextReference_xjal
- java.lang.Object
- com.anylogic.engine.presentation.Light3D
- com.anylogic.engine.presentation.Light3DSpot
- All Implemented Interfaces:
com.anylogic.engine.internal.Child
,AggregatableAnimationElement
,HasLevel
,LevelElement
,SVGElement
,UsdElement
,Serializable
,Cloneable
- Direct Known Subclasses:
Light3D.CarHeadlight
public class Light3DSpot extends Light3D
3D spot light, may be added to 3D groups for scene lighting
Spot source of light is a particular case of a
Lighting is performed along the given direction which is specified using 2 angles: orientation around X and Z axes.
You can define attenuation coefficients for this kind of source of light.
Spot source of light is a particular case of a
point light
.
Spot source creates a beam of light that gradually becomes
wider and makes a cone of light (with cut-off angle
and drop-off rate). You can think of a spot
source of light as a searchlight or a car headlight.Lighting is performed along the given direction which is specified using 2 angles: orientation around X and Z axes.
You can define attenuation coefficients for this kind of source of light.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
-
Light3D
Serialized Form
Constructor | Description |
---|---|
Light3DSpot |
Creates new 3D spot light
|
Modifier and Type | Method | Description |
---|---|---|
final Light3DSpot | clone() |
Creates and returns a copy of this light (i.e.
|
float | getAngleX() |
Returns the orientation of the light around X axis (CW, from +Y to +Z).
Zero angle value corresponds to horizontal orientation of the light (parallel with XY-plane). |
float | getAngleZ() |
Returns the orientation of the light around Z axis (CW, from +X to +Y).
Zero angle value corresponds to orientation of the light towards -Y direction (to the North). |
float | getConstantAttenuation() |
Returns the constant attenuation factor of the light
|
float | getCutOffAngle() |
Returns the cut-off angle of light source.
The angle is measured from the light direction axis to the light cut-off cone. The angle lies in the range [0, PI/2] radians,
where the angle of PI/2 corresponds to the lighting
of the half of the world's space. |
float | getDropOffRate() |
Returns the value of the exponent that is used to control how the light
intensity drops off from the center to the cut off angle.
|
Level | getLevel() |
Returns the level containing this shape.
|
float | getLinearAttenuation() |
Returns the linear attenuation factor of the light
|
float | getQuadraticAttenuation() |
Returns the quadratic attenuation factor of the light
|
float | getX() |
Returns the x coordinate of the light source position
|
float | getY() |
Returns the y coordinate of the light source position
|
float | getZ() |
Returns the z coordinate of the light source position
|
final void | restoreOwner |
Deprecated.
|
void | setAngleX |
Sets the orientation of the light around X axis (CW, from +Y to +Z).
Zero angle value corresponds to horizontal orientation of the light (parallel with XY-plane). |
void | setAngleZ |
Sets the orientation of the light around Z axis (CW, from +X to +Y).
Zero angle value corresponds to orientation of the light towards -Y direction (to the North). |
void | setAttenuation |
Sets the attenuation factors of the light fading with the distance.
Light attenuation is calculated using this factor (where d is a distance from the light source):attenuation factor = 1 / (kC + kLd + kQd2) If all of provided factors are set to zero, then the light isn't faded. |
void | setConstantAttenuation |
Sets the constant attenuation factor of the light
|
void | setContextReference_xjal |
Deprecated.
|
void | setCutOffAngle |
Sets the cut-off angle of light source.
The angle is measured from the light direction axis to the light cut-off cone. The angle must lie in the range [0, PI/2] radians,
where the angle of PI/2 corresponds to the lighting
of the half of the world's space. |
void | setDropOffRate |
Sets the value of the exponent that can be used to control how the light
intensity drops off from the center to the cut off angle.
|
void | setLevel |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
void | setLinearAttenuation |
Sets the linear attenuation factor of the light
|
void | setPos |
Sets the light source position
|
void | setQuadraticAttenuation |
Sets the quadratic attenuation factor of the light
|
void | setX |
Sets the x coordinate of the light source position
|
void | setY |
Sets the y coordinate of the light source position
|
void | setZ |
Sets the z coordinate of the light source position
|
boolean | updateDynamicPropertiesStructural |
executeUserAction, findSVGElement, getAmbientColor, getDiffuseColor, getGroup, getName, getOrGenerateUSDId, getPresentable, getSpecularColor, getSVGId, isEnabled, isGlobal, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setAmbientColor, setDiffuseColor, setEnabled, setGlobal, setSpecularColor, update, updateSVGProperties
public Light3DSpot(boolean ispublic, double x, double y, double z, double angleX, double angleZ, double cutOffAngle, double dropOffRate, double constantAttenuation, double linearAttenuation, double quadraticAttenuation, Color diffuseColor, Color specularColor, Color ambientColor, boolean global)
Creates new 3D spot light
- Parameters:
ispublic
- iftrue
, the light persists on container's presentationx
- the x coordinate of light source locationy
- the y coordinate of light source locationz
- the z coordinate of light source locationangleX
- the orientation around X axis (CW, from +Y to +Z), in radiansangleZ
- the orientation around Z axis (CW, from +X to +Y), in radianscutOffAngle
- the cut-off angle in radians[0, PI/2]
dropOffRate
- the value of the light intensity drop off exponentconstantAttenuation
- the constant attenuation factorlinearAttenuation
- the linear attenuation factorquadraticAttenuation
- the quadraticAttenuation attenuation factordiffuseColor
- the diffuse color componentspecularColor
- the specular color componentambientColor
- the ambient color componentglobal
- iftrue
, the light affects shapes outside the group the light is placed in
public float getX()
Returns the x coordinate of the light source position
- Returns:
- the x coordinate of the light source position
public void setX(double x)
Sets the x coordinate of the light source position
- Parameters:
x
- the x coordinate of the light source position
public float getY()
Returns the y coordinate of the light source position
- Returns:
- the y coordinate of the light source position
public void setY(double y)
Sets the y coordinate of the light source position
- Parameters:
y
- the y coordinate of the light source position
public float getZ()
Returns the z coordinate of the light source position
- Returns:
- the z coordinate of the light source position
public void setZ(double z)
Sets the z coordinate of the light source position
- Parameters:
z
- the z coordinate of the light source position
public void setPos(double x, double y, double z)
Sets the light source position
- Parameters:
x
- the x coordinate of the light source positiony
- the y coordinate of the light source positionz
- the z coordinate of the light source position
public float getConstantAttenuation()
Returns the constant attenuation factor of the light
- Returns:
- the constant attenuation factor of the light
public void setConstantAttenuation(double constantAttenuation)
Sets the constant attenuation factor of the light
- Parameters:
constantAttenuation
- the constant attenuation factor of the light
public float getLinearAttenuation()
Returns the linear attenuation factor of the light
- Returns:
- the linear attenuation factor of the light
public void setLinearAttenuation(double linearAttenuation)
Sets the linear attenuation factor of the light
- Parameters:
linearAttenuation
- the linear attenuation factor of the light
public float getQuadraticAttenuation()
Returns the quadratic attenuation factor of the light
- Returns:
- the quadratic attenuation factor of the light
public void setQuadraticAttenuation(double quadraticAttenuation)
Sets the quadratic attenuation factor of the light
- Parameters:
quadraticAttenuation
- the quadratic attenuation factor of the light
public void setAttenuation(double constantAttenuation, double linearAttenuation, double quadraticAttenuation)
Sets the attenuation factors of the light fading with the distance.
Light attenuation is calculated using this factor (where
If all of provided factors are set to zero, then the light isn't faded.
Light attenuation is calculated using this factor (where
d
is a distance from the light source):attenuation factor = 1 / (kC + kLd + kQd2)
If all of provided factors are set to zero, then the light isn't faded.
- Parameters:
constantAttenuation
- constant attenuation factor:kC
linearAttenuation
- linear attenuation factor:kL
quadraticAttenuation
- quadratic attenuation factor:kQ
public float getAngleZ()
Returns the orientation of the light around Z axis (CW, from +X to +Y).
Zero angle value corresponds to orientation of the light towards -Y direction (to the North).
Zero angle value corresponds to orientation of the light towards -Y direction (to the North).
- Returns:
- the orientation around Z axis (CW, from +X to +Y), in radians
public void setAngleZ(double angleZ)
Sets the orientation of the light around Z axis (CW, from +X to +Y).
Zero angle value corresponds to orientation of the light towards -Y direction (to the North).
Zero angle value corresponds to orientation of the light towards -Y direction (to the North).
- Parameters:
angleZ
- the new value of orientation around Z axis (CW, from +X to +Y), in radians
public float getAngleX()
Returns the orientation of the light around X axis (CW, from +Y to +Z).
Zero angle value corresponds to horizontal orientation of the light (parallel with XY-plane).
Zero angle value corresponds to horizontal orientation of the light (parallel with XY-plane).
- Returns:
- orientation around X axis (CW, from +Y to +Z), in radians
public void setAngleX(double angleX)
Sets the orientation of the light around X axis (CW, from +Y to +Z).
Zero angle value corresponds to horizontal orientation of the light (parallel with XY-plane).
Zero angle value corresponds to horizontal orientation of the light (parallel with XY-plane).
- Parameters:
angleX
- the new value of orientation around X axis (CW, from +Y to +Z), in radians
public float getCutOffAngle()
Returns the cut-off angle of light source.
The angle is measured from the light direction axis to the light cut-off cone.
The angle lies in the range
The angle is measured from the light direction axis to the light cut-off cone.
The angle lies in the range
[0, PI/2]
radians,
where the angle of PI/2
corresponds to the lighting
of the half of the world's space.- Returns:
- the cut-off angle of light source, in radians
public void setCutOffAngle(double cutOffAngle)
Sets the cut-off angle of light source.
The angle is measured from the light direction axis to the light cut-off cone.
The angle must lie in the range
The angle is measured from the light direction axis to the light cut-off cone.
The angle must lie in the range
[0, PI/2]
radians,
where the angle of PI/2
corresponds to the lighting
of the half of the world's space.- Parameters:
cutOffAngle
- the cut-off angle in radians[0, PI/2]
public float getDropOffRate()
Returns the value of the exponent that is used to control how the light
intensity drops off from the center to the cut off angle. Default value
is zero.
- Returns:
- the value of the light intensity drop off exponent
public void setDropOffRate(double dropOffRate)
Sets the value of the exponent that can be used to control how the light
intensity drops off from the center to the cut off angle. By default a
value of zero is used, and provides an even light value from beginning
to edge.
- Parameters:
dropOffRate
- the value of the light intensity drop off exponent
public final Light3DSpot clone()
Description copied from class:
Light3D
Creates and returns a copy of this light (i.e. new light instance).
The returned light has the same type and parameters
The returned copy isn't automatically added to the group this light belongs to.
The clone is created in the context of the same agent
The returned light has the same type and parameters
The returned copy isn't automatically added to the group this light belongs to.
The clone is created in the context of the same agent
@AnyLogicInternalAPI public boolean updateDynamicPropertiesStructural(boolean publicOnly)
- Returns:
true
if update was done (usually for visible elements, respecting public flag etc.)
public Level getLevel()
Returns the level containing this shape.
The returned value is
null
for shapes in the experiments.@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
it may be removed/renamed in future. Please use
Level.add(Shape)
instead.- Specified by:
setLevel
in interfaceLevelElement
@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
This method restores owner of this object
The method is used in snapshot saving/loading
- Specified by:
restoreOwner
in interfacecom.anylogic.engine.internal.Child
- Parameters:
owner
- owner of this object, usuallyAgent
,Experiment
orShapeGroup
@AnyLogicInternalAPI @Deprecated public void setContextReference_xjal(Presentable contextReference)
Deprecated.