Class LightProbe
- Direct Known Subclasses:
- EnvironmentProbeControl
LightProbeFactory.makeProbe(com.jme3.environment.EnvironmentCamera, com.jme3.scene.Spatial)
 and EnvironmentCamera.
 The light probe has an area of effect centered on its position. It can have a Spherical area or an Oriented Box area
 A LightProbe will only be taken into account when it's marked as ready and enabled.
 A light probe is ready when it has valid environment map data set.
 Note that you should never call setReady yourself.- See Also:
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class com.jme3.light.LightLight.Type
- 
Field SummaryFieldsFields inherited from class com.jme3.light.Lightcolor, enabled, lastDistance, name
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidcomputeLastDistance(Spatial owner) Used internally to compute the last distance value.getArea()Deprecated.intReturns the position of the LightProbe in world spacereturns the prefiltered environment map texture of this light probe Note that this Texture may not have image data yet if the LightProbe is not readyVector3f[]getType()Returns the light typeReturns the data to send to the shader.booleanintersectsBox(BoundingBox box, TempVars vars) Determines if the light intersects with the given bounding box.booleanintersectsFrustum(Camera camera, TempVars vars) Determines if the light intersects with the given camera frustum.booleanintersectsSphere(BoundingSphere sphere, TempVars vars) Determines if the light intersects with the given bounding sphere.booleanisReady()return true if the LightProbe is ready, meaning the Environment maps have been loaded or rendered and are ready to be used by a materialvoidread(JmeImporter im) voidvoidsetNbMipMaps(int nbMipMaps) voidsetPosition(Vector3f position) Sets the position of the LightProbe in world spacevoidsetPrefilteredMap(TextureCubeMap prefilteredEnvMap) Sets the prefiltered environment mapvoidsetReady(boolean ready) Don't call this method directly.voidsetShCoeffs(Vector3f[] shCoefficients) toString()voidwrite(JmeExporter ex) Methods inherited from class com.jme3.light.Lightclone, getColor, getName, isEnabled, isFrustumCheckNeeded, isIntersectsFrustum, setColor, setEnabled, setFrustumCheckNeeded, setIntersectsFrustum, setName
- 
Field Details- 
FALLBACK_MATRIX
 
- 
- 
Constructor Details- 
LightProbepublic LightProbe()Empty constructor used for serialization. You should never call it, useLightProbeFactory.makeProbe(com.jme3.environment.EnvironmentCamera, com.jme3.scene.Spatial)instead.
 
- 
- 
Method Details- 
getPrefilteredEnvMapreturns the prefiltered environment map texture of this light probe Note that this Texture may not have image data yet if the LightProbe is not ready- Returns:
- the prefiltered environment map
 
- 
setPrefilteredMapSets the prefiltered environment map- Parameters:
- prefilteredEnvMap- the prefiltered environment map
 
- 
getUniformMatrixReturns the data to send to the shader. This is a column major matrix that is not a classic transform matrix, it's laid out in a particular way // 3x3 rot mat| // 0 1 2 | 3 // 0 | ax bx cx | px | ) // 1 | ay by cy | py | probe position // 2 | az bz cz | pz | ) // --|----------| // 3 | sx sy sz sp | 1/probe radius + nbMipMaps // --scale--(ax, ay, az) is the pitch rotation axis (bx, by, bz) is the yaw rotation axis (cx, cy, cz) is the roll rotation axis Like in a standard 3x3 rotation matrix. It's also the valid rotation matrix of the probe in world space. Note that for the Spherical Probe area this part is a 3x3 identity matrix. (px, py, pz) is the position of the center of the probe in world space Like in a valid 4x4 transform matrix. (sx, sy, sy) is the extent of the probe ( the scale ) In a standard transform matrix, the scale is applied to the rotation matrix part. In the shader, we need the rotation and the scale to be separated. Doing so avoids extracting the scale from a classic transform matrix in the shader. (sp) is a special entry, it contains the packed number of mip maps of the probe and the inverse radius for the probe. since the inverse radius in lower than 1, it's packed in the decimal part of the float. The number of mip maps is packed in the integer part of the float. (ie: for 6 mip maps and a radius of 3, sp= 6.3333333) The radius is obvious for a SphereProbeArea, but in the case of an OrientedBoxProbeArea it's the max of the extent vector's components. - Returns:
- the pre-existing matrix
 
- 
write- Specified by:
- writein interface- Savable
- Overrides:
- writein class- Light
- Throws:
- IOException
 
- 
read- Specified by:
- readin interface- Savable
- Overrides:
- readin class- Light
- Throws:
- IOException
 
- 
getBoundsDeprecated.usegetArea()returns the bounding volume of this LightProbe- Returns:
- a bounding volume.
 
- 
getArea
- 
setAreaType
- 
getAreaType
- 
isReadypublic boolean isReady()return true if the LightProbe is ready, meaning the Environment maps have been loaded or rendered and are ready to be used by a material- Returns:
- the LightProbe ready state
 
- 
setReadypublic void setReady(boolean ready) Don't call this method directly. It's meant to be called by additional systems that will load or render the Environment maps of the LightProbe- Parameters:
- ready- the ready state of the LightProbe.
 
- 
getShCoeffs
- 
setShCoeffs
- 
getPositionReturns the position of the LightProbe in world space- Returns:
- the world-space position
 
- 
setPositionSets the position of the LightProbe in world space- Parameters:
- position- the world-space position
 
- 
getNbMipMapspublic int getNbMipMaps()
- 
setNbMipMapspublic void setNbMipMaps(int nbMipMaps) 
- 
intersectsBoxDescription copied from class:LightDetermines if the light intersects with the given bounding box.For non-local lights, such as directional lights,ambient lights, orpoint lightswithout influence radius, this method should always return true.- Specified by:
- intersectsBoxin class- Light
- Parameters:
- box- The box to check intersection against.
- vars- TempVars in case it is needed.
- Returns:
- True if the light intersects the box, false otherwise.
 
- 
intersectsFrustumDescription copied from class:LightDetermines if the light intersects with the given camera frustum. For non-local lights, such asdirectional lights,ambient lights, orpoint lightswithout influence radius, this method should always return true.- Specified by:
- intersectsFrustumin class- Light
- Parameters:
- camera- The camera frustum to check intersection against.
- vars- TempVars in case it is needed.
- Returns:
- True if the light intersects the frustum, false otherwise.
 
- 
intersectsSphereDescription copied from class:LightDetermines if the light intersects with the given bounding sphere.For non-local lights, such as directional lights,ambient lights, orpoint lightswithout influence radius, this method should always return true.- Specified by:
- intersectsSpherein class- Light
- Parameters:
- sphere- The sphere to check intersection against.
- vars- TempVars in case it is needed.
- Returns:
- True if the light intersects the sphere, false otherwise.
 
- 
computeLastDistanceDescription copied from class:LightUsed internally to compute the last distance value.- Specified by:
- computeLastDistancein class- Light
- Parameters:
- owner- the Spatial whose distance is to be determined
 
- 
getTypeDescription copied from class:LightReturns the light type
- 
toString
 
- 
getArea()