// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. #pragma once #include "../Actor.h" /// /// Actor that links to the animated model skeleton node transformation. /// API_CLASS(Attributes="ActorContextMenu(\"New/Other/Bone Socket\"), ActorToolbox(\"Other\")") class FLAXENGINE_API BoneSocket : public Actor { DECLARE_SCENE_OBJECT(BoneSocket); private: String _node; int32 _index; bool _useScale; public: /// /// Gets the target node name to link to it. /// API_PROPERTY(Attributes="EditorOrder(10), EditorDisplay(\"Bone Socket\"), CustomEditorAlias(\"FlaxEditor.CustomEditors.Editors.SkeletonNodeEditor\")") FORCE_INLINE const String& GetNode() const { return _node; } /// /// Sets the target node to link to it. /// API_PROPERTY() void SetNode(const StringView& name); /// /// Gets the value indicating whenever use the target node scale. Otherwise won't override the actor scale. /// API_PROPERTY(Attributes="EditorOrder(20), EditorDisplay(\"Bone Socket\"), DefaultValue(false)") FORCE_INLINE bool GetUseScale() const { return _useScale; } /// /// Sets the value indicating whenever use the target node scale. Otherwise won't override the actor scale. /// API_PROPERTY() void SetUseScale(bool value); public: /// /// Updates the actor transformation based on a skeleton node. /// API_FUNCTION() void UpdateTransformation(); public: // [Actor] #if USE_EDITOR void OnDebugDrawSelected() override; #endif void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: // [Actor] void OnTransformChanged() override; void OnParentChanged() override; };