18 #ifndef BT_HINGECONSTRAINT_H
19 #define BT_HINGECONSTRAINT_H
21 #define _BT_USE_CENTER_LIMIT_ 1
30 #ifdef BT_USE_DOUBLE_PRECISION
31 #define btHingeConstraintData btHingeConstraintDoubleData2 //rename to 2 for backwards compatibility, so we can still load the 'btHingeConstraintDoubleData' version
32 #define btHingeConstraintDataName "btHingeConstraintDoubleData2"
34 #define btHingeConstraintData btHingeConstraintFloatData
35 #define btHingeConstraintDataName "btHingeConstraintFloatData"
36 #endif //BT_USE_DOUBLE_PRECISION
52 #ifdef IN_PARALLELL_SOLVER
65 #ifdef _BT_USE_CENTER_LIMIT_
114 virtual void buildJacobian();
163 m_angularOnly = angularOnly;
168 m_enableAngularMotor = enableMotor;
169 m_motorTargetVelocity = targetVelocity;
170 m_maxMotorImpulse = maxMotorImpulse;
184 #ifdef _BT_USE_CENTER_LIMIT_
185 m_limit.
set(low, high, _softness, _biasFactor, _relaxationFactor);
189 m_limitSoftness = _softness;
190 m_biasFactor = _biasFactor;
191 m_relaxationFactor = _relaxationFactor;
205 btVector3 axisInB = m_rbA.getCenterOfMassTransform().getBasis() * axisInA;
211 m_rbBFrame.
getOrigin() = m_rbB.getCenterOfMassTransform().inverse()(m_rbA.getCenterOfMassTransform()(pivotInA));
222 #ifdef _BT_USE_CENTER_LIMIT_
231 #ifdef _BT_USE_CENTER_LIMIT_
254 #ifdef _BT_USE_CENTER_LIMIT_
263 #ifdef _BT_USE_CENTER_LIMIT_
272 return m_angularOnly;
276 return m_enableAngularMotor;
280 return m_motorTargetVelocity;
284 return m_maxMotorImpulse;
288 void setUseFrameOffset(
bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
293 virtual void setParam(
int num,
btScalar value,
int axis = -1);
295 virtual btScalar getParam(
int num,
int axis = -1)
const;
307 #ifdef BT_BACKWARDS_COMPATIBLE_SERIALIZATION
327 #endif //BT_BACKWARDS_COMPATIBLE_SERIALIZATION
395 #ifdef _BT_USE_CENTER_LIMIT_
402 hingeData->m_lowerLimit = float(m_lowerLimit);
403 hingeData->m_upperLimit = float(m_upperLimit);
404 hingeData->m_limitSoftness = float(m_limitSoftness);
405 hingeData->m_biasFactor = float(m_biasFactor);
406 hingeData->m_relaxationFactor = float(m_relaxationFactor);
412 #endif //BT_HINGECONSTRAINT_H
btMatrix3x3 inverse() const
Return the inverse of the matrix.
void setUseFrameOffset(bool frameOffsetOnOff)
btTransformDoubleData m_rbBFrame
btTransformFloatData m_rbAFrame
const btTransform & getAFrame() const
btTransform & getBFrame()
Jacobian entry is an abstraction that allows to describe constraints it can be used in combination wi...
double m_motorTargetVelocity
float m_motorTargetVelocity
bool isLimit() const
Returns true when the last test() invocation recognized limit violation.
bool m_useSolveConstraintObsolete
btScalar m_accMotorImpulse
void btPlaneSpace1(const T &n, T &p, T &q)
this structure is not used, except for loading pre-2.82 .bullet files
const btTransform & getBFrame() const
#define btHingeConstraintData
bool m_enableAngularMotor
#define SIMD_FORCE_INLINE
btTypedConstraintDoubleData m_typeConstraintData
const btRigidBody & getRigidBodyA() const
btScalar m_motorTargetVelocity
hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in lo...
btVector3 quatRotate(const btQuaternion &rotation, const btVector3 &v)
const btScalar & getZ() const
Return the z value.
virtual int calculateSerializeBufferSize() const
btScalar m_accLimitImpulse
btScalar getUpperLimit() const
btQuaternion shortestArcQuat(const btVector3 &v0, const btVector3 &v1)
float m_motorTargetVelocity
void set(btScalar low, btScalar high, btScalar _softness=0.9f, btScalar _biasFactor=0.3f, btScalar _relaxationFactor=1.0f)
Sets all limit's parameters.
btScalar getSign() const
Returns sign value evaluated when test() was invoked.
double m_relaxationFactor
btScalar getMaxMotorImpulse()
btScalar getSoftness() const
Returns limit's softness.
void setAxis(btVector3 &axisInA)
btScalar getBiasFactor() const
Returns limit's bias factor.
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
btScalar getMotorTargetVelosity()
const btScalar & getY() const
Return the y value.
const btScalar & getX() const
Return the x value.
void setValue(const btScalar &xx, const btScalar &xy, const btScalar &xz, const btScalar &yx, const btScalar &yy, const btScalar &yz, const btScalar &zx, const btScalar &zy, const btScalar &zz)
Set the values of the matrix explicitly (row major)
btScalar m_maxMotorImpulse
btScalar getLowerLimit() const
The btRigidBody is the main class for rigid body objects.
btTypedConstraintData m_typeConstraintData
this structure is not used, except for loading pre-2.82 .bullet files
btRigidBody & getRigidBodyA()
btVector3 can be used to represent 3D points and vectors.
#define ATTRIBUTE_ALIGNED16(a)
btTransform & getAFrame()
btScalar btNormalizeAngle(btScalar angleInRadians)
bool m_useOffsetForConstraintFrame
void setAngularOnly(bool angularOnly)
bool m_useReferenceFrameA
bool getEnableAngularMotor()
btScalar getRelaxationFactor() const
Returns limit's relaxation factor.
btTransformDoubleData m_rbAFrame
virtual int calculateSerializeBufferSize() const
TypedConstraint is the baseclass for Bullet constraints and vehicles.
void setLimit(btScalar low, btScalar high, btScalar _softness=0.9f, btScalar _biasFactor=0.3f, btScalar _relaxationFactor=1.0f)
void enableMotor(bool enableMotor)
#define BT_DECLARE_ALIGNED_ALLOCATOR()
virtual const char * serialize(void *dataBuffer, class btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
btTransform & getFrameOffsetB()
btTransformDoubleData m_rbBFrame
btRigidBody & getRigidBodyB()
#define btHingeConstraintDataName
btTransformDoubleData m_rbAFrame
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
void setMaxMotorImpulse(btScalar maxMotorImpulse)
const btRigidBody & getRigidBodyB() const
btTransform & getFrameOffsetA()
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
btTypedConstraintData m_typeConstraintData
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
void enableAngularMotor(bool enableMotor, btScalar targetVelocity, btScalar maxMotorImpulse)
btTransformFloatData m_rbBFrame