OSG implementation of a Cube Map Texture.
More...
#include <SurgSim/Graphics/OsgTextureCubeMap.h>
|
| OsgTextureCubeMap () |
| Constructor. More...
|
|
virtual void | setSize (int width, int height) |
| Sets the size of the texture. More...
|
|
virtual void | getSize (int *width, int *height) const |
| Gets the size of the texture. More...
|
|
virtual bool | loadImage (const std::string &filePath) |
| Loads an image into the texture from a file. More...
|
|
virtual 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) |
| Loads images from files into the faces of the cube map. More...
|
|
osg::ref_ptr< osg::TextureCubeMap > | getOsgTextureCubeMap () const |
| Returns the osg::TextureCubeMap. More...
|
|
virtual void | clearImage () |
| Removes the image from the texture. More...
|
|
osg::ref_ptr< osg::Texture > | getOsgTexture () const |
| Returns the osg::Texture1D. More...
|
|
virtual | ~Texture () |
| Destructor. More...
|
|
|
osg::ref_ptr< osg::Image > | copyImageBlock (const osg::Image &source, int column, int row, int width, int 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 |
( |
| ) |
|
Constructor.
- Postcondition
- No image is loaded in the texture.
osg::ref_ptr< osg::Image > OsgTextureCubeMap::copyImageBlock |
( |
const osg::Image & |
source, |
|
|
int |
column, |
|
|
int |
row, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
protected |
Makes a copy of an image block.
- Parameters
-
source | Source image to copy from |
column | First column of block in the source image |
row | First row of block in the source image |
width | Width of the block |
height | Height of the block |
- Returns
- Copy of the image block
osg::ref_ptr<osg::TextureCubeMap> SurgSim::Graphics::OsgTextureCubeMap::getOsgTextureCubeMap |
( |
| ) |
const |
|
inline |
Returns the osg::TextureCubeMap.
void OsgTextureCubeMap::getSize |
( |
int * |
width, |
|
|
int * |
height |
|
) |
| const |
|
virtual |
Gets the size of the texture.
- Parameters
-
[out] | width | Width of the texture |
[out] | height | Height of the texture |
bool OsgTextureCubeMap::loadImage |
( |
const std::string & |
filePath | ) |
|
|
virtual |
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.
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 |
|
) |
| |
|
virtual |
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
void OsgTextureCubeMap::setSize |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
|
virtual |
Sets the size of the texture.
- 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.
The documentation for this class was generated from the following files: