From f47fde76c045ca0ebfca3ca3e1cec1febef7d1a0 Mon Sep 17 00:00:00 2001 From: thejinchao Date: Thu, 9 Oct 2025 21:31:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=BF=87float*=E7=94=9F=E6=88=90vecto?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/core/include/math/dvc_vector2.h | 6 ++++++ source/core/include/math/dvc_vector3.h | 7 +++++++ source/core/include/math/dvc_vector4.h | 8 ++++++++ 3 files changed, 21 insertions(+) diff --git a/source/core/include/math/dvc_vector2.h b/source/core/include/math/dvc_vector2.h index 7dc037c..77557f2 100644 --- a/source/core/include/math/dvc_vector2.h +++ b/source/core/include/math/dvc_vector2.h @@ -51,6 +51,12 @@ public: return *this; } + inline TVector2& operator = (const T* pScalar) { + x = pScalar[0]; + y = pScalar[1]; + return *this; + } + inline bool operator == (const TVector2& rkVector) const { return (x == rkVector.x && y == rkVector.y); } diff --git a/source/core/include/math/dvc_vector3.h b/source/core/include/math/dvc_vector3.h index 08be26a..1dadc6a 100644 --- a/source/core/include/math/dvc_vector3.h +++ b/source/core/include/math/dvc_vector3.h @@ -62,6 +62,13 @@ public: return *this; } + inline TVector3& operator = (const T* pScalar) { + x = pScalar[0]; + y = pScalar[1]; + z = pScalar[2]; + return *this; + } + inline bool operator == (const TVector3& rkVector) const { return (x == rkVector.x && y == rkVector.y && z == rkVector.z); } diff --git a/source/core/include/math/dvc_vector4.h b/source/core/include/math/dvc_vector4.h index 02f3c76..ba23873 100644 --- a/source/core/include/math/dvc_vector4.h +++ b/source/core/include/math/dvc_vector4.h @@ -73,6 +73,14 @@ public: return *this; } + inline TVector4& operator = (const T* pScalar) { + x = pScalar[0]; + y = pScalar[1]; + z = pScalar[2]; + w = pScalar[4]; + return *this; + } + inline bool operator == (const TVector4& rkVector) const { return (x == rkVector.x && y == rkVector.y && z == rkVector.z && w == rkVector.w); }