Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
HingeConstraint.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using SiliconStudio.Core.Mathematics;
4 
5 namespace SiliconStudio.Paradox.Physics
6 {
7  public class HingeConstraint : Constraint
8  {
9  /// <summary>
10  /// Sets the frames.
11  /// </summary>
12  /// <param name="frameA">The frame a.</param>
13  /// <param name="frameB">The frame b.</param>
14  public void SetFrames(Matrix frameA, Matrix frameB)
15  {
16  InternalHingeConstraint.SetFrames(frameA, frameB);
17  }
18 
19  /// <summary>
20  /// Gets or sets a value indicating whether [angular only].
21  /// </summary>
22  /// <value>
23  /// <c>true</c> if [angular only]; otherwise, <c>false</c>.
24  /// </value>
25  public bool AngularOnly
26  {
27  get { return InternalHingeConstraint.AngularOnly; }
28  set { InternalHingeConstraint.AngularOnly = value; }
29  }
30 
31  /// <summary>
32  /// Gets the hinge angle.
33  /// </summary>
34  /// <value>
35  /// The hinge angle.
36  /// </value>
37  public float HingeAngle
38  {
39  get { return InternalHingeConstraint.HingeAngle; }
40  }
41 
42  /// <summary>
43  /// Gets or sets the maximum motor impulse.
44  /// </summary>
45  /// <value>
46  /// The maximum motor impulse.
47  /// </value>
48  public float MaxMotorImpulse
49  {
50  get { return InternalHingeConstraint.MaxMotorImpulse; }
51  set { InternalHingeConstraint.MaxMotorImpulse = value; }
52  }
53 
54  /// <summary>
55  /// Gets the motor target velocity.
56  /// </summary>
57  /// <value>
58  /// The motor target velocity.
59  /// </value>
60  public float MotorTargetVelocity
61  {
62  get { return InternalHingeConstraint.MotorTargetVelosity; }
63  }
64 
65  /// <summary>
66  /// Gets the solve limit.
67  /// </summary>
68  /// <value>
69  /// The solve limit.
70  /// </value>
71  public int SolveLimit
72  {
73  get { return InternalHingeConstraint.SolveLimit; }
74  }
75 
76  /// <summary>
77  /// Gets the lower limit.
78  /// </summary>
79  /// <value>
80  /// The lower limit.
81  /// </value>
82  public float LowerLimit
83  {
84  get { return InternalHingeConstraint.LowerLimit; }
85  }
86 
87  /// <summary>
88  /// Gets the upper limit.
89  /// </summary>
90  /// <value>
91  /// The upper limit.
92  /// </value>
93  public float UpperLimit
94  {
95  get { return InternalHingeConstraint.UpperLimit; }
96  }
97 
98  /// <summary>
99  /// Gets the limit sign.
100  /// </summary>
101  /// <value>
102  /// The limit sign.
103  /// </value>
104  public float LimitSign
105  {
106  get { return InternalHingeConstraint.LimitSign; }
107  }
108 
109  /// <summary>
110  /// Sets the limit.
111  /// </summary>
112  /// <param name="low">The low.</param>
113  /// <param name="high">The high.</param>
114  public void SetLimit(float low, float high)
115  {
116  InternalHingeConstraint.SetLimit(low, high);
117  }
118 
119  /// <summary>
120  /// Sets the limit.
121  /// </summary>
122  /// <param name="low">The low.</param>
123  /// <param name="high">The high.</param>
124  /// <param name="softness">The softness.</param>
125  public void SetLimit(float low, float high, float softness)
126  {
127  InternalHingeConstraint.SetLimit(low, high, softness);
128  }
129 
130  /// <summary>
131  /// Sets the limit.
132  /// </summary>
133  /// <param name="low">The low.</param>
134  /// <param name="high">The high.</param>
135  /// <param name="softness">The softness.</param>
136  /// <param name="biasFactor">The bias factor.</param>
137  public void SetLimit(float low, float high, float softness, float biasFactor)
138  {
139  InternalHingeConstraint.SetLimit(low, high, softness, biasFactor);
140  }
141 
142  /// <summary>
143  /// Sets the limit.
144  /// </summary>
145  /// <param name="low">The low.</param>
146  /// <param name="high">The high.</param>
147  /// <param name="softness">The softness.</param>
148  /// <param name="biasFactor">The bias factor.</param>
149  /// <param name="relaxationFactor">The relaxation factor.</param>
150  public void SetLimit(float low, float high, float softness, float biasFactor, float relaxationFactor)
151  {
152  InternalHingeConstraint.SetLimit(low, high, softness, biasFactor, relaxationFactor);
153  }
154 
155  /// <summary>
156  /// Enables the angular motor.
157  /// </summary>
158  /// <param name="enableMotor">if set to <c>true</c> [enable motor].</param>
159  /// <param name="targetVelocity">The target velocity.</param>
160  /// <param name="maxMotorImpulse">The maximum motor impulse.</param>
161  public void EnableAngularMotor(bool enableMotor, float targetVelocity, float maxMotorImpulse)
162  {
163  InternalHingeConstraint.EnableAngularMotor(enableMotor, targetVelocity, maxMotorImpulse);
164  }
165 
166  /// <summary>
167  /// Enables the motor.
168  /// </summary>
169  /// <param name="enableMotor">if set to <c>true</c> [enable motor].</param>
170  public void EnableMotor(bool enableMotor)
171  {
172  InternalHingeConstraint.EnableMotor(enableMotor);
173  }
174 
175  /// <summary>
176  /// Sets the motor target.
177  /// </summary>
178  /// <param name="targetAngle">The target angle.</param>
179  /// <param name="dt">The dt.</param>
180  public void SetMotorTarget(float targetAngle, float dt)
181  {
182  InternalHingeConstraint.SetMotorTarget(targetAngle, dt);
183  }
184 
185  /// <summary>
186  /// Sets the motor target.
187  /// </summary>
188  /// <param name="qAinB">The q ain b.</param>
189  /// <param name="dt">The dt.</param>
190  public void SetMotorTarget(Quaternion qAinB, float dt)
191  {
192  InternalHingeConstraint.SetMotorTarget(qAinB, dt);
193  }
194 
195  internal BulletSharp.HingeConstraint InternalHingeConstraint;
196  }
197 }
void EnableAngularMotor(bool enableMotor, float targetVelocity, float maxMotorImpulse)
Enables the angular motor.
void SetLimit(float low, float high, float softness, float biasFactor)
Sets the limit.
void SetLimit(float low, float high)
Sets the limit.
void SetLimit(float low, float high, float softness)
Sets the limit.
void SetMotorTarget(float targetAngle, float dt)
Sets the motor target.
Represents a four dimensional mathematical quaternion.
Definition: Quaternion.cs:45
void SetMotorTarget(Quaternion qAinB, float dt)
Sets the motor target.
using SiliconStudio.Paradox. Physics
void EnableMotor(bool enableMotor)
Enables the motor.
void SetFrames(Matrix frameA, Matrix frameB)
Sets the frames.
void SetLimit(float low, float high, float softness, float biasFactor, float relaxationFactor)
Sets the limit.
Represents a 4x4 mathematical matrix.
Definition: Matrix.cs:47