|
resonance 1.0.1
|
Animation of one texture stage of the material. More...
#include <matanim.h>
Classes | |
| class | TexKey |
| One keyframe of the texture channel of a stage. More... | |
Public Member Functions | |
| Stage ()=default | |
| Construct a stage animation with four empty channels. | |
| Stage (const Stage &other)=default | |
| Copy the four channels and the owner of another stage animation. | |
| ~Stage ()=default | |
| Release the four channels. | |
| Stage & | operator= (const Stage &other)=default |
| Copy the four channels and the owner of another stage animation over this one. | |
| void | Save (Stream &stream) |
| Serialise the stage animation. | |
| void | Load (Stream &stream) |
| Load the stage animation. | |
| void | Dump (Dbg &sink) |
| Write the four channels and the owner to the engine text sink. | |
| void | AddTexKey (Tex *pTex, float flFrame) |
| Add a texture key and sort the channel by frame. | |
| void | RemoveTexKey (int nIndex) |
| Remove the texture key at a position and sort the channel by frame. | |
| void | SetTexKeyFrame (int nIndex, float flFrame) |
| Move the texture key at a position to a new frame and sort the channel by frame. | |
Friends | |
| class | MatAnim |
Animation of one texture stage of the material.
The record is 0x14 bytes, which the stride of every walk over the vector pins, and the walk in SetFrameSelf() runs it against mMat->mStages with the material's stage count as the bound. The three vector channels are Rnd::Vector3Key records. Their writer, reader, and dump move three components and the frame, and SetFrameSelf() blends them through vmulax.xyz rather than vmulax.xyzw. The dump labels the channels " transKeys:", " scaleKeys:", " rotKeys:", " texKeys:", and " matAnim:" in offset order.
The record has behaviour, so it is a class with private members rather than a plain data record. Rnd::MatAnim is the only code that touches the four channels, through the nested access a member of the enclosing class has.
|
default |
Construct a stage animation with four empty channels.
The compiler generates the body. mOwner is left as it was, and Rnd::MatAnim writes it after every resize.
|
default |
Copy the four channels and the owner of another stage animation.
The compiler generates the body, which copies the three vector channels through 0x004d84f8 and the texture channel through 0x004d85e8.
| other | The stage animation to copy. |
|
default |
Release the four channels.
The compiler generates the body, which destroys the channels in reverse order and frees the record when the in-charge flag asks it to. The textures keep their references.
Copy the four channels and the owner of another stage animation over this one.
| other | The stage animation to copy. |
| void Rnd::MatAnim::Stage::Save | ( | Stream & | stream | ) |
Serialise the stage animation.
Writes the translation, scale, and rotation channels through the Rnd::Stream insertion operator and then the texture channel, each texture as its name.
| stream | The stream to write to. |
| void Rnd::MatAnim::Stage::Load | ( | Stream & | stream | ) |
Load the stage animation.
The shared material revision decides the layout. Below revision 2 the texture channel arrives as a bare list of textures, which becomes one key per texture at frames 0, 1, 2, and so on, and the channel is sorted again after every key. From revision 1 the three vector channels follow. From revision 2 the texture channel follows as keys.
| stream | The stream to read from. |
| void Rnd::MatAnim::Stage::Dump | ( | Dbg & | sink | ) |
Write the four channels and the owner to the engine text sink.
| sink | The text sink. |
| void Rnd::MatAnim::Stage::AddTexKey | ( | Tex * | pTex, |
| float | flFrame ) |
Add a texture key and sort the channel by frame.
The texture takes a reference for the owning animation, or for no object while the stage has no owner. The routine has no caller in the shipped build. The name is inferred.
| pTex | The texture, or null. |
| flFrame | The frame of the new key. |
| void Rnd::MatAnim::Stage::RemoveTexKey | ( | int | nIndex | ) |
Remove the texture key at a position and sort the channel by frame.
The texture drops the reference of the owning animation. The index is not checked. The routine has no caller in the shipped build. The name is inferred.
| nIndex | The position of the key. |
| void Rnd::MatAnim::Stage::SetTexKeyFrame | ( | int | nIndex, |
| float | flFrame ) |
Move the texture key at a position to a new frame and sort the channel by frame.
The index is not checked. The routine has no caller in the shipped build. The name is inferred.
| nIndex | The position of the key. |
| flFrame | The new frame. |
|
friend |