From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Dynamics/SpringJoint.h | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Runtime/Dynamics/SpringJoint.h (limited to 'Runtime/Dynamics/SpringJoint.h') diff --git a/Runtime/Dynamics/SpringJoint.h b/Runtime/Dynamics/SpringJoint.h new file mode 100644 index 0000000..99288c9 --- /dev/null +++ b/Runtime/Dynamics/SpringJoint.h @@ -0,0 +1,51 @@ +#ifndef SPRINGJOINT_H +#define SPRINGJOINT_H + +#include "Runtime/BaseClasses/GameObject.h" +#include "Runtime/Math/Vector3.h" +#include "JointDescriptions.h" +#include "Joint.h" +class Rigidbody; +class NxJointDesc; + +namespace Unity +{ + + +class SpringJoint : public Joint +{ + public: + + REGISTER_DERIVED_CLASS (SpringJoint, Joint) + DECLARE_OBJECT_SERIALIZE (SpringJoint) + + SpringJoint (MemLabelId label, ObjectCreationMode mode); + void Reset(); + + float GetSpring () const { return m_Spring; } + void SetSpring (float spring); + + float GetDamper () { return m_Damper; } + void SetDamper(float damper); + + float GetMinDistance() { return m_MinDistance; } + void SetMinDistance(float distance); + + float GetMaxDistance() { return m_MaxDistance; } + void SetMaxDistance(float distance); + + private: + + virtual void ApplySetupAxesToDesc (int option); + virtual void Create (); + + float m_MinDistance; ///< range { 0, infinity } + float m_MaxDistance; ///< range { 0, infinity } + float m_Spring; ///< range { 0, infinity } + float m_Damper; ///< range { 0, infinity } +}; + +} + +#endif // SPRINGJOINT_H + -- cgit v1.1-26-g67d0