List of Miscellaneous Control Functions and Templates

3DS Max Plug-In SDK

List of Miscellaneous Control Functions and Templates

See Also: Class StdControl, List of Additional Controller Related Functions.

Description:

The following functions are available for help with Out of Range Type (ORT) processing. All functions are implemented by the system.

Prototype:

inline TimeValue CycleTime(Interval i,TimeValue t)

Remarks:

Returns a TimeValue that is the specified time mod the interval length. The returned time is somewhere within the interval passed. This cycles the time so that is appears within the interval.

Parameters:

Interval i

The interval the returned time is within.

TimeValue t

The time to cycle.

Prototype:

inline int NumCycles(Interval i,TimeValue t)

Remarks:

Returns the number of times the TimeValue cycles through the interval.

Parameters:

Interval i

The interval the time is checked against.

TimeValue t

The time to check.

Note: Types that use these template functions must support the following operators:

T + T, T - T, T * float, T + float

Prototype:

template <class T> T LinearExtrapolate(TimeValue t0, TimeValue t1,

 T &val0, T &val1, T &endVal)

Remarks:

Performs a linear extrapolation and returns the result.

Parameters:

TimeValue t0

The time you are extrapolating from.

TimeValue t1

The time you are extrapolating to.

T &val0

The first value you want to use to extrapolate from.

T &val1

The second value you want to use to extrapolate from.

T &endVal

The value at time t0.

Return Value:

The extrapolated value associated with time t1.

Prototype:

template <class T> T RepeatExtrapolate(Interval range, TimeValue t,

 T &startVal, T &endVal, T &cycleVal);

Remarks:

Performs a repeat extrapolation and returns the result. This will cycle the time t into the interval range.

Parameters:

Interval range

The range for which you are repeating over.

TimeValue t

The time you are extrapolating to.

T &startVal

The value at the start of the range.

T &endVal

The value at the end of the range.

T &cycleVal

The value of the function at the cycled point.

Prototype:

template <class T> T IdentityExtrapolate(TimeValue endPoint, TimeValue t,

 T &endVal);

Remarks:

Performs a linear extrapolation using a slope of one and a point and returns the result.

Parameters:

TimeValue endPoint

The end point time.

TimeValue t

The time to evaluate.

T &endVal

The value of the endPoint time.

Prototype:

Quat LinearExtrapolate(TimeValue t0, TimeValue t1, Quat &val0,

 Quat &val1, Quat &endVal);

Remarks:

The Quat version of above.

Prototype:

Quat RepeatExtrapolate(Interval range, TimeValue t, Quat &startVal,

 Quat &endVal, Quat &cycleVal);

Remarks:

The Quat version of above.

Prototype:

Quat IdentityExtrapolate(TimeValue endPoint, TimeValue t, Quat &endVal );

Remarks:

The Quat version of above.

Prototype:

template <class T> T LinearInterpolate(const T &v0,const T &v1,float u)

Remarks:

The functions performs a linear interpolation between v0 and v1 using u as the interpolation parameter.

Parameters:

const T &v0

The first value.

const T &v1

The second value.

float u

The interpolation parameter in the range 0 to 1.

Prototype:

inline Quat LinearInterpolate(const Quat &v0,const Quat &v1,float u)

Remarks:

The Quat version of above.

Prototype:

inline ScaleValue LinearInterpolate(const ScaleValue &v0,

 const ScaleValue &v1,float u)

Remarks:

The ScaleValue version of above.

Prototype:

inline Interval TestInterval(Interval iv, DWORD flags)

Remarks:

This function take the interval passed and checks the flags and modifies the interval based on the state of the flags.

Parameters:

Interval iv

The interval to modify.

DWORD flags

One of the following values:

TIME_INCLEFT

TIME_INCRIGHT

Return Value:

The revised interval.

Prototype:

inline Quat ScaleQuat(Quat q, float s)

Remarks:

Returns a quaternion scaled by the specified factor. This scales the 'angle' of the quaternion by s.

Parameters:

Quat q

The quaternion to scale.

float s

The scale factor.