Caelum::InternalUtilities Class Reference

Private caelum utilities. More...

#include <InternalUtilities.h>

List of all members.

Public Types

enum  DomeType { DT_SKY_DOME, DT_IMAGE_STARFIELD }
 Enumeration of types of sky domes.

Static Public Member Functions

static Ogre::ColourValue getInterpolatedColour (float fx, float fy, Ogre::Image *img, bool wrapX=true)
 Gets the interpolated colour between two pixels from an image.
static const Ogre::String pointerToString (void *pointer)
 Quickly format a pointer as a string; in hex.
static Ogre::MaterialPtr checkLoadMaterialClone (const Ogre::String &originalName, const Ogre::String &cloneName)
 Creates a private clone of a material from a script.
static Ogre::CompositorPtr checkCompositorSupported (const Ogre::String &name)
 Fetch a compositor by name and check it can be loaded properly.
static void generateSphericDome (const Ogre::String &name, int segments, DomeType domeType)
 Creates a longitude-latitude sky dome.


Detailed Description

Private caelum utilities.

This class constains various tiny utilities for caelum to use.

Definition at line 33 of file InternalUtilities.h.


Member Function Documentation

Ogre::ColourValue Caelum::InternalUtilities::getInterpolatedColour ( float  fx,
float  fy,
Ogre::Image *  img,
bool  wrapX = true 
) [static]

Gets the interpolated colour between two pixels from an image.

Interpolate a texture pixel by hand. (fx, fy) are in texture coordinates, ranging [0-1] across the entire texture. Smooth blending is only done on the x coordinate. Wrapping is only supported on X as well.

Parameters:
fx Horizontal coordinate.
fy Vertical coordiate.
img The lookup image.
wrapX To wrap the x coordinate.
Returns:
The interpolated colour.

Definition at line 28 of file InternalUtilities.cpp.

Referenced by Caelum::CaelumSystem::getFogColour(), Caelum::CaelumSystem::getFogDensity(), Caelum::CaelumSystem::getMoonLightColour(), Caelum::CaelumSystem::getSunLightColour(), Caelum::CaelumSystem::getSunSphereColour(), and Caelum::FlatCloudLayer::setCloudCover().

Ogre::MaterialPtr Caelum::InternalUtilities::checkLoadMaterialClone ( const Ogre::String &  originalName,
const Ogre::String &  cloneName 
) [static]

Creates a private clone of a material from a script.

When a class wants to modify a material at runtime it must not modify the original material loaded from scripts. Instead it should create a clone and use that.

This method throws a Caelum::UnsupportedException on failure.

Parameters:
originalName Name of the original material.
cloneName Name of the result clone.
Returns:
A pointer to an unique material.

Definition at line 82 of file InternalUtilities.cpp.

Referenced by Caelum::GroundFog::GroundFog(), Caelum::ImageStarfield::ImageStarfield(), Caelum::Moon::Moon(), Caelum::PointStarfield::PointStarfield(), Caelum::SkyDome::SkyDome(), Caelum::SphereSun::SphereSun(), and Caelum::SpriteSun::SpriteSun().

Ogre::CompositorPtr Caelum::InternalUtilities::checkCompositorSupported ( const Ogre::String &  name  )  [static]

Fetch a compositor by name and check it can be loaded properly.

This method throws a Caelum::UnsupportedException on failure.

Parameters:
name Name of the compositor to check.
Returns:
A pointer to the compositor (can be ignored)

Definition at line 107 of file InternalUtilities.cpp.

void Caelum::InternalUtilities::generateSphericDome ( const Ogre::String &  name,
int  segments,
DomeType  domeType 
) [static]

Creates a longitude-latitude sky dome.

Note:
Does nothing if the sphere already exists.
Parameters:
name The name of the mesh to be created.
segments The number of sphere segments.
domeType The type of dome to create.

Definition at line 127 of file InternalUtilities.cpp.

Referenced by Caelum::ImageStarfield::ImageStarfield(), and Caelum::SkyDome::SkyDome().


The documentation for this class was generated from the following files:

Generated on Sun Aug 9 10:24:22 2009 for Caelum by  doxygen 1.5.9