Ogre Procedural
0.3.0 unstable
Procedural Geometry & Textures for Ogre3D
|
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... | |
Holds a bunch of static utility functions.
|
static |
Computes a quaternion between UNIT_Z and direction.
It keeps the "up" vector to UNIT_Y
|
static |
Builds an AABB from a list of points.
References Ogre::AxisAlignedBox::getMaximum(), Ogre::AxisAlignedBox::getMinimum(), Ogre::AxisAlignedBox::setMaximum(), and Ogre::AxisAlignedBox::setMinimum().
|
static |
Equivalent of Ogre::Vector3::angleBetween, applied to Ogre::Vector2.
References Ogre::Math::ACos(), Ogre::Math::Clamp(), Vector< 2, Real >::dotProduct(), and Vector< 2, Real >::length().
|
static |
Gives the oriented angle from v1 to v2 in the [0;2PI[ range.
References Radian(), and Ogre::Math::TWO_PI.
|
static |
binomial coefficients (a over b)
|
static |
Caps n between min and max.
Referenced by Procedural::Shape::getBoundedIndex(), Procedural::Path::getPoint(), Procedural::CatmullRomSpline3::safeGetPoint(), Procedural::CubicHermiteSpline2::safeGetPoint(), Procedural::CatmullRomSpline2::safeGetPoint(), Procedural::CubicHermiteSpline3::safeGetPoint(), Procedural::KochanekBartelsSpline2::safeGetPoint(), Procedural::RoundedCornerSpline3::safeGetPoint(), Procedural::BezierCurve3::safeGetPoint(), Procedural::RoundedCornerSpline2::safeGetPoint(), and Procedural::BezierCurve2::safeGetPoint().
|
static |
Generate a name from a prefix and a counter.
Referenced by Procedural::MeshGenerator< TorusGenerator >::realizeMesh().
|
static |
Outputs something to the ogre log, with a [PROCEDURAL] prefix.
|
static |
Gets the max of the coordinates between 2 vectors.
|
static |
Gets the max of the coordinates between 2 vectors.
|
static |
Gets the min of the coordinates between 2 vectors.
|
static |
Gets the min of the coordinates between 2 vectors.
|
static |
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.
Referenced by Procedural::Shape::getBoundedIndex(), Procedural::Path::getPoint(), Procedural::CatmullRomSpline3::safeGetPoint(), Procedural::CubicHermiteSpline2::safeGetPoint(), Procedural::CatmullRomSpline2::safeGetPoint(), Procedural::CubicHermiteSpline3::safeGetPoint(), Procedural::KochanekBartelsSpline2::safeGetPoint(), Procedural::RoundedCornerSpline3::safeGetPoint(), Procedural::BezierCurve3::safeGetPoint(), Procedural::RoundedCornerSpline2::safeGetPoint(), and Procedural::BezierCurve2::safeGetPoint().
|
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().
|
static |
References Ogre::Math::Cos(), and Ogre::Math::Sin().
|
static |
Gives the oriented angle from v1 to v2 in the ]-PI;PI] range.
|
static |
Maps a vector2 to vector3, with Y=0.
|
static |
Shifts the components of the vector to the left.
|
static |
Shifts the components of the vector to the right.