Bone Manip part 1 - bone setters
* split frame info calculation from RenderFrameModels
* clean up fvec4 being used as quat in iqms
* initial work on bone setting
* implement bone setters
* clean up FindModelFrame
* refactor model overrides into its own function
* refactor frame rendering into RenderModelFrame
* split frame processing into ProcessModelFrame
* refactor BoneOverride in preparation for translation/scale overrides
* clean up macros
* SetBoneTranslation/SetBoneScaling
* GetBoneOffset
* fix compilation on linux/mac (fuck you MSVC)
* fix typo 😅
* make sure bone overrides are cleared on model switches, add ClearBoneOffsets to clear them manually
* bone info getters
* fix joint lengths, add joint dirs
* serialize bone overrides
* fix bone dir return type
* GetBoneIndex/GetBoneCount
* helper functions for working with non-quat angles
* add mode enum, add more helper functions
* fix up formatting
This commit is contained in:
parent
c0d17bbda3
commit
3780c5910a
18 changed files with 1396 additions and 253 deletions
|
|
@ -1764,6 +1764,30 @@ void SerializeModelID(FSerializer &arc, const char *key, int &id)
|
|||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static FSerializer &SerializeBoneOverrideComponent(FSerializer &arc, const char *key, T &comp)
|
||||
{
|
||||
arc.BeginObject(key);
|
||||
arc("mode", comp.mode);
|
||||
arc("prev_mode", comp.prev_mode);
|
||||
arc("switchtic", comp.switchtic);
|
||||
arc("interplen", comp.interplen);
|
||||
arc("prev", comp.prev);
|
||||
arc("cur", comp.cur);
|
||||
arc.EndObject();
|
||||
return arc;
|
||||
}
|
||||
|
||||
FSerializer &Serialize(FSerializer &arc, const char *key, BoneOverride &mod, BoneOverride *def)
|
||||
{
|
||||
arc.BeginObject(key);
|
||||
SerializeBoneOverrideComponent(arc, "translation", mod.translation);
|
||||
SerializeBoneOverrideComponent(arc, "rotation", mod.rotation);
|
||||
SerializeBoneOverrideComponent(arc, "scaling", mod.scaling);
|
||||
arc.EndObject();
|
||||
return arc;
|
||||
}
|
||||
|
||||
FSerializer &Serialize(FSerializer &arc, const char *key, ModelOverride &mo, ModelOverride *def)
|
||||
{
|
||||
arc.BeginObject(key);
|
||||
|
|
@ -1869,6 +1893,7 @@ void DActorModelData::Serialize(FSerializer& arc)
|
|||
("skinIDs", skinIDs)
|
||||
("animationIDs", animationIDs)
|
||||
("modelFrameGenerators", modelFrameGenerators)
|
||||
("modelBoneOverrides", modelBoneOverrides)
|
||||
("flags", flags)
|
||||
("overrideFlagsSet", overrideFlagsSet)
|
||||
("overrideFlagsClear", overrideFlagsClear)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue