From d03b7fbe090dca1f9ea4190116ac0efbee37e929 Mon Sep 17 00:00:00 2001 From: reduz Date: Thu, 21 Oct 2021 13:38:20 -0300 Subject: Refactored Node3D rotation modes * Made the Basis euler orders indexed via enum. * Node3D has a new rotation_order property to choose Euler rotation order. * Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations. The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course). --- core/variant/variant_internal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/variant/variant_internal.h') diff --git a/core/variant/variant_internal.h b/core/variant/variant_internal.h index 37383ff2ec..2ba24b5af8 100644 --- a/core/variant/variant_internal.h +++ b/core/variant/variant_internal.h @@ -756,6 +756,12 @@ VARIANT_ACCESSOR_NUMBER(char32_t) VARIANT_ACCESSOR_NUMBER(Error) VARIANT_ACCESSOR_NUMBER(Side) +template <> +struct VariantInternalAccessor { + static _FORCE_INLINE_ Basis::EulerOrder get(const Variant *v) { return Basis::EulerOrder(*VariantInternal::get_int(v)); } + static _FORCE_INLINE_ void set(Variant *v, Basis::EulerOrder p_value) { *VariantInternal::get_int(v) = p_value; } +}; + template <> struct VariantInternalAccessor { static _FORCE_INLINE_ ObjectID get(const Variant *v) { return ObjectID(*VariantInternal::get_int(v)); } -- cgit v1.2.3