Package com.jme3.environment.util
Class CubeMapWrapper
java.lang.Object
com.jme3.environment.util.CubeMapWrapper
Wraps a cube map and allows reading or writing pixels.
It uses the ImageRaster class to tailor the read/write operations.
-
Constructor Summary
ConstructorsConstructorDescriptionCubeMapWrapper(TextureCubeMap cubeMap) Creates a CubeMapWrapper for the given cube map Note that the cube map must be initialized, and the mipmaps sizes should be set if relevant for them to be readable/writable -
Method Summary
Modifier and TypeMethodDescriptionReads a pixel from the cube map given the 2D coordinates and the face and the mip level to read fromReads a pixel from the cube map given the 2D coordinates and the face to read fromReads a pixel from the cube map given the coordinate vectorReads a pixel from the cube map given the coordinate vectorvoidinitMipMaps(int nbMipMaps) Inits the mip maps of a cube map with the given number of mip mapsvoidWrites a pixel given the 2-D coordinates, the mip level and the colorvoidWrites a pixel given the 2-D coordinates and the colorvoidwrites a pixel given the coordinates vector, the mip level and the color.voidwrites a pixel given the coordinates vector and the color.
-
Constructor Details
-
CubeMapWrapper
Creates a CubeMapWrapper for the given cube map Note that the cube map must be initialized, and the mipmaps sizes should be set if relevant for them to be readable/writable- Parameters:
cubeMap- the cubemap to wrap.
-
-
Method Details
-
getPixel
Reads a pixel from the cube map given the coordinate vector- Parameters:
vector- the direction vector to fetch the texelstore- the color in which to store the pixel color read.- Returns:
- the color of the pixel read.
-
getPixel
Reads a pixel from the cube map given the coordinate vector- Parameters:
vector- the direction vector to fetch the texelmipLevel- the mip level to read fromstore- the color in which to store the pixel color read.- Returns:
- the color of the pixel read.
-
getPixel
Reads a pixel from the cube map given the 2D coordinates and the face to read from- Parameters:
x- the x tex coordinate (from 0 to width)y- the y tex coordinate (from 0 to height)face- the face to read fromstore- the color where the result is stored.- Returns:
- the color read.
-
getPixel
Reads a pixel from the cube map given the 2D coordinates and the face and the mip level to read from- Parameters:
x- the x tex coordinate (from 0 to width)y- the y tex coordinate (from 0 to height)face- the face to read frommipLevel- the miplevel to read fromstore- the color where the result is stored.- Returns:
- the color read.
-
setPixel
writes a pixel given the coordinates vector and the color.- Parameters:
vector- the coordinates where to write the pixelcolor- the color to write
-
setPixel
writes a pixel given the coordinates vector, the mip level and the color.- Parameters:
vector- the coordinates where to write the pixelmipLevel- the miplevel to write tocolor- the color to write
-
setPixel
Writes a pixel given the 2-D coordinates and the color- Parameters:
x- the x tex coord (from 0 to width)y- the y tex coord (from 0 to height)face- the face to write tocolor- the color to write
-
setPixel
Writes a pixel given the 2-D coordinates, the mip level and the color- Parameters:
x- the x tex coord (from 0 to width)y- the y tex coord (from 0 to height)face- the face to write tomipLevel- the mip level to write tocolor- the color to write
-
initMipMaps
public void initMipMaps(int nbMipMaps) Inits the mip maps of a cube map with the given number of mip maps- Parameters:
nbMipMaps- the number of mip maps to initialize
-