Spinning Topp Logo BlackTopp Studios
inc
generic6dofconstraint.h
1 // © Copyright 2010 - 2016 BlackTopp Studios Inc.
2 /* This file is part of The Mezzanine Engine.
3 
4  The Mezzanine Engine is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  The Mezzanine Engine is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16 */
17 /* The original authors have included a copy of the license specified above in the
18  'Docs' folder. See 'gpl.txt'
19 */
20 /* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21  Build professional software and charge for their product.
22 
23  However there are some practical restrictions, so if your project involves
24  any of the following you should contact us and we will try to work something
25  out:
26  - DRM or Copy Protection of any kind(except Copyrights)
27  - Software Patents You Do Not Wish to Freely License
28  - Any Kind of Linking to Non-GPL licensed Works
29  - Are Currently In Violation of Another Copyright Holder's GPL License
30  - If You want to change our code and not add a few hundred MB of stuff to
31  your distribution
32 
33  These and other limitations could cause serious legal problems if you ignore
34  them, so it is best to simply contact us or the Free Software Foundation, if
35  you have any questions.
36 
37  Joseph Toppi - toppij@gmail.com
38  John Blackwood - makoenergy02@gmail.com
39 */
40 #ifndef _physicsgeneric6dofconstraint_h
41 #define _physicsgeneric6dofconstraint_h
42 
43 #include "Physics/dualtransformconstraint.h"
44 
45 class btGeneric6DofConstraint;
46 
47 namespace Mezzanine
48 {
49  namespace Physics
50  {
51  ///////////////////////////////////////////////////////////////////////////////
52  /// @brief Create simple but specific limits on any axis of movement or rotation
53  /// @details Provides optional limits on the x, y, and z for rotation and
54  /// translation. You can get the ID of the axis with GetValidLinearAxes() or
55  /// GetValidAngularAxes() for this particular constraint at the time of this
56  /// writing the constraint axis looked liked this:
57  /// - 0: Translation X
58  /// - 1: Translation Y
59  /// - 2: Translation Z
60  /// - 3: Rotation X
61  /// - 4: Rotation Y
62  /// - 5: Rotation Z
63  ///
64  /// This has to perform a larger amount of calculations and should be used only
65  /// when other simpler constraints have been ruled out.
66  /// @n @n
67  /// As with all limits when the upper and lower limits match the two actors will
68  /// be locked on that axis and relative translation or rotation will not be
69  /// permitted (within the bounds or error correction). If the Lower limit is
70  /// lower than the Upper limit a range of translation or rotation will be
71  /// allowed. If the Lower limit is higher than the Upper limit this will cause
72  /// the system to realized that no position can satisfy the constraint and
73  /// no restriction will be enforced.
74  /// @n @n
75  /// Each of the Axis also has a motor that can be enabled to cause a specified
76  /// amount of translation or rotation. To aid in selection of specific Axis,
77  /// you should use the UsableAxis enum
78  ///////////////////////////////////////
80  {
81  public:
82  /// @brief Identify the Axis a bit easier when iterating over them is less convienent than typing an Identifier.
84  {
85  LinearStart = 0, ///< Convenience type for loops.
86  LinearX = 0, ///< Translation on the X axis.
87  LinearY = 1, ///< Translation on the Y axis.
88  LinearZ = 2, ///< Translation on the Z axis.
89  LinearEnd = 3, ///< Convenience type for loops.
90  AngularStart = 3, ///< Convenience type for loops.
91  AngularX = 3, ///< Rotation on the X axis.
92  AngularY = 4, ///< Rotation on the Y axis.
93  AngularZ = 5, ///< Rotation on the Z axis.
94  AngularEnd = 6, ///< Convenience type for loops.
95 
96  AngularXAsRotationAxis = 0, ///< Rotation on the X axis, when working with only rotational Axis.
97  AngularYAsRotationAxis = 1, ///< Rotation on the Y axis, when working with only rotational Axis.
98  AngularZAsRotationAxis = 2 ///< Rotation on the Z axis, when working with only rotational Axis.
99  };
100  protected:
101  /// @internal
102  /// @brief The internal constraint that this class encapsulates.
103  btGeneric6DofConstraint* Generic6dof;
104 
105  /// @copydoc DualTransformConstraint::CreateConstraint(RigidProxy*, RigidProxy*, const Transform&, const Transform&)
106  virtual void CreateConstraint(RigidProxy* RigidA, RigidProxy* RigidB, const Transform& TransA, const Transform& TransB);
107  /// @copydoc DualTransformConstraint::DestroyConstraint()
108  virtual void DestroyConstraint();
109 
110  /// @internal
111  /// @brief Single body inheritance constructor.
112  /// @param ID The unique identifier assigned to this constraint.
113  /// @param Prox1 A pointer to the first/only proxy that will be constrained.
114  /// @param Creator A pointer to the manager that created this constraint.
115  Generic6DofConstraint(const UInt32 ID, RigidProxy* Prox1, PhysicsManager* Creator);
116  /// @internal
117  /// @brief Dual body inheritance constructor.
118  /// @param ID The unique identifier assigned to this constraint.
119  /// @param Prox1 A pointer to the first proxy that will be constrained.
120  /// @param Prox2 A pointer to the second proxy that will be constrained.
121  /// @param Creator A pointer to the manager that created this constraint.
122  Generic6DofConstraint(const UInt32 ID, RigidProxy* Prox1, RigidProxy* Prox2, PhysicsManager* Creator);
123  public:
124  /// @brief Dual body constructor.
125  /// @param ID The unique identifier assigned to this constraint.
126  /// @param ProxyA The First proxy to be bound.
127  /// @param ProxyB The Second proxy to be bound.
128  /// @param TransA The offset and rotation from ProxyAs center of gravity to get to match an offset from ProxyB.
129  /// @param TransB The offset and rotation from ProxyBs center of gravity.
130  /// @param Creator A pointer to the manager that created this constraint.
131  Generic6DofConstraint(const UInt32 ID, RigidProxy* ProxyA, RigidProxy* ProxyB, const Transform& TransA, const Transform& TransB, PhysicsManager* Creator);
132  /// @brief Single body constructor.
133  /// @param ID The unique identifier assigned to this constraint.
134  /// @param ProxyB The proxy to be bound to the world.
135  /// @param TransB The offset and rotation for the ProxyB pivot/hinge/joint.
136  /// @param Creator A pointer to the manager that created this constraint.
137  Generic6DofConstraint(const UInt32 ID, RigidProxy* ProxyB, const Transform& TransB, PhysicsManager* Creator);
138  /// @brief XML constructor.
139  /// @param SelfRoot An XML::Node containing the data to populate this class with.
140  /// @param Creator A pointer to the manager that created this constraint.
141  Generic6DofConstraint(const XML::Node& SelfRoot, PhysicsManager* Creator);
142  /// @brief Class destructor.
143  virtual ~Generic6DofConstraint();
144 
145  ////////////////////////////////////////////////////////////////////////////////
146  // Location and Rotation
147 
148  /// @copydoc DualTransformConstraint::SetPivotTransforms(const Transform&, const Transform&)
149  virtual void SetPivotTransforms(const Transform& TransA, const Transform& TransB);
150  /// @copydoc DualTransformConstraint::SetPivotATransform(const Transform&)
151  virtual void SetPivotATransform(const Transform& TransA);
152  /// @copydoc DualTransformConstraint::SetPivotBTransform(const Transform&)
153  virtual void SetPivotBTransform(const Transform& TransB);
154  /// @copydoc DualTransformConstraint::GetPivotATransform()
155  virtual Transform GetPivotATransform() const;
156  /// @copydoc DualTransformConstraint::GetPivotBTransform()
157  virtual Transform GetPivotBTransform() const;
158 
159  /// @copydoc DualTransformConstraint::SetPivotALocation(const Vector3&)
160  virtual void SetPivotALocation(const Vector3& Location);
161  /// @copydoc DualTransformConstraint::SetPivotBLocation(const Vector3&)
162  virtual void SetPivotBLocation(const Vector3& Location);
163  /// @copydoc DualTransformConstraint::GetPivotALocation()
164  virtual Vector3 GetPivotALocation() const;
165  /// @copydoc DualTransformConstraint::GetPivotBLocation()
166  virtual Vector3 GetPivotBLocation() const;
167 
168  /// @copydoc DualTransformConstraint::SetPivotARotation(const Quaternion&)
169  virtual void SetPivotARotation(const Quaternion& Rotation);
170  /// @copydoc DualTransformConstraint::SetPivotBRotation(const Quaternion&)
171  virtual void SetPivotBRotation(const Quaternion& Rotation);
172  /// @copydoc DualTransformConstraint::GetPivotARotation()
173  virtual Quaternion GetPivotARotation() const;
174  /// @copydoc DualTransformConstraint::GetPivotBRotation()
175  virtual Quaternion GetPivotBRotation() const;
176 
177  ////////////////////////////////////////////////////////////////////////////////
178  // Utility
179 
180  /// @brief Sets whether or not an offset of the constraint frame should be used to calculate internal data.
181  /// @param FrameOffset The full effect of this being true or false is uknown, but internal documentation suggests "true" provides more stable results.
182  virtual void SetUseFrameOffset(const Boole FrameOffset);
183  /// @brief Gets whether or not an offset of the constraint frame should be used to calculate internal data.
184  /// @return Returns whether or not an offset in the constraint frame is being used by the internal constraint.
185  virtual Boole GetUseFrameOffset() const;
186  /// @brief Sets whether or not to perform linear math from ProxyA's perspective.
187  /// @param UseRefFrameA True to perform math from ProxyA's perspective, false to perform math from ProxyB's perspective. Initial Value: false.
188  void SetUseLinearReferenceFrameA(const Boole UseRefFrameA);
189  /// @brief Gets whether or not to perform linear math from ProxyA's perspective.
190  /// @return Returns true if math is being done from ProxyA's perspective, false if math is being done from ProxyB's perspective.
191  Boole GetUseLinearReferenceFrameA() const;
192 
193  /// @brief Convert an Axis from a full 6 digit range to a 3 digit range.
194  /// @remarks Due to the way this is stored internally, All the axis are listed from from
195  /// 0 to 2. So rather than throw an exception(or have undefined behavior) if the Axis
196  /// selected one of those, this select the axis like this:
197  /// - 0, 3: Rotation X
198  /// - 1, 4: Rotation Y
199  /// - 2, 5: Rotation Z
200  /// @param Axis the Axis ID to be converted.
201  /// @return A number in the range of 0-2. Useful for error checking or converting an Axis value from all axes to Linear or Angular only axis range.
202  virtual Whole ConvertFrom6AxisTo3Axis(const Whole Axis) const;
203  /// @brief Convert an angular Axis from a 3 digit range to a full 6 digit range.
204  /// @remarks This method assumes the Axis being passed in represents an Angular axis, and if it's value is less than three, three will be
205  /// added to it. If this is used with a linear Axis, you'll likely have a bad time.
206  /// @param Axis the Axis ID to be converted.
207  /// @return Returns a number in the range of 0-5.
208  virtual Whole ConvertAngularTo6Axis(const Whole Axis) const;
209 
210  ////////////////////////////////////////////////////////////////////////////////
211  // Basic Limit Accessors
212 
213  /// @brief Change the upper and lower limit for one axis of translation or rotation limit
214  /// @param Axis The axis to change
215  /// @param Lower The new lower limit
216  /// @param UpperThe new Higher limit
217  virtual void SetLimit(Whole Axis, Real Lower, Real Upper);
218 
219  /// @brief Set the Upper limits on translation
220  /// @return A Vector3 that stores the upper limit x, y and z that cannot be exceeded
221  virtual void SetLinearLimitLower(const Vector3& Limit);
222  /// @brief Get the Upper limits on translation
223  /// @return A Vector3 that stores the upper limit x, y and z that cannot be exceeded
224  virtual Vector3 GetLinearLimitLower() const;
225  /// @brief Set the lower limits on translation
226  /// @param Limit A Vector3 that stores the lower limit x, y and z that cannot be exceeded
227  virtual void SetLinearLimitUpper(const Vector3& Limit);
228  /// @brief Get the lower limits on translation
229  /// @param Limit A Vector3 that stores the lower limit x, y and z that cannot be exceeded
230  virtual Vector3 GetLinearLimitUpper() const;
231 
232  /// @brief Sets the lower linear limit on a specific axis of the constraint.
233  /// @param Limit The limit to apply to the specified axis.
234  /// @param TranslationAxis The Axis to work with.
235  void SetLinearLimitLowerOnAxis(const Real Limit, Whole TranslationAxis);
236  /// @brief Get a specific lower translation limit.
237  /// @param TranslationAxis The Axis to work with.
238  /// @return A real containing the specified lower limit.
239  Real GetLinearLimitLowerOnAxis(Whole TranslationAxis) const;
240  /// @brief Sets the upper linear limit on a specific axis of the constraint.
241  /// @param Limit The limit to apply to the specified axis.
242  /// @param TranslationAxis The Axis to work with.
243  void SetLinearLimitUpperOnAxis(const Real Limit, Whole TranslationAxis);
244  /// @brief Get a specific upper translation limit.
245  /// @param TranslationAxis The Axis to work with.
246  /// @return A real containing the specified upper limit.
247  Real GetLinearLimitUpperOnAxis(Whole TranslationAxis) const;
248 
249  /// @brief Set the Upper limits on rotation
250  /// @param Limit A Vector3 that store the lower limit x, y and z rotation in radians
251  virtual void SetAngularLimitUpper(const Vector3& Limit);
252  /// @brief Get the Power limits on rotation
253  /// @return Limit A Vector3 that stores the lower limit x, y and z rotation in radians
254  virtual Vector3 GetAngularLimitUpper() const;
255  /// @brief Set the Lower limits on rotation
256  /// @param Limit A Vector3 that store the upper limit x, y and z rotation in radians
257  virtual void SetAngularLimitLower(const Vector3& Limit);
258  /// @brief Get the Upper limits on rotation
259  /// @return Limit A Vector3 that stores the upper limit x, y and z rotation in radians
260  virtual Vector3 GetAngularLimitLower() const;
261 
262  /// @brief Sets the lower rotation limit on a specific axis of the constraint.
263  /// @param Limit The limit to apply to the specified axis.
264  /// @param RotationAxis The Axis to work with.
265  void SetAngularLimitLowerOnAxis(const Real Limit, Whole RotationAxis);
266  /// @brief Get a specific lower rotation limit.
267  /// @param RotationAxis The Axis to work with.
268  /// @return A real containing the specified lower limit.
269  Real GetAngularLimitLowerOnAxis(Whole RotationAxis) const;
270  /// @brief Sets the upper rotation limit on a specific axis of the constraint.
271  /// @param Limit The limit to apply to the specified axis.
272  /// @param RotationAxis The Axis to work with.
273  void SetAngularLimitUpperOnAxis(const Real Limit, Whole RotationAxis);
274  /// @brief Get a specific upper rotation limit.
275  /// @param RotationAxis The Axis to work with.
276  /// @return A real containing the specified upper limit.
277  Real GetAngularLimitUpperOnAxis(Whole RotationAxis) const;
278 
279  ////////////////////////////////////////////////////////////////////////////////
280  // Angular Limit and Motor Details
281 
282  /// @brief Set the Maximimum amount of force applied to ensure limits are not surpassed.
283  /// @param MaxLimitForces A Vector3 containing the X, Y and Z Maximium forces.
284  virtual void SetAngularLimitMaxForce(const Vector3& MaxLimitForces);
285  /// @brief Get the Maximimum amount of force applied to ensure limits are not surpassed.
286  /// @return A Vector3 with the forces on the X, Y and Z angular Axis.
287  virtual Vector3 GetAngularLimitMaxForce() const;
288  /// @brief Set the Maximimum amount of force applied to ensure a limit on one axis is not surpassed.
289  /// @param MaxLimitForce The new maximum force.
290  /// @param Axis The Angular Axis to be set, as per AxisToAngularAxis(Whole).
291  virtual void SetAngularLimitMaxForceOnAxis(const Real MaxLimitForce, Whole Axis);
292  /// @brief Get the Maximimum amount of force applied to ensure a limit one axis is not surpassed.
293  /// @param Axis The Angular Axis to get, as per AxisToAngularAxis(Whole).
294  /// @return A Real with the force for the Given Axis.
295  virtual Real GetAngularLimitMaxForceOnAxis(Whole Axis) const;
296 
297  /// @brief Set the Target velocity of the motor on each anuglar axis.
298  /// @param Velocities A Vector3 containing the X, Y and Z Target Velocites.
299  virtual void SetAngularMotorTargetVelocity(const Vector3& Velocities);
300  /// @brief Get the target velocity for all angular Axis
301  /// @return A Vector3 with the TAger Velocities on the X, Y and Z angular Axis.
302  virtual Vector3 GetAngularMotorTargetVelocity() const;
303  /// @brief For one Axis, set the target velocity of the angular motor.
304  /// @param Velocity The new Target Velovity.
305  /// @param Axis The Angular Axis to be set, as per AxisToAngularAxis(Whole).
306  virtual void SetAngularMotorTargetVelocityOnAxis(const Real Velocity, Whole Axis);
307  /// @brief Get the Target Velocity for one axis.
308  /// @param Axis The Angular Axis to get, as per AxisToAngularAxis(Whole).
309  /// @return A Real with the force for the Given Axis.
310  virtual Real GetAngularMotorTargetVelocityOnAxis(Whole Axis) const;
311 
312  /// @brief Set the Angular Motor Maximum force on all 3 rotational axis
313  /// @param Forces A Vector3 with the Max Motor Force for each axis.
314  virtual void SetAngularMotorMaxForce(const Vector3& Forces);
315  /// @brief Get the Max Motor Force for each Axis
316  /// @return A Vector3 with the max force on the X, Y and Z angular Axis.
317  virtual Vector3 GetAngularMotorMaxForce() const;
318  /// @brief For one Axis, set the Maximimum Motor Force.
319  /// @param Force The new Max motor force.
320  /// @param Axis The Angular Axis to be set, as per AxisToAngularAxis(Whole).
321  virtual void SetAngularMotorMaxForceOnAxis(const Real Force, Whole Axis);
322  /// @brief Get the Max motor Force on a certain Axis.
323  /// @param Axis The Angular Axis to get, as per AxisToAngularAxis(Whole).
324  /// @return A Real with the Max Motor Force for the Given Axis.
325  virtual Real GetAngularMotorMaxForceOnAxis(Whole Axis) const;
326 
327  /// @brief Set the Angular Motor Damping for each Angular Axis.
328  /// @param Dampings A Vector3 with Damping value for the X, Y and Z axis.
329  virtual void SetAngularMotorDamping(const Vector3& Dampings);
330  /// @brief Get the Damping for all Angular Axis.
331  /// @return A Vector3 with the forces on the X, Y and Z angular Axis.
332  virtual Vector3 GetAngularMotorDamping() const;
333  /// @brief For one Axis, set the Damping.
334  /// @param Damping The new amount to Damp rotation on the given Axis.
335  /// @param Axis The Angular Axis to be set, as per AxisToAngularAxis(Whole).
336  virtual void SetAngularMotorDampingOnAxis(const Real Damping, Whole Axis);
337  /// @brief Get the Damping for one given Axis.
338  /// @param Axis The Angular Axis to get, as per AxisToAngularAxis(Whole).
339  /// @return A Real with the XXX for the Given Axis.
340  virtual Real GetAngularMotorDampingOnAxis(Whole Axis) const;
341 
342  /// @brief Set the Bounciness/Restition for rotation on all three Axis
343  /// @param Restitutions A Vector3 containing all the New Bounciness values
344  virtual void SetAngularMotorRestitution(const Vector3& Restitutions);
345  /// @brief Get the Restitution values for all three axis
346  /// @return A Vector3 with the forces on the X, Y and Z angular Axis.
347  virtual Vector3 GetAngularMotorRestitution() const;
348  /// @brief For one Axis, set the Restitution/Bounciness/
349  /// @param Restitution The new value for the given Axis.
350  /// @param Axis The Angular Axis to be set, as per AxisToAngularAxis(Whole).
351  virtual void SetAngularMotorRestitutionOnAxis(const Real Restitution, Whole Axis);
352  /// @brief Get the Restitution/Bounciness for a single Axis
353  /// @param Axis The Angular Axis to get, as per AxisToAngularAxis(Whole).
354  /// @return A Real with the Restitution for the Given Axis.
355  virtual Real GetAngularMotorRestitutionOnAxis(Whole Axis) const;
356 
357  /// @brief Set whether or not the motor is enabled for all Axis Simultaneously.
358  /// @param Enableds A Vector3 that will be interpretted as 3 true/false values where 0 is false and any other value it true.
359  virtual void SetAngularMotorEnabled(const Vector3& Enableds);
360  /// @brief Get a Vector3 with 3 zero or nonzero values that store whether or not a given rotational motor is enable.
361  /// @return A Vector3 with the forces on the X, Y and Z angular Axis.
362  virtual Vector3 GetAngularMotorEnabled() const;
363  /// @brief For one Axis, set whether or not the motor is enabled
364  /// @param Enabled Is the motor enabled? TRue for yes, false for no.
365  /// @param Axis The Angular Axis to be set, as per AxisToAngularAxis(Whole).
366  virtual void SetAngularMotorEnabledOnAxis(const Boole Enabled, Whole Axis);
367  /// @brief Is a specific rotational motor enabled.
368  /// @param Axis The Angular Axis to get, as per AxisToAngularAxis(Whole).
369  /// @return A Boole that is true if the given Axis is enabled.
370  virtual Boole GetAngularMotorEnabledOnAxis(Whole Axis) const;
371 
372  ////////////////////////////////////////////////////////////////////////////////
373  // Linear Limit and Motor Details
374 
375  /// @brief Set the Softness of the linear Limits.
376  /// @param Softness How spongy, how much give does the constraint have.
377  virtual void SetLinearLimitSoftness(const Real Softness);
378  /// @brief Get the Softness of the linear Limits.
379  /// @return The Softness as a real.
380  virtual Real GetLinearLimitSoftness() const;
381 
382  /// @brief Set the Damping of the linear Limits.
383  /// @param Damping The new damping value placed on forces the limits impose.
384  virtual void SetLinearLimitDamping(const Real Damping);
385  /// @brief Get the Damping of the linear Limits.
386  /// @return The Damping as a real.
387  virtual Real GetLinearLimitDamping() const;
388 
389  /// @brief Set the Restitution of the linear Limits.
390  /// @param Restitution How bouncy are the limits.
391  virtual void SetLinearLimitRestitution(const Real Restitution);
392  /// @brief Get the Restitution of the linear Limits.
393  /// @return The Restitution as a real.
394  virtual Real GetLinearLimitRestitution() const;
395 
396  /// @brief Set the Linear Motor Maximum force on all 3 translation axis.
397  /// @param Forces A Vector3 with the Max Motor Force for each axis.
398  virtual void SetLinearMotorMaxForce(const Vector3& Forces);
399  /// @brief For one Axis, set the Maximimum Motor Force.
400  /// @param Force The new Max motor force.
401  /// @param Axis The Linear Axis to be set.
402  virtual void SetLinearMotorMaxForceOnAxis(const Real Force, Whole Axis);
403  /// @brief Get the Max Motor Force for each Axis.
404  /// @return A Vector3 with the max force on the X, Y and Z Linear Axis.
405  virtual Vector3 GetLinearMotorMaxForce() const;
406  /// @brief Get the Max motor Force on a certain Axis.
407  /// @param Axis The Linear Axis to get.
408  /// @return A Real with the Max Motor Force for the Given Axis.
409  virtual Real GetLinearMotorMaxForceOnAxis(Whole Axis) const;
410 
411  /// @brief Set the Target velocity of the motor on each anuglar axis.
412  /// @param Velocities A Vector3 containing the X, Y and Z Target Velocites.
413  virtual void SetLinearMotorTargetVelocity(const Vector3& Velocities);
414  /// @brief For one Axis, set the target velocity of the Linear motor.
415  /// @param Velocity The new Target Velovity.
416  /// @param Axis The Linear Axis to be set.
417  virtual void SetLinearMotorTargetVelocityOnAxis(const Real Velocity, Whole Axis);
418  /// @brief Get the target velocity for all Linear Axis
419  /// @return A Vector3 with the Target Velocities on the X, Y and Z Linear Axis.
420  virtual Vector3 GetLinearMotorTargetVelocity() const;
421  /// @brief Get the Target Velocity for one axis.
422  /// @param Axis The Linear Axis to get.
423  /// @return A Real with the force for the Given Axis.
424  virtual Real GetLinearMotorTargetVelocityOnAxis(Whole Axis) const;
425 
426  /// @brief Set whether or not the motor is enabled for all Linear Axis Simultaneously.
427  /// @param Enableds A Vector3 that will be interpretted as 3 true/false values where 0 is false and any other value it true.
428  virtual void SetLinearMotorEnabled(const Vector3& Enableds);
429  /// @brief For one Axis, set whether or not the motor is enabled
430  /// @param Enabled Is the motor enabled? True for yes, false for no.
431  /// @param Axis The Linear Axis to be set.
432  virtual void SetLinearMotorEnabledOnAxis(const Boole Enabled, Whole Axis);
433  /// @brief Get a Vector3 with 3 zero or nonzero values that store whether or not a given rotational motor is enable.
434  /// @return A Vector3 with the forces on the X, Y and Z Linear Axis.
435  virtual Vector3 GetLinearMotorEnabled() const;
436  /// @brief Is a specific Linear motor enabled.
437  /// @param Axis The Linear Axis to get.
438  /// @return A Boole that is true if the given Axis is enabled.
439  virtual Boole GetLinearMotorEnabledOnAxis(Whole Axis) const;
440 
441  ////////////////////////////////////////////////////////////////////////////////
442  // Axis Params
443 
444  /// @copydoc Constraint::GetValidParamsOnAxis(int) const
445  virtual Constraint::ParamList GetValidParamsOnAxis(int Axis) const;
446  /// @copydoc Constraint::GetValidLinearAxes() const
447  virtual Constraint::AxisList GetValidLinearAxes() const;
448  /// @copydoc Constraint::GetValidAngularAxes() const
449  virtual Constraint::AxisList GetValidAngularAxes() const;
450  /// @copydoc Constraint::ValidAngularAxis(ConstraintParam,int) const
451  virtual Boole HasParamBeenSet(ConstraintParam Param, int Axis) const;
452 
453  ///////////////////////////////////////////////////////////////////////////////
454  // Serialization
455 
456  /// @copydoc Constraint::ProtoSerializeProperties(XML::Node&) const
457  virtual void ProtoSerializeProperties(XML::Node& SelfRoot) const;
458  /// @copydoc Constraint::ProtoDeSerializeProperties(const XML::Node&)
459  virtual void ProtoDeSerializeProperties(const XML::Node& SelfRoot);
460 
461  /// @copydoc Constraint::GetDerivedSerializableName() const
462  virtual String GetDerivedSerializableName() const;
463  /// @brief Get the name of the the XML tag the class will leave behind as its instances are serialized.
464  /// @return A string containing the name of this class.
465  static String GetSerializableName();
466 
467  ///////////////////////////////////////////////////////////////////////////////
468  // Internal
469 
470  /// @copydoc Constraint::_GetConstraintBase() const
471  virtual btTypedConstraint* _GetConstraintBase() const;
472  };//Generic6DofConstraint
473  }//Physics
474 }//Mezzanine
475 
476 #endif
std::vector< int > AxisList
Used to Store lists of Int Axis for return types.
Definition: constraint.h:124
All constraints that track rotation and location of the Pivot relative to each Actor inherit from thi...
bool Boole
Generally acts a single bit, true or false.
Definition: datatypes.h:173
UsableAxis
Identify the Axis a bit easier when iterating over them is less convienent than typing an Identifier...
Create simple but specific limits on any axis of movement or rotation.
float Real
A Datatype used to represent a real floating point number.
Definition: datatypes.h:141
A light-weight handle for manipulating nodes in DOM tree.
Definition: node.h:89
uint32_t UInt32
An 32-bit unsigned integer.
Definition: datatypes.h:126
btGeneric6DofConstraint * Generic6dof
The internal constraint that this class encapsulates.
ConstraintParam
Used by constraints for setting some parameters.
Definition: constraint.h:61
This is a proxy from which rigid body proxys are handled.
Definition: rigidproxy.h:102
Stores information about relative location and rotation in 3d space.
Definition: transform.h:62
std::vector< ConstraintParam > ParamList
Used to Store lists of param for return types.
Definition: constraint.h:120
This is simply a place for storing all the Physics Related functions.
This is used to represent a point in space, or a vector through space.
Definition: vector3.h:77
#define MEZZ_LIB
Some platforms require special decorations to denote what is exported/imported in a share library...
The bulk of the engine components go in this namspace.
Definition: actor.cpp:56
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
Definition: datatypes.h:151
This is used to store information about rotation in 3d space.
Definition: quaternion.h:68
std::string String
A datatype used to a series of characters.
Definition: datatypes.h:159