/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/GameEngine/Animation/Skeletal/JointOverrideComponent.h
57 строк
2 KB
Jan Krassnigg
Added "weight" property to JointOverrideComponent (#1845)
04 мар 2026, 22:05
Не верифицирован
04 мар 2026, 22:05
ae29f1d
Код
Авторство
О чём код?
#pragma once #include <Core/World/ComponentManager.h> #include <GameEngine/GameEngineDLL.h> #include <RendererCore/AnimationSystem/AnimationPose.h> using ezJointOverrideComponentManager = ezComponentManager<class ezJointOverrideComponent, ezBlockStorageType::FreeList>; /// Overrides the local transform of a bone in a skeletal animation. /// /// Every time a new animation pose is prepared, this component replaces the transform of the chosen bone /// to be the same as the local transform of the owner game object. /// /// That allows you to do a simple kind of forward kinematics. For example it can be used to modify a targeting bone, /// so that an animated object points into the right direction. /// /// The global transform of the game object is irrelevant, but the local transform is used to copy over. class EZ_GAMEENGINE_DLL ezJointOverrideComponent : public ezComponent { EZ_DECLARE_COMPONENT_TYPE(ezJointOverrideComponent, ezComponent, ezJointOverrideComponentManager); ////////////////////////////////////////////////////////////////////////// // ezComponent public: virtual void SerializeComponent(ezWorldWriter& inout_stream) const override; virtual void DeserializeComponent(ezWorldReader& inout_stream) override; ////////////////////////////////////////////////////////////////////////// // ezJointOverrideComponent public: ezJointOverrideComponent(); ~ezJointOverrideComponent(); /// The name of the bone whose transform should be replaced with the transform of this game object. void SetJointName(const char* szName); // [ property ] const char* GetJointName() const; // [ property ] /// If true, the position of the bone will be overridden. bool m_bOverridePosition = false; // [ property ] /// If true, the rotation of the bone will be overridden. bool m_bOverrideRotation = true; // [ property ] /// If true, the scale of the bone will be overridden. bool m_bOverrideScale = false; // [ property ] /// Set a weight between 0 and 1 to fade the override in our out. float m_fWeight = 1.0f; // [ property ] protected: void OnAnimationPosePreparing(ezMsgAnimationPosePreparing& msg) const; // [ msg handler ] ezHashedString m_sJointToOverride; mutable ezUInt16 m_uiJointIndex = ezInvalidJointIndex; };