MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sliderconstraint.h
1 // © Copyright 2010 - 2014 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 _physicssliderconstraint_h
41 #define _physicssliderconstraint_h
42 
43 #include "Physics/dualtransformconstraint.h"
44 
45 class btSliderConstraint;
46 
47 namespace Mezzanine
48 {
49  namespace Physics
50  {
51  ///////////////////////////////////////////////////////////////////////////////
52  /// @class SliderConstraint
53  /// @headerfile constraint.h
54  /// @brief
55  /// @details This class is incomplete
56  ///////////////////////////////////////
58  {
59  protected:
60  /// @brief Bullet constraint that this class encapsulates.
61  btSliderConstraint* Slider;
62  public:
63  SliderConstraint(RigidProxy* ProxyA, RigidProxy* ProxyB, const Vector3& VectorA, const Vector3& VectorB, const Quaternion& QuaternionA, const Quaternion& QuaternionB, bool UseLinearReferenceA);
64  /// @brief Two body Terse constructor.
65  /// @param ProxyA The First proxy to be bound.
66  /// @param ProxyB The Second proxy to be bound.
67  /// @param TransformA The offset and rotation from ProxyA's center of gravity to get to match an offset from ProxyB.
68  /// @param TransformB The offset and rotation from ProxyB's center of gravity.
69  /// @param UseLinearReferenceA Perform Linear math from ProxyA's perspective, default to false.
70  SliderConstraint(RigidProxy* ProxyA, RigidProxy* ProxyB, const Transform& TransformA, const Transform& TransformB, bool UseLinearReferenceA = false);
71  SliderConstraint(RigidProxy* ProxyB, const Vector3& VectorB, const Quaternion& QuaternionB, bool UseLinearReferenceA);
72  /// @brief Class destructor.
73  virtual ~SliderConstraint();
74 
75  ////////////////////////////////////////////////////////////////////////////////
76  // SliderConstraint Location and Rotation
77  /// @copydoc DualTransformConstraint::SetPivotATransform(const Transform&)
78  virtual void SetPivotATransform(const Transform& TranA);
79  /// @copydoc DualTransformConstraint::SetPivotBTransform(const Transform&)
80  virtual void SetPivotBTransform(const Transform& TranB);
81  /// @copydoc DualTransformConstraint::GetPivotATransform()
82  virtual Transform GetPivotATransform() const;
83  /// @copydoc DualTransformConstraint::GetPivotBTransform()
84  virtual Transform GetPivotBTransform() const;
85 
86  /// @copydoc DualTransformConstraint::SetPivotALocation(const Vector3&)
87  virtual void SetPivotALocation(const Vector3& Location);
88  /// @copydoc DualTransformConstraint::SetPivotBLocation(const Vector3&)
89  virtual void SetPivotBLocation(const Vector3& Location);
90  /// @copydoc DualTransformConstraint::GetPivotALocation()
91  virtual Vector3 GetPivotALocation() const;
92  /// @copydoc DualTransformConstraint::GetPivotBLocation()
93  virtual Vector3 GetPivotBLocation() const;
94 
95  /// @copydoc DualTransformConstraint::SetPivotARotation(const Quaternion&)
96  virtual void SetPivotARotation(const Quaternion& Rotation);
97  /// @copydoc DualTransformConstraint::SetPivotBRotation(const Quaternion&)
98  virtual void SetPivotBRotation(const Quaternion& Rotation);
99  /// @copydoc DualTransformConstraint::GetPivotARotation()
100  virtual Quaternion GetPivotARotation() const;
101  /// @copydoc DualTransformConstraint::GetPivotBRotation()
102  virtual Quaternion GetPivotBRotation() const;
103 
104  virtual void SetUpperLinLimit(const Real& UpperLimit);
105  virtual void SetUpperAngLimit(const Real& UpperLimit);
106  virtual void SetLowerLinLimit(const Real& LowerLimit);
107  virtual void SetLowerAngLimit(const Real& LowerLimit);
108  virtual void SetPoweredLinMotor(bool OnOff);
109  virtual void SetTargetLinMotorVelocity(const Real& TargetLinMotorVelocity);
110  virtual void SetMaxLinMotorForce(const Real& MaxLinMotorForce);
111  virtual void SetPoweredAngMotor(bool OnOff);
112  virtual void SetTargetAngMotorVelocity(const Real& TargetAngMotorVelocity);
113  virtual void SetMaxAngMotorForce(const Real& MaxAngMotorForce);
114  virtual void SetUseFrameOffset(bool FrameOffset);
115  virtual void SetSoftnessDirLin(const Real& SoftnessDirLin);
116  virtual void SetRestitutionDirLin(const Real& RestitutionDirLin);
117  virtual void SetDampingDirLin(const Real& DampingDirLin);
118  virtual void SetSoftnessDirAng(const Real& SoftnessDirAng);
119  virtual void SetRestitutionDirAng(const Real& RestitutionDirAng);
120  virtual void SetDampingDirAng(const Real& DampingDirAng);
121  virtual void SetSoftnessLimLin(const Real& SoftnessLimLin);
122  virtual void SetRestitutionLimLin(const Real& RestitutionLimLin);
123  virtual void SetDampingLimLin(const Real& DampingLimLin);
124  virtual void SetSoftnessLimAng(const Real& SoftnessLimAng);
125  virtual void SetRestitutionLimAng(const Real& RestitutionLimAng);
126  virtual void SetDampingLimAng(const Real& DampingLimAng);
127  virtual void SetSoftnessOrthoLin(const Real& SoftnessOrthoLin);
128  virtual void SetRestitutionOrthoLin(const Real& RestitutionOrthoLin);
129  virtual void SetDampingOrthoLin(const Real& DampingOrthoLin);
130  virtual void SetSoftnessOrthoAng(const Real& SoftnessOrthoAng);
131  virtual void SetRestitutionOrthoAng(const Real& RestitutionOrthoAng);
132  virtual void SetDampingOrthoAng(const Real& DampingOrthoAng);
133 
134  ////////////////////////////////////////////////////////////////////////////////
135  // SliderConstraint Axis, Params and other Details
136  /// @copydoc Constraint::ValidParamOnAxis(int) const
137  virtual Constraint::ParamList ValidParamOnAxis(int Axis) const;
138  /// @copydoc Constraint::ValidLinearAxis() const
139  virtual Constraint::AxisList ValidLinearAxis() const;
140  /// @copydoc Constraint::ValidAngularAxis() const
141  virtual Constraint::AxisList ValidAngularAxis() const;
142  /// @copydoc Constraint::ValidAngularAxis(ConstraintParam,int) const
143  virtual bool HasParamBeenSet(ConstraintParam Param, int Axis) const;
144 
145  /// @copydoc Constraint::GetConstraintBase() const
146  virtual btTypedConstraint* GetConstraintBase() const;
147  };//SliderConstraint
148  }//Physics
149 }//Mezzanine
150 
151 #endif