HKeyframeChannelCurve Class Reference

The HKeyframeChannelCurve class is used for spline based interpolation of positional values. More...

#include <HBhvUtility.h>

Public Member Functions

void CalculateCurveFactor (HBhvTimeline *timeline, int keyframe)
 
void CalculateCurveLength (HPoint p2)
 
void CalculateHermiteTangents (HPoint p0, HPoint p2, HPoint p3, float a=0.5f)
 
virtual HKeyframeClone ()
 
void DrawTangents (HPoint p2)
 
 HKeyframeChannelCurve (float x=0, float y=0, float z=0)
 
virtual void Interpolate (HKeyframeChannel **posarray, int keyframe, float fraction, int length, HPoint &res)
 
HPoint InterpolateHermiteSpline (float fraction, HPoint p1, HPoint p2)
 
virtual void Serialize (HUtilityXMLTag *xmlgen)
 
- Public Member Functions inherited from HKeyframeChannel
 HKeyframeChannel ()
 
- Public Member Functions inherited from HKeyframe
 HKeyframe ()
 
virtual void SetConstant (bool constant)
 
virtual void SetEaseInOut (bool easeinout)
 
virtual void SetRelative (bool relative)
 

Public Attributes

float b
 
float c
 
HPointcontrol_polygon
 
float ItemType
 
float m_curvelength
 
float m_factor1
 
float m_factor2
 
HPoint m_tangent1
 
HPoint m_tangent2
 
- Public Attributes inherited from HKeyframeChannel
HANIChannelType m_channeltype
 
HPoint m_cp
 
- Public Attributes inherited from HKeyframe
bool m_bConstant
 
bool m_bEaseInOut
 
bool m_bRelative
 
HANIKeyframeType m_type
 

Detailed Description

The HKeyframeChannelCurve class is used for spline based interpolation of positional values.

Constructor & Destructor Documentation

◆ HKeyframeChannelCurve()

HKeyframeChannelCurve::HKeyframeChannelCurve ( float  x = 0,
float  y = 0,
float  z = 0 
)
inline

Constructs a HKeyframeChannelCurve Object.

References HANIHermiteSpline.

Member Function Documentation

◆ CalculateCurveFactor()

void HKeyframeChannelCurve::CalculateCurveFactor ( HBhvTimeline timeline,
int  keyframe 
)

This method is a helper function for CalculateHermiteTangents(). Call this method to precalculate curve factors before calling CalculateHermiteTangents().

Parameters
timelineTimeline array necessary to calculate correct curve factors
keyframeCurrent Keyframe

◆ CalculateCurveLength()

void HKeyframeChannelCurve::CalculateCurveLength ( HPoint  p2)

This method calculates the length of this curve between this keyframe and a given point.

Parameters
p2The point to calculate the length with.

◆ CalculateHermiteTangents()

void HKeyframeChannelCurve::CalculateHermiteTangents ( HPoint  p0,
HPoint  p2,
HPoint  p3,
float  a = 0.5f 
)

Use this method to precalculate tangents for the hermite spline. This method can be usef as a helper function for interpolation.

Parameters
p0The first point for tangent calculation.
p2The third point for tangent calculation.
p3The fourth Point for tangent calculation.
aConstant for hermite spline

◆ Clone()

virtual HKeyframe* HKeyframeChannelCurve::Clone ( )
inlinevirtual

This method makes an exact copy of the current HKeyframeChannelCurve and returns a pointer to the newly created HKeyframeChannelCurve object.

Returns
A pointer to the newly created HKeyframeChannelCurve object.

Reimplemented from HKeyframeChannel.

Reimplemented in HKeyframeChannelFollowPath.

◆ DrawTangents()

void HKeyframeChannelCurve::DrawTangents ( HPoint  p2)

This method creates a visualization of the tangents calculated for this curve by drawing them into the scene.

Parameters
p2The second point to calculate tangents from.

◆ Interpolate()

virtual void HKeyframeChannelCurve::Interpolate ( HKeyframeChannel **  posarray,
int  keyframe,
float  fraction,
int  length,
HPoint res 
)
virtual

Calculates the interpolation between this keyframe and the next keyframe.

Parameters
posarrayThe array of HKeyframeChannel objects.
keyframeThey current keyframe number.
fractionThe fraction from this keyframe to next.
lengthThe number of entries in the keyframe array.
resReturns the interpolation result.

Reimplemented from HKeyframeChannel.

Reimplemented in HKeyframeChannelFollowPath.

◆ InterpolateHermiteSpline()

HPoint HKeyframeChannelCurve::InterpolateHermiteSpline ( float  fraction,
HPoint  p1,
HPoint  p2 
)

This method uses the given frame and control points to interpolate a Hermite spline.

Parameters
fractionDistance between the first and second control point.
p1The first control point.
p2The second control point.
Returns
The interpolated result.

◆ Serialize()

virtual void HKeyframeChannelCurve::Serialize ( HUtilityXMLTag *  xmlgen)
virtual

Writes XML data to a buffer.

Reimplemented from HKeyframe.

Reimplemented in HKeyframeChannelFollowPath.

Member Data Documentation

◆ b

float HKeyframeChannelCurve::b

For internal use only.

◆ c

float HKeyframeChannelCurve::c

For internal use only.

◆ control_polygon

HPoint* HKeyframeChannelCurve::control_polygon

For internal use only.

◆ ItemType

float HKeyframeChannelCurve::ItemType

For internal use only.

◆ m_curvelength

float HKeyframeChannelCurve::m_curvelength

For internal use only.

◆ m_factor1

float HKeyframeChannelCurve::m_factor1

For internal use only.

◆ m_factor2

float HKeyframeChannelCurve::m_factor2

For internal use only.

◆ m_tangent1

HPoint HKeyframeChannelCurve::m_tangent1

The first tangent.

◆ m_tangent2

HPoint HKeyframeChannelCurve::m_tangent2

The second tangent.


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