summaryrefslogtreecommitdiff
path: root/Runtime/Dynamics/SpringJoint.h
blob: 99288c9eec7d04ffa4fc9686feacb656677be069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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