|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xj.anylogic.engine.presentation.Light3D
com.xj.anylogic.engine.presentation.Light3DSpot
public class Light3DSpot
3D spot light, may be added to 3D groups for scene lighting
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.
Light3D,
Serialized Form| Constructor Summary | |
|---|---|
Light3DSpot(boolean ispublic,
double x,
double y,
double z,
double angleX,
double angleZ,
double cutOffAngle,
double dropOffRate,
double constantAttenuation,
double linearAttenuation,
double quadraticAttenuation,
java.awt.Color diffuseColor,
java.awt.Color specularColor,
java.awt.Color ambientColor,
boolean global)
Creates new 3D spot light |
|
| Method Summary | |
|---|---|
Light3DSpot |
clone()
Creates and returns a copy of this light (i.e. new light instance). |
Element3D_xjal |
get3DElement_xjal()
This method is internal and shouldn't be accessed by user. |
float |
getAngleX()
Returns the orientation of the light around X axis (CW, from +Y to +Z). |
float |
getAngleZ()
Returns the orientation of the light around Z axis (CW, from +X to +Y). |
float |
getConstantAttenuation()
Returns the constant attenuation factor of the light |
float |
getCutOffAngle()
Returns the cut-off angle of light source. |
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. |
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()
Retunrs 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)
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 |
setAngleX(double angleX)
Sets the orientation of the light around X axis (CW, from +Y to +Z). |
void |
setAngleZ(double angleZ)
Sets the orientation of the light around Z axis (CW, from +X to +Y). |
void |
setAttenuation(double constantAttenuation,
double linearAttenuation,
double quadraticAttenuation)
Sets the attenuation factors of the light fading with the distance. |
void |
setConstantAttenuation(double constantAttenuation)
Sets the constant attenuation factor of the light |
void |
setContextReference_xjal(Presentable contextReference)
This method is internal and shouldn't be accessed by user. |
void |
setCutOffAngle(double cutOffAngle)
Sets the cut-off angle of light source. |
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. |
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 |
| Methods inherited from class com.xj.anylogic.engine.presentation.Light3D |
|---|
getAmbientColor, getDiffuseColor, getGroup, getName, getPresentable, getSpecularColor, isEnabled, isGlobal, setAmbientColor, setDiffuseColor, setEnabled, setGlobal, setSpecularColor, update |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Light3DSpot(boolean ispublic,
double x,
double y,
double z,
double angleX,
double angleZ,
double cutOffAngle,
double dropOffRate,
double constantAttenuation,
double linearAttenuation,
double quadraticAttenuation,
java.awt.Color diffuseColor,
java.awt.Color specularColor,
java.awt.Color ambientColor,
boolean global)
ispublic - if true, 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 - if true, the light affects shapes outside the group
the light is placed in| Method Detail |
|---|
public float getX()
public void setX(double x)
x - the x coordinate of the light source positionpublic float getY()
public void setY(double y)
y - the y coordinate of the light source positionpublic float getZ()
public void setZ(double z)
z - the z coordinate of the light source position
public void setPos(double x,
double y,
double z)
x - the x coordinate of the light source positiony - the y coordinate of the light source positionz - the z coordinate of the light source positionpublic float getConstantAttenuation()
public void setConstantAttenuation(double constantAttenuation)
constantAttenuation - the constant attenuation factor of the lightpublic float getLinearAttenuation()
public void setLinearAttenuation(double linearAttenuation)
linearAttenuation - the linear attenuation factor of the lightpublic float getQuadraticAttenuation()
public void setQuadraticAttenuation(double quadraticAttenuation)
quadraticAttenuation - the quadratic attenuation factor of the light
public void setAttenuation(double constantAttenuation,
double linearAttenuation,
double quadraticAttenuation)
d is a distance from the light source):attenuation factor = 1 / (kC + kLd + kQd2)
constantAttenuation - constant attenuation factor: kClinearAttenuation - linear attenuation factor: kLquadraticAttenuation - quadratic attenuation factor: kQpublic float getAngleZ()
public void setAngleZ(double angleZ)
angleZ - the new value of orientation around Z axis (CW, from +X to +Y),
in radianspublic float getAngleX()
public void setAngleX(double angleX)
angleX - the new value of orientation around X axis (CW, from +Y to +Z),
in radianspublic float getCutOffAngle()
[0, PI/2] radians,
where the angle of PI/2 corresponds to the lighting
of the half of the world's space.
public void setCutOffAngle(double cutOffAngle)
[0, PI/2] radians,
where the angle of PI/2 corresponds to the lighting
of the half of the world's space.
cutOffAngle - the cut-off angle in radians [0, PI/2]public float getDropOffRate()
public void setDropOffRate(double dropOffRate)
dropOffRate - the value of the light intensity drop off exponentpublic final Light3DSpot clone()
Light3D
clone in class Light3Dpublic final void restoreOwner(java.lang.Object owner)
restoreOwner in interface com.xj.anylogic.engine.internal.Childowner - owner of this object, usually ActiveObject,
Experiment or
ShapeGrouppublic void setContextReference_xjal(Presentable contextReference)
com.xj.anylogic.engine.internal.presentation.WorldObject3D_xjal
setContextReference_xjal in interface com.xj.anylogic.engine.internal.presentation.WorldObject3D_xjalpublic void set3DElement_xjal(Element3D_xjal element3D)
com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal
set3DElement_xjal in interface com.xj.anylogic.engine.internal.presentation.Accessor3D_xjalpublic Element3D_xjal get3DElement_xjal()
com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal
get3DElement_xjal in interface com.xj.anylogic.engine.internal.presentation.Accessor3D_xjal
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||