Caelum  0.6.4
Public Types | Static Public Member Functions | List of all members
Caelum::InternalUtilities Class Reference

Private caelum utilities. More...

#include <InternalUtilities.h>

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. More...
 
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. More...
 
static Ogre::CompositorPtr checkCompositorSupported (const Ogre::String &name)
 Fetch a compositor by name and check it can be loaded properly. More...
 
static void generateSphericDome (const Ogre::String &name, int segments, DomeType domeType)
 Creates a longitude-latitude sky dome. More...
 

Detailed Description

Private caelum utilities.

This class constains various tiny utilities for caelum to use.

Member Function Documentation

◆ getInterpolatedColour()

static 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
fxHorizontal coordinate.
fyVertical coordiate.
imgThe lookup image.
wrapXTo wrap the x coordinate.
Returns
The interpolated colour.

◆ checkLoadMaterialClone()

static 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
originalNameName of the original material.
cloneNameName of the result clone.
Returns
A pointer to an unique material.

◆ checkCompositorSupported()

static 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
nameName of the compositor to check.
Returns
A pointer to the compositor (can be ignored)

◆ generateSphericDome()

static 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
nameThe name of the mesh to be created.
segmentsThe number of sphere segments.
domeTypeThe type of dome to create.