AnyLogic AnyLogic
Expand
Font size
All Implemented Interfaces:
com.anylogic.engine.internal.Child, AggregatableAnimationElement, HasLevel, LevelElement, SVGElement, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Light3D.StreetLight

public class Light3DPoint
extends Light3D
3D point light, may be added to 3D groups for scene lighting
Point source of light is located in one particular point of space. It shines uniformly in all directions.
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

Nested Class Summary

Nested classes/interfaces inherited from class com.anylogic.engine.presentation.Light3D

Light3D.CarHeadlight, Light3D.Daylight, Light3D.Moonlight, Light3D.StreetLight

Constructor Summary

Constructors 
Light3DPoint​(boolean ispublic, double x, double y, double z, double constantAttenuation, double linearAttenuation, double quadraticAttenuation, java.awt.Color diffuseColor, java.awt.Color specularColor, java.awt.Color ambientColor, boolean global)
Creates new 3D point light
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods 
Light3DPoint clone()
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
float getConstantAttenuation()
Returns the constant attenuation factor of the light
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
void restoreOwner​(java.lang.Object owner)
Deprecated.
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 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​(double constantAttenuation)
Sets the constant attenuation factor of the light
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 setLinearAttenuation​(double linearAttenuation)
Sets the linear attenuation factor of the light
void setPos​(double x, double y, double z)
Sets the light source position
void setQuadraticAttenuation​(double quadraticAttenuation)
Sets the quadratic attenuation factor of the light
void setX​(double x)
Sets the x coordinate of the light source position
void setY​(double y)
Sets the y coordinate of the light source position
void setZ​(double z)
Sets the z coordinate of the light source position
boolean updateDynamicPropertiesStructural​(boolean publicOnly)  
Modifier and Type Method Description

Methods inherited from class com.anylogic.engine.presentation.Light3D

executeUserAction, findSVGElement, getAmbientColor, getDiffuseColor, getGroup, getName, getPresentable, getSpecularColor, getSVGId, isEnabled, isGlobal, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setAmbientColor, setDiffuseColor, setEnabled, setGlobal, setSpecularColor, update, updateSVGProperties

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

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

initializeInternal, postInitialize

Constructor Detail

Light3DPoint

public Light3DPoint​(boolean ispublic,
                    double x,
                    double y,
                    double z,
                    double constantAttenuation,
                    double linearAttenuation,
                    double quadraticAttenuation,
                    java.awt.Color diffuseColor,
                    java.awt.Color specularColor,
                    java.awt.Color ambientColor,
                    boolean global)
Creates new 3D point light
Parameters:
ispublic - if true, the light persists on container's presentation
x - the x coordinate of light source location
y - the y coordinate of light source location
z - the z coordinate of light source location
constantAttenuation - the constant attenuation factor
linearAttenuation - the linear attenuation factor
quadraticAttenuation - the quadraticAttenuation attenuation factor
diffuseColor - the diffuse color component
specularColor - the specular color component
ambientColor - the ambient color component
global - if true, the light affects shapes outside the group the light is placed in

Method Detail

getX

public float getX()
Returns the x coordinate of the light source position
Returns:
the x coordinate of the light source position

setX

public void setX​(double x)
Sets the x coordinate of the light source position
Parameters:
x - the x coordinate of the light source position

getY

public float getY()
Returns the y coordinate of the light source position
Returns:
the y coordinate of the light source position

setY

public void setY​(double y)
Sets the y coordinate of the light source position
Parameters:
y - the y coordinate of the light source position

getZ

public float getZ()
Returns the z coordinate of the light source position
Returns:
the z coordinate of the light source position

setZ

public void setZ​(double z)
Sets the z coordinate of the light source position
Parameters:
z - the z coordinate of the light source position

setPos

public void setPos​(double x,
                   double y,
                   double z)
Sets the light source position
Parameters:
x - the x coordinate of the light source position
y - the y coordinate of the light source position
z - the z coordinate of the light source position

getConstantAttenuation

public float getConstantAttenuation()
Returns the constant attenuation factor of the light
Returns:
the constant attenuation factor of the light

setConstantAttenuation

public void setConstantAttenuation​(double constantAttenuation)
Sets the constant attenuation factor of the light
Parameters:
constantAttenuation - the constant attenuation factor of the light

getLinearAttenuation

public float getLinearAttenuation()
Returns the linear attenuation factor of the light
Returns:
the linear attenuation factor of the light

setLinearAttenuation

public void setLinearAttenuation​(double linearAttenuation)
Sets the linear attenuation factor of the light
Parameters:
linearAttenuation - the linear attenuation factor of the light

getQuadraticAttenuation

public float getQuadraticAttenuation()
Returns the quadratic attenuation factor of the light
Returns:
the quadratic attenuation factor of the light

setQuadraticAttenuation

public void setQuadraticAttenuation​(double quadraticAttenuation)
Sets the quadratic attenuation factor of the light
Parameters:
quadraticAttenuation - the quadratic attenuation factor of the light

setAttenuation

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

clone

public final Light3DPoint 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
Overrides:
clone in class Light3D

updateDynamicPropertiesStructural

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

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?