Ogre Procedural  0.3.0 unstable
Procedural Geometry & Textures for Ogre3D
Static Public Member Functions | List of all members
Procedural::Utils Class Reference

Holds a bunch of static utility functions. More...

#include <ProceduralUtils.h>

Static Public Member Functions

static void log (const Ogre::String &st)
 Outputs something to the ogre log, with a [PROCEDURAL] prefix. More...
 
static Ogre::Vector3 min (const Ogre::Vector3 &v1, const Ogre::Vector3 &v2)
 Gets the min of the coordinates between 2 vectors. More...
 
static Ogre::Vector3 max (const Ogre::Vector3 &v1, const Ogre::Vector3 &v2)
 Gets the max of the coordinates between 2 vectors. More...
 
static Ogre::Vector2 min (const Ogre::Vector2 &v1, const Ogre::Vector2 &v2)
 Gets the min of the coordinates between 2 vectors. More...
 
static Ogre::Vector2 max (const Ogre::Vector2 &v1, const Ogre::Vector2 &v2)
 Gets the max of the coordinates between 2 vectors. More...
 
static Ogre::AxisAlignedBox AABBfromPoints (std::vector< Ogre::Vector3 > points)
 Builds an AABB from a list of points. More...
 
static std::string getName (const std::string &prefix="default")
 Generate a name from a prefix and a counter. More...
 
static Ogre::Vector3 vectorPermute (const Ogre::Vector3 &in)
 Shifts the components of the vector to the right. More...
 
static Ogre::Vector3 vectorAntiPermute (const Ogre::Vector3 &in)
 Shifts the components of the vector to the left. More...
 
static Ogre::Vector2 rotateVector2 (const Ogre::Vector2 &in, Ogre::Radian angle)
 
static int cap (int n, int min, int max)
 Caps n between min and max. More...
 
static int modulo (int n, int cap)
 An extend version of the standard modulo, in that int values are "wrapped" in both directions, whereas with standard modulo, (-1)%2 == -1 Always return an int between 0 and cap-1. More...
 
static Ogre::Radian angleBetween (const Ogre::Vector2 &v1, const Ogre::Vector2 &v2)
 Equivalent of Ogre::Vector3::angleBetween, applied to Ogre::Vector2. More...
 
static Ogre::Radian angleTo (const Ogre::Vector2 &v1, const Ogre::Vector2 &v2)
 Gives the oriented angle from v1 to v2 in the [0;2PI[ range. More...
 
static Ogre::Radian signedAngleTo (const Ogre::Vector2 &v1, const Ogre::Vector2 &v2)
 Gives the oriented angle from v1 to v2 in the ]-PI;PI] range. More...
 
static Ogre::Quaternion _computeQuaternion (const Ogre::Vector3 &direction, const Ogre::Vector3 &upVector=Ogre::Vector3::UNIT_Y)
 Computes a quaternion between UNIT_Z and direction. More...
 
static Ogre::Vector3 vec2ToVec3Y (const Ogre::Vector2 &pos)
 Maps a vector2 to vector3, with Y=0. More...
 
static unsigned int binom (unsigned int a, unsigned int b)
 binomial coefficients (a over b) More...
 
static Ogre::Vector2 reframe (const Ogre::RealRect &rect, const Ogre::Vector2 &input)
 Transforms an input vector expressed in the 0,0->1,1 rect towards another rect. More...
 

Detailed Description

Holds a bunch of static utility functions.

Member Function Documentation

◆ _computeQuaternion()

static Ogre::Quaternion Procedural::Utils::_computeQuaternion ( const Ogre::Vector3 direction,
const Ogre::Vector3 upVector = Ogre::Vector3::UNIT_Y 
)
static

Computes a quaternion between UNIT_Z and direction.

It keeps the "up" vector to UNIT_Y

◆ AABBfromPoints()

static Ogre::AxisAlignedBox Procedural::Utils::AABBfromPoints ( std::vector< Ogre::Vector3 points)
static

◆ angleBetween()

static Ogre::Radian Procedural::Utils::angleBetween ( const Ogre::Vector2 v1,
const Ogre::Vector2 v2 
)
static

◆ angleTo()

static Ogre::Radian Procedural::Utils::angleTo ( const Ogre::Vector2 v1,
const Ogre::Vector2 v2 
)
static

Gives the oriented angle from v1 to v2 in the [0;2PI[ range.

References Radian(), and Ogre::Math::TWO_PI.

◆ binom()

static unsigned int Procedural::Utils::binom ( unsigned int  a,
unsigned int  b 
)
static

binomial coefficients (a over b)

◆ cap()

static int Procedural::Utils::cap ( int  n,
int  min,
int  max 
)
static

◆ getName()

static std::string Procedural::Utils::getName ( const std::string &  prefix = "default")
static

Generate a name from a prefix and a counter.

Referenced by Procedural::MeshGenerator< TorusGenerator >::realizeMesh().

◆ log()

static void Procedural::Utils::log ( const Ogre::String st)
static

Outputs something to the ogre log, with a [PROCEDURAL] prefix.

◆ max() [1/2]

static Ogre::Vector2 Procedural::Utils::max ( const Ogre::Vector2 v1,
const Ogre::Vector2 v2 
)
static

Gets the max of the coordinates between 2 vectors.

◆ max() [2/2]

static Ogre::Vector3 Procedural::Utils::max ( const Ogre::Vector3 v1,
const Ogre::Vector3 v2 
)
static

Gets the max of the coordinates between 2 vectors.

◆ min() [1/2]

static Ogre::Vector2 Procedural::Utils::min ( const Ogre::Vector2 v1,
const Ogre::Vector2 v2 
)
static

Gets the min of the coordinates between 2 vectors.

◆ min() [2/2]

static Ogre::Vector3 Procedural::Utils::min ( const Ogre::Vector3 v1,
const Ogre::Vector3 v2 
)
static

Gets the min of the coordinates between 2 vectors.

◆ modulo()

static int Procedural::Utils::modulo ( int  n,
int  cap 
)
static

◆ reframe()

static Ogre::Vector2 Procedural::Utils::reframe ( const Ogre::RealRect rect,
const Ogre::Vector2 input 
)
static

Transforms an input vector expressed in the 0,0->1,1 rect towards another rect.

References TRect< Real >::height(), TRect< Real >::left, TRect< Real >::top, and TRect< Real >::width().

◆ rotateVector2()

static Ogre::Vector2 Procedural::Utils::rotateVector2 ( const Ogre::Vector2 in,
Ogre::Radian  angle 
)
static

◆ signedAngleTo()

static Ogre::Radian Procedural::Utils::signedAngleTo ( const Ogre::Vector2 v1,
const Ogre::Vector2 v2 
)
static

Gives the oriented angle from v1 to v2 in the ]-PI;PI] range.

◆ vec2ToVec3Y()

static Ogre::Vector3 Procedural::Utils::vec2ToVec3Y ( const Ogre::Vector2 pos)
static

Maps a vector2 to vector3, with Y=0.

◆ vectorAntiPermute()

static Ogre::Vector3 Procedural::Utils::vectorAntiPermute ( const Ogre::Vector3 in)
static

Shifts the components of the vector to the left.

◆ vectorPermute()

static Ogre::Vector3 Procedural::Utils::vectorPermute ( const Ogre::Vector3 in)
static

Shifts the components of the vector to the right.


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