|
Ogre Procedural
0.3.0 unstable
Procedural Geometry & Textures for Ogre3D
|
Represents a curve by interpolating between a list of key/values. More...
#include <ProceduralTrack.h>
Public Types | |
| enum | AddressingMode { AM_ABSOLUTE_LINEIC, AM_RELATIVE_LINEIC, AM_POINT } |
| Defines addressing mode for the track ABSOLUTE_LINEIC : use the distance from the start of the principal curve RELATIVE_LINEIC : use the relative distance from the start of the principal curve, considering the total length of main curve is 1. More... | |
Public Member Functions | |
| Track (AddressingMode addressingMode=AM_RELATIVE_LINEIC, bool insertPoint=true) | |
| Default constructor. More... | |
| AddressingMode | getAddressingMode () const |
| Gets addressing mode of the curve. More... | |
| Track & | addKeyFrame (Ogre::Real pos, Ogre::Real value) |
| Inserts a new Key/Value couple anywhere on the track (it is auto-sorted anyway) More... | |
| bool | isInsertPoint () const |
| Tells whether we should add new points to principal curve if a key is defined here but not on principal curve. More... | |
| Ogre::Real | getValue (Ogre::Real absPos, Ogre::Real relPos, unsigned int index) const |
| Gets the value on the current point, taking into account the addressing mode. More... | |
| Ogre::Real | getValue (Ogre::Real pos) const |
| Gets the value on the current point. More... | |
| std::map< Ogre::Real, Ogre::Real >::const_iterator | _getKeyValueBefore (Ogre::Real absPos, Ogre::Real relPos, unsigned int index) const |
| Get the key value couple before current point, taking into account addressing mode. More... | |
| std::map< Ogre::Real, Ogre::Real >::const_iterator | _getKeyValueBefore (Ogre::Real pos) const |
| Get the key value couple before current point. More... | |
| std::map< Ogre::Real, Ogre::Real >::const_iterator | _getKeyValueAfter (Ogre::Real absPos, Ogre::Real relPos, unsigned int index) const |
| Get the key value couple after current point, taking into account addressing mode. More... | |
| std::map< Ogre::Real, Ogre::Real >::const_iterator | _getKeyValueAfter (Ogre::Real pos) const |
| Get the key value couple after current point. More... | |
| Ogre::Real | getFirstValue () const |
| Gets the first value in the track. More... | |
| Ogre::Real | getLastValue () const |
| Gets the last value in the track. More... | |
Protected Attributes | |
| AddressingMode | mAddressingMode |
| Adressing mode of the track (see the enum definition for more details) More... | |
| bool | mInsertPoint |
| Tells whether we should add new points to principal curve if a key is defined here but not on principal curve. More... | |
| std::map< Ogre::Real, Ogre::Real > | mKeyFrames |
| Key frames. More... | |
Represents a curve by interpolating between a list of key/values.
It always refers to a "principal" curve (a path, atm), so the keys to either its point index or lineic position.
Defines addressing mode for the track ABSOLUTE_LINEIC : use the distance from the start of the principal curve RELATIVE_LINEIC : use the relative distance from the start of the principal curve, considering the total length of main curve is 1.
POINT : right on the principal curve's key
| Enumerator | |
|---|---|
| AM_ABSOLUTE_LINEIC | |
| AM_RELATIVE_LINEIC | |
| AM_POINT | |
| Procedural::Track::Track | ( | AddressingMode | addressingMode = AM_RELATIVE_LINEIC, |
| bool | insertPoint = true |
||
| ) |
Default constructor.
Point insertion default to true, and addressing to relative lineic
| std::map<Ogre::Real, Ogre::Real>::const_iterator Procedural::Track::_getKeyValueAfter | ( | Ogre::Real | absPos, |
| Ogre::Real | relPos, | ||
| unsigned int | index | ||
| ) | const |
Get the key value couple after current point, taking into account addressing mode.
If current point is above maximum key, issues maximum key/value
| std::map<Ogre::Real, Ogre::Real>::const_iterator Procedural::Track::_getKeyValueAfter | ( | Ogre::Real | pos | ) | const |
Get the key value couple after current point.
If current point is above maximum key, issues maximum key/value
| std::map<Ogre::Real, Ogre::Real>::const_iterator Procedural::Track::_getKeyValueBefore | ( | Ogre::Real | absPos, |
| Ogre::Real | relPos, | ||
| unsigned int | index | ||
| ) | const |
Get the key value couple before current point, taking into account addressing mode.
If current point is below minimum key, issues minimum key
| std::map<Ogre::Real, Ogre::Real>::const_iterator Procedural::Track::_getKeyValueBefore | ( | Ogre::Real | pos | ) | const |
Get the key value couple before current point.
If current point is below minimum key, issues minimum key/value
| Track& Procedural::Track::addKeyFrame | ( | Ogre::Real | pos, |
| Ogre::Real | value | ||
| ) |
Inserts a new Key/Value couple anywhere on the track (it is auto-sorted anyway)
References value.
| AddressingMode Procedural::Track::getAddressingMode | ( | ) | const |
Gets addressing mode of the curve.
| Ogre::Real Procedural::Track::getFirstValue | ( | ) | const |
Gets the first value in the track.
| Ogre::Real Procedural::Track::getLastValue | ( | ) | const |
Gets the last value in the track.
| Ogre::Real Procedural::Track::getValue | ( | Ogre::Real | absPos, |
| Ogre::Real | relPos, | ||
| unsigned int | index | ||
| ) | const |
Gets the value on the current point, taking into account the addressing mode.
| Ogre::Real Procedural::Track::getValue | ( | Ogre::Real | pos | ) | const |
Gets the value on the current point.
| bool Procedural::Track::isInsertPoint | ( | ) | const |
Tells whether we should add new points to principal curve if a key is defined here but not on principal curve.
|
protected |
Adressing mode of the track (see the enum definition for more details)
|
protected |
Tells whether we should add new points to principal curve if a key is defined here but not on principal curve.
|
protected |
Key frames.
1.8.17