summaryrefslogtreecommitdiff
path: root/Runtime/Dynamics/RaycastCollider.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Dynamics/RaycastCollider.h
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/Dynamics/RaycastCollider.h')
-rw-r--r--Runtime/Dynamics/RaycastCollider.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/Runtime/Dynamics/RaycastCollider.h b/Runtime/Dynamics/RaycastCollider.h
new file mode 100644
index 0000000..53e824c
--- /dev/null
+++ b/Runtime/Dynamics/RaycastCollider.h
@@ -0,0 +1,49 @@
+#ifndef RAYCASTCOLLIDER_H
+#define RAYCASTCOLLIDER_H
+
+#include "Collider.h"
+#include "Runtime/Math/Vector3.h"
+#include "Runtime/Math/Vector2.h"
+
+
+class RaycastCollider : public Collider
+{
+ public:
+ REGISTER_DERIVED_CLASS (RaycastCollider, Collider)
+ DECLARE_OBJECT_SERIALIZE (RaycastCollider)
+
+ RaycastCollider (MemLabelId label, ObjectCreationMode mode);
+
+ virtual void Reset ();
+ virtual void SmartReset ();
+ virtual void AwakeFromLoad(AwakeFromLoadMode mode);
+
+ float GetLength () const { return m_Length; }
+ void SetLength (float f);
+
+ Vector3f GetCenter () const { return m_Center; }
+ void SetCenter (const Vector3f& center);
+
+ float GetGlobalLength () const;
+ Vector3f GetGlobalCenter () const;
+
+ void TransformChanged (int changeMask);
+ static void InitializeClass ();
+ static void CleanupClass () {}
+ Matrix4x4f CalculateTransform () const;
+
+ protected:
+
+
+ ///@TODO ADD DIRECTION
+ virtual void FetchPoseFromTransform ();
+ virtual bool GetRelativeToParentPositionAndRotation (Transform& transform, Transform& anyParent, Matrix4x4f& matrix);
+
+ virtual void Create (const Rigidbody* ignoreAttachRigidbody);
+ void ScaleChanged ();
+
+ Vector3f m_Center;
+ float m_Length;///< range { 0, infinity }
+};
+
+#endif