OSG implementation of a Cube Map Texture.
More...
#include <OsgTextureCubeMap.h>
|
| OsgTextureCubeMap () |
| Constructor. More...
|
|
void | setSize (int width, int height) override |
| Sets the size of the texture, which is the same for each face of the cube. More...
|
|
void | getSize (int *width, int *height) const override |
| Gets the size of the texture, which is the same for each face of the cube. More...
|
|
bool | loadImage (const std::string &filePath) override |
| Loads an image into the texture from a file. More...
|
|
bool | loadImageFaces (const std::string &negativeX, const std::string &positiveX, const std::string &negativeY, const std::string &positiveY, const std::string &negativeZ, const std::string &positiveZ) override |
| Loads images from files into the faces of the cube map. More...
|
|
osg::ref_ptr< osg::TextureCubeMap > | getOsgTextureCubeMap () const |
| Returns the osg::TextureCubeMap.
|
|
virtual void | clearImage () |
| Removes the image from the texture.
|
|
osg::ref_ptr< osg::Texture > | getOsgTexture () const |
| Returns the osg::Texture1D.
|
|
virtual | ~Texture () |
| Destructor.
|
|
void | setIsPointSprite (bool value) |
| Set point sprite flag on/off.
|
|
bool | isPointSprite () const |
| Get point sprite flag state.
|
|
|
osg::ref_ptr< osg::Image > | copyImageBlock (const osg::Image &source, size_t startColumn, size_t startRow, size_t width, size_t height) |
| Makes a copy of an image block. More...
|
|
| OsgTexture (osg::Texture *texture) |
| Constructor. More...
|
|
OSG implementation of a Cube Map Texture.
Wraps an osg::TextureCubeMap
§ OsgTextureCubeMap()
OsgTextureCubeMap::OsgTextureCubeMap |
( |
| ) |
|
Constructor.
- Postcondition
- No image is loaded in the texture.
§ copyImageBlock()
osg::ref_ptr< osg::Image > OsgTextureCubeMap::copyImageBlock |
( |
const osg::Image & |
source, |
|
|
size_t |
startColumn, |
|
|
size_t |
startRow, |
|
|
size_t |
width, |
|
|
size_t |
height |
|
) |
| |
|
protected |
Makes a copy of an image block.
- Parameters
-
source | Source image to copy from |
startColumn | First column of block in the source image |
startRow | First row of block in the source image |
width | Width of the block |
height | Height of the block |
- Returns
- Copy of the image block
§ getSize()
void OsgTextureCubeMap::getSize |
( |
int * |
width, |
|
|
int * |
height |
|
) |
| const |
|
overridevirtual |
Gets the size of the texture, which is the same for each face of the cube.
- Parameters
-
[out] | width | Width of the texture |
[out] | height | Height of the texture |
Implements SurgSim::Graphics::TextureCubeMap.
§ loadImage()
bool OsgTextureCubeMap::loadImage |
( |
const std::string & |
filePath | ) |
|
|
overridevirtual |
Loads an image into the texture from a file.
- Parameters
-
filePath | Path to the image file |
- Returns
- True if the image is successfully loaded, otherwise false
- Note
- The image should contain the cube map unwrapped such that each face is width/3 x height/4 and the corners for the faces are arranged as follows, with (0, 0) as the bottom-left corner and (width, height) as the top-right corner: (-Z): (width * 1/3, 0 ) to (width * 2/3, height * 1/4) (-Y): (width * 1/3, height * 1/4) to (width * 2/3, height * 1/2) (-X): (0, height * 1/2) to (width * 1/3, height * 3/4) (+Z): (width * 1/3, height * 1/2) to (width * 2/3, height * 3/4) (+X): (width * 2/3, height * 1/2) to (width, height * 3/4) (+Y): (width * 1/3, height * 3/4) to (width * 2/3, height )
Reimplemented from SurgSim::Graphics::OsgTexture.
§ loadImageFaces()
bool OsgTextureCubeMap::loadImageFaces |
( |
const std::string & |
negativeX, |
|
|
const std::string & |
positiveX, |
|
|
const std::string & |
negativeY, |
|
|
const std::string & |
positiveY, |
|
|
const std::string & |
negativeZ, |
|
|
const std::string & |
positiveZ |
|
) |
| |
|
overridevirtual |
Loads images from files into the faces of the cube map.
- Parameters
-
negativeX | Path to the image for the (-X) face |
positiveX | Path to the image for the (+X) face |
negativeY | Path to the image for the (-Y) face |
positiveY | Path to the image for the (+Y) face |
negativeZ | Path to the image for the (-Z) face |
positiveZ | Path to the image for the (+Z) face |
- Returns
- True if the image is successfully loaded, otherwise false
Implements SurgSim::Graphics::TextureCubeMap.
§ setSize()
void OsgTextureCubeMap::setSize |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
|
overridevirtual |
Sets the size of the texture, which is the same for each face of the cube.
- Parameters
-
width | Width of the texture |
height | Height of the texture |
- Note
- Use this to setup a texture as a render target rather than loading from file.
Implements SurgSim::Graphics::TextureCubeMap.
The documentation for this class was generated from the following files: