public class SpotLight extends ShadowLight
Affects objects using MeshLambertMaterial
or MeshPhongMaterial
.
// white spotlight shining from the side, casting shadow
SpotLight spotLight = new SpotLight( 0xffffff );
spotLight.getPosition().set( 100, 1000, 100 );
spotLight.setCastShadow( true );
spotLight.setShadowMapWidth( 1024 );
spotLight.setShadowMapHeight( 1024 );
spotLight.setShadowCameraNear( 500 );
spotLight.setShadowCameraFar( 4000 );
spotLight.setShadowCameraFov( 30 );
getScene().add( spotLight );
Modifier and Type | Class and Description |
---|---|
static class |
SpotLight.UniformSport |
Light.UniformLight
Object3D.ObjectHandler, Object3D.Traverse
__webglActive, __webglInit, _modelViewMatrix, _normalMatrix, DefaultUp
Constructor and Description |
---|
SpotLight(int hex) |
SpotLight(int hex,
double intensity) |
SpotLight(int hex,
double intensity,
double distance,
double angle,
double exponent) |
Modifier and Type | Method and Description |
---|---|
double |
getAngle() |
double |
getDistance()
Gets the distance.
|
double |
getExponent() |
double |
getShadowCameraFov() |
void |
setAngle(double angle) |
void |
setDistance(double distance)
Sets the distance.
|
void |
setExponent(double exponent) |
void |
setShadowCameraFov(double shadowCameraFov) |
void |
setupRendererLights(RendererLights zlights,
boolean isGammaInput) |
getCameraHelper, getIntensity, getShadowBias, getShadowCamera, getShadowCameraFar, getShadowCameraNear, getShadowDarkness, getShadowMap, getShadowMapHeight, getShadowMapSize, getShadowMapWidth, getShadowMatrix, getTarget, isAllocateShadows, isOnlyShadow, isShadowCameraVisible, isShadowCascade, setCameraHelper, setIntensity, setOnlyShadow, setShadowBias, setShadowCamera, setShadowCameraFar, setShadowCameraNear, setShadowCameraVisible, setShadowCascade, setShadowDarkness, setShadowMap, setShadowMapHeight, setShadowMapSize, setShadowMapWidth, setShadowMatrix, setTarget
add, add, applyMatrix, clone, clone, clone, getChildren, getChildrenByClass, getId, getMatrix, getMatrixWorld, getName, getObjectById, getObjectByName, getParent, getPosition, getQuaternion, getRenderDepth, getRotation, getScale, getUp, getWorldDirection, getWorldDirection, getWorldPosition, getWorldPosition, getWorldQuaternion, getWorldQuaternion, getWorldRotation, getWorldRotation, getWorldScale, getWorldScale, isCastShadow, isFrustumCulled, isMatrixAutoUpdate, isMatrixWorldNeedsUpdate, isReceiveShadow, isRotationAutoUpdate, isVisible, localToWorld, lookAt, remove, remove, rotateOnAxis, rotateX, rotateY, rotateZ, setCastShadow, setChildren, setFrustumCulled, setHandler, setMatrix, setMatrixAutoUpdate, setMatrixWorld, setMatrixWorldNeedsUpdate, setName, setParent, setPosition, setQuaternion, setReceiveShadow, setRenderDepth, setRotation, setRotationAutoUpdate, setRotationFromAxisAngle, setRotationFromEuler, setRotationFromMatrix, setRotationFromQuaternion, setScale, setUp, setVisible, toString, translateOnAxis, translateX, translateY, translateZ, traverse, traverseVisible, updateMatrix, updateMatrixWorld, worldToLocal
public SpotLight(int hex)
public SpotLight(int hex, double intensity)
public SpotLight(int hex, double intensity, double distance, double angle, double exponent)
public double getDistance()
public void setDistance(double distance)
If non-zero, light will attenuate linearly from maximum intensity at light position down to zero at distance.
public double getExponent()
public void setExponent(double exponent)
public double getAngle()
public void setAngle(double angle)
public double getShadowCameraFov()
public void setShadowCameraFov(double shadowCameraFov)
public void setupRendererLights(RendererLights zlights, boolean isGammaInput)
setupRendererLights
in class Light