A class to manage a single blender IPO curve.
More...
#include <ipo.hpp>
|
class | IpoData |
| This object stores the read-only data of an IPO. More...
|
|
|
enum | IpoChannelType {
IPO_LOCX
, IPO_LOCY
, IPO_LOCZ
, IPO_LOCXYZ
,
IPO_ROTX
, IPO_ROTY
, IPO_ROTZ
, IPO_SCALEX
,
IPO_SCALEY
, IPO_SCALEZ
, IPO_MAX
} |
| All supported ipo types. More...
|
|
|
| Ipo (const XMLNode &curve, float fps=25, bool reverse=false) |
| The Ipo constructor.
|
|
virtual | ~Ipo () |
| The destructor only frees IpoData if it was created by this instance (and not if this instance was copied, therefore sharing the IpoData).
|
|
Ipo * | clone () |
| Creates a copy of this object (the copy constructor is disabled in order to avoid implicit copies happening).
|
|
void | update (float time, Vec3 *xyz=NULL, Vec3 *hpr=NULL, Vec3 *scale=NULL) |
| Updates the time of this ipo and interpolates the new position and rotation (taking the cycle length etc.
|
|
void | getDerivative (float time, Vec3 *xyz) |
| Returns the derivative for any location based curves.
|
|
float | get (float time, unsigned int index) const |
| Returns the interpolated value at the current time (which this objects keeps track of).
|
|
void | setInitialTransform (const Vec3 &xyz, const Vec3 &hpr) |
| Stores the initial transform.
|
|
void | reset () |
| Resets the IPO for (re)starting an animation.
|
|
const std::vector< Vec3 > & | getPoints () const |
| Returns the raw data points for this IPO.
|
|
float | getEndTime () const |
| Returns the last specified time (i.e.
|
|
|
void | updateNextN (float *time) const |
| Updates the value of m_next_n to point to the right ipo segment based on the time.
|
|
| Ipo (const Ipo *ipo) |
| A copy constructor.
|
|
|
IpoData * | m_ipo_data |
| The actual data of the IPO.
|
|
bool | m_own_ipo_data |
| True if m_ipo_data is 'owned' by this object and therefore needs to be freed.
|
|
unsigned int | m_next_n |
| Which control points will be the next one (so m_next_n-1 and m_next_n are the control points to use now).
|
|
A class to manage a single blender IPO curve.
◆ IpoChannelType
All supported ipo types.
LOCXYZ is basically a curve, the IPO is actually a 3d curve, without a time axis, only the actual data points.
◆ Ipo() [1/2]
Ipo::Ipo |
( |
const Ipo * |
ipo | ) |
|
|
private |
A copy constructor.
It shares the read-only data with the source Ipo
- Parameters
-
◆ Ipo() [2/2]
Ipo::Ipo |
( |
const XMLNode & |
curve, |
|
|
float |
fps = 25 , |
|
|
bool |
reverse = false |
|
) |
| |
The Ipo constructor.
Ipos can share the actual data to interpolate, which is stored in a separate IpoData object, see Ipo(const Ipo *ipo) constructor. This is used for cannons: the actual check line stores the 'master' Ipo, and each actual IPO that animate a kart just use a copy of this read-only data.
- Parameters
-
curve | The XML data for this curve. |
fps | Frames per second, used to convert all frame based value in the xml file into seconds. |
reverse | If this is set to true, the ipo data will be reverse. This is used by the cannon if the track is driven in reverse. |
◆ get()
float Ipo::get |
( |
float |
time, |
|
|
unsigned int |
index |
|
) |
| const |
Returns the interpolated value at the current time (which this objects keeps track of).
- Parameters
-
time | The time for which the interpolated value should be computed. |
◆ getDerivative()
void Ipo::getDerivative |
( |
float |
time, |
|
|
Vec3 * |
xyz |
|
) |
| |
Returns the derivative for any location based curves.
- Parameters
-
time | Time for which the derivative is being computed. |
xyz | Pointer where the results should be stored. |
◆ getEndTime()
float Ipo::getEndTime |
( |
| ) |
const |
|
inline |
Returns the last specified time (i.e.
not considering any extend types).
◆ setInitialTransform()
void Ipo::setInitialTransform |
( |
const Vec3 & |
xyz, |
|
|
const Vec3 & |
hpr |
|
) |
| |
Stores the initial transform.
This is necessary for relative IPOs.
- Parameters
-
xyz | Position of the object. |
hpr | Rotation of the object. |
◆ update()
void Ipo::update |
( |
float |
time, |
|
|
Vec3 * |
xyz = NULL , |
|
|
Vec3 * |
hpr = NULL , |
|
|
Vec3 * |
scale = NULL |
|
) |
| |
Updates the time of this ipo and interpolates the new position and rotation (taking the cycle length etc.
into account). If a NULL is given, the value is not updated.
- Parameters
-
time | Current time for which to determine the interpolation. |
xyz | The position that needs to be updated (can be NULL). |
hpr | The rotation that needs to be updated (can be NULL). |
scale | The scale that needs to be updated (can be NULL) |
◆ updateNextN()
void Ipo::updateNextN |
( |
float * |
time | ) |
const |
|
private |
Updates the value of m_next_n to point to the right ipo segment based on the time.
- Parameters
-
t | Time for which m_next_n needs to be updated. |
◆ m_all_channel_names
const std::string Ipo::m_all_channel_names |
|
static |
Initial value:=
{"LocX", "LocY", "LocZ", "LocXYZ",
"RotX", "RotY", "RotZ",
"ScaleX", "ScaleY", "ScaleZ" }
◆ m_ipo_data
The actual data of the IPO.
This can be shared between Ipo (e.g. each cannon animation will use the same IpoData block, but its own instance of Ipo, since data like m_next_n should not be shared).
◆ m_next_n
unsigned int Ipo::m_next_n |
|
mutableprivate |
Which control points will be the next one (so m_next_n-1 and m_next_n are the control points to use now).
This just reduces lookup time in get(t). To allow modifying this in get() const, it is declared mutable).
◆ m_own_ipo_data
True if m_ipo_data is 'owned' by this object and therefore needs to be freed.
If an Ipo is cloned, it will share a reference to m_ipo_data, and must therefore not free it.
The documentation for this class was generated from the following files:
- animations/ipo.hpp
- animations/ipo.cpp