214 if (keys.size() == 0) {
217 return keys.back().mFrame;
236 const std::list<Key> &keys,
float flFrame,
const Key *&pFrom,
const Key *&pTo,
float &flBlend) {
237 if (flFrame <= keys.front().mFrame) {
238 pFrom = &keys.front();
243 if (keys.back().mFrame <= flFrame) {
244 pFrom = &keys.back();
250 typename std::list<Key>::const_iterator itFrom = keys.begin();
251 typename std::list<Key>::const_iterator itTo = itFrom;
253 while (itTo != keys.end() && flFrame > itTo->mFrame) {
259 flBlend = (flFrame - itFrom->mFrame) / (itTo->mFrame - itFrom->mFrame);
Sink that the engine formats its diagnostic and failure text into.
Definition dbg.h:33
Byte stream that every renderer object serialises itself through.
Definition stream.h:31
The rendering engine.
Definition animhelper.h:3
Stream & ReadColorKeys(Stream &stream, std::list< ColorKey > &keys)
Read a channel of colour keyframes from a .rnd stream.
Dbg & DumpColorKeys(Dbg &sink, const std::list< ColorKey > &keys)
Write a channel of colour keyframes to the engine text sink.
Stream & operator<<(Stream &stream, const std::list< Vector3Key > &keys)
Write a channel of vector keyframes to a .rnd stream.
Dbg & DumpFloatKeys(Dbg &sink, const std::list< FloatKey > &keys)
Write a channel of scalar keyframes to the engine text sink.
Stream & ReadFloatKeys(Stream &stream, std::list< FloatKey > &keys)
Read a channel of scalar keyframes from a .rnd stream.
void SelectKeyPair(const std::list< Key > &keys, float flFrame, const Key *&pFrom, const Key *&pTo, float &flBlend)
Select the keyframe pair bracketing a frame, and the blend between the pair.
Definition keychannel.h:235
Stream & WriteColorKeys(Stream &stream, const std::list< ColorKey > &keys)
Write a channel of colour keyframes to a .rnd stream.
Stream & ReadVector3Keys(Stream &stream, std::list< Vector3Key > &keys)
Read a channel of vector keyframes from a .rnd stream.
Dbg & DumpVector3Keys(Dbg &sink, const std::list< Vector3Key > &keys)
Write a channel of vector keyframes to the engine text sink.
float ChannelEndFrame(const std::list< Key > &keys)
Report the frame of the last keyframe of a channel, and zero for an empty channel.
Definition keychannel.h:213
Stream & WriteFloatKeys(Stream &stream, const std::list< FloatKey > &keys)
Write a channel of scalar keyframes to a .rnd stream.
Linear colour with four float components.
Definition color.h:10
One keyframe of a colour channel.
Definition keychannel.h:34
float mFrame
Definition keychannel.h:36
Color mValue
Definition keychannel.h:35
One keyframe of a scalar channel.
Definition keychannel.h:48
float mValue
Definition keychannel.h:49
float mFrame
Definition keychannel.h:50
Vector3 mValue
Definition keychannel.h:72
float mFrame
Definition keychannel.h:73
Vector3Key()
Construct a key whose value has only its padding word set.
Definition keychannel.h:68
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:12