19 #ifndef HEADER_IPO_HPP
20 #define HEADER_IPO_HPP
29 #include "utils/no_copy.hpp"
30 #include "utils/vec3.hpp"
45 IPO_ROTX, IPO_ROTY, IPO_ROTZ,
46 IPO_SCALEX, IPO_SCALEY, IPO_SCALEZ,
48 static const std::string m_all_channel_names[IPO_MAX];
60 enum {IP_CONST, IP_LINEAR, IP_BEZIER} m_interpolation;
62 enum {ET_CONST, ET_EXTRAP, ET_CYCLIC_EXTRAP, ET_CYCLIC} m_extend;
82 float getCubicBezier(
float t,
float p0,
float p1,
83 float p2,
float p3)
const;
84 float getCubicBezierDerivative(
float t,
float p0,
float p1,
85 float p2,
float p3)
const;
86 void approximateBezier(
float t0,
float t1,
89 unsigned int rec_level = 0);
92 void readCurve(
const XMLNode &node,
bool reverse);
93 void readIPO(
const XMLNode &node,
float fps,
bool reverse);
94 float approximateLength(
float t0,
float t1,
97 float adjustTime(
float time);
98 float get(
float time,
unsigned int index,
unsigned int n);
99 float getDerivative(
float time,
unsigned int index,
unsigned int n);
119 void updateNextN(
float *time)
const;
123 Ipo(
const XMLNode &curve,
float fps=25,
bool reverse=
false);
126 void update(
float time,
Vec3 *xyz=NULL,
Vec3 *hpr=NULL,
128 void getDerivative(
float time,
Vec3 *xyz);
129 float get(
float time,
unsigned int index)
const;
130 void setInitialTransform(
const Vec3 &xyz,
const Vec3 &hpr);
This object stores the read-only data of an IPO.
Definition: ipo.hpp:54
std::vector< Vec3 > m_handle1
Only used for bezier curves: the two handles.
Definition: ipo.hpp:68
Vec3 m_initial_xyz
Stores the inital position of the object.
Definition: ipo.hpp:77
Vec3 m_initial_hpr
Stores the inital rotation of the object.
Definition: ipo.hpp:80
float m_end_time
Time of the last control point.
Definition: ipo.hpp:74
float m_start_time
Time of the first control point.
Definition: ipo.hpp:71
std::vector< Vec3 > m_points
The actual control points.
Definition: ipo.hpp:65
IpoChannelType m_channel
The type of this IPO.
Definition: ipo.hpp:57
A class to manage a single blender IPO curve.
Definition: ipo.hpp:38
bool m_own_ipo_data
True if m_ipo_data is 'owned' by this object and therefore needs to be freed.
Definition: ipo.hpp:111
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 n...
Definition: ipo.hpp:117
float getEndTime() const
Returns the last specified time (i.e.
Definition: ipo.hpp:138
const std::vector< Vec3 > & getPoints() const
Returns the raw data points for this IPO.
Definition: ipo.hpp:134
IpoData * m_ipo_data
The actual data of the IPO.
Definition: ipo.hpp:106
IpoChannelType
All supported ipo types.
Definition: ipo.hpp:43
Utility class, you can inherit from this class to disallow the assignment operator and copy construct...
Definition: no_copy.hpp:26
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35
utility class used to parse XML files
Definition: xml_node.hpp:48