mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-09 00:50:17 +00:00
Removed empty constructors for constraints, I don't recall why we added them (possibly SPU) but if we really need them we have to revert this.
Moved static fixed body into a static function 'getFixedBody' to avoid issues when embedding Bullet in C#/CLI managed code.
This commit is contained in:
parent
d58081ce37
commit
1cd52f3d11
@ -36,11 +36,6 @@ SIMD_FORCE_INLINE btScalar computeAngularImpulseDenominator(const btVector3& axi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
btConeTwistConstraint::btConeTwistConstraint()
|
|
||||||
:btTypedConstraint(CONETWIST_CONSTRAINT_TYPE),
|
|
||||||
m_useSolveConstraintObsolete(CONETWIST_USE_OBSOLETE_SOLVER)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
btConeTwistConstraint::btConeTwistConstraint(btRigidBody& rbA,btRigidBody& rbB,
|
btConeTwistConstraint::btConeTwistConstraint(btRigidBody& rbA,btRigidBody& rbB,
|
||||||
|
@ -130,8 +130,6 @@ public:
|
|||||||
|
|
||||||
btConeTwistConstraint(btRigidBody& rbA,const btTransform& rbAFrame);
|
btConeTwistConstraint(btRigidBody& rbA,const btTransform& rbAFrame);
|
||||||
|
|
||||||
btConeTwistConstraint();
|
|
||||||
|
|
||||||
virtual void buildJacobian();
|
virtual void buildJacobian();
|
||||||
|
|
||||||
virtual void getInfo1 (btConstraintInfo1* info);
|
virtual void getInfo1 (btConstraintInfo1* info);
|
||||||
|
@ -22,10 +22,7 @@ subject to the following restrictions:
|
|||||||
#include "LinearMath/btMinMax.h"
|
#include "LinearMath/btMinMax.h"
|
||||||
#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
|
#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
|
||||||
|
|
||||||
btContactConstraint::btContactConstraint()
|
|
||||||
:btTypedConstraint(CONTACT_CONSTRAINT_TYPE)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
btContactConstraint::btContactConstraint(btPersistentManifold* contactManifold,btRigidBody& rbA,btRigidBody& rbB)
|
btContactConstraint::btContactConstraint(btPersistentManifold* contactManifold,btRigidBody& rbA,btRigidBody& rbB)
|
||||||
:btTypedConstraint(CONTACT_CONSTRAINT_TYPE,rbA,rbB),
|
:btTypedConstraint(CONTACT_CONSTRAINT_TYPE,rbA,rbB),
|
||||||
|
@ -30,7 +30,6 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
btContactConstraint();
|
|
||||||
|
|
||||||
btContactConstraint(btPersistentManifold* contactManifold,btRigidBody& rbA,btRigidBody& rbB);
|
btContactConstraint(btPersistentManifold* contactManifold,btRigidBody& rbA,btRigidBody& rbB);
|
||||||
|
|
||||||
|
@ -31,14 +31,7 @@ http://gimpact.sf.net
|
|||||||
#define D6_USE_FRAME_OFFSET true
|
#define D6_USE_FRAME_OFFSET true
|
||||||
|
|
||||||
|
|
||||||
btGeneric6DofConstraint::btGeneric6DofConstraint()
|
|
||||||
:btTypedConstraint(D6_CONSTRAINT_TYPE),
|
|
||||||
m_useLinearReferenceFrameA(true),
|
|
||||||
m_useOffsetForConstraintFrame(D6_USE_FRAME_OFFSET),
|
|
||||||
m_flags(0),
|
|
||||||
m_useSolveConstraintObsolete(D6_USE_OBSOLETE_METHOD)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -55,9 +48,9 @@ m_useSolveConstraintObsolete(D6_USE_OBSOLETE_METHOD)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static btRigidBody s_fixed(0, 0, 0);
|
|
||||||
btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB)
|
btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB)
|
||||||
: btTypedConstraint(D6_CONSTRAINT_TYPE, s_fixed, rbB),
|
: btTypedConstraint(D6_CONSTRAINT_TYPE, getFixedBody(), rbB),
|
||||||
m_frameInB(frameInB),
|
m_frameInB(frameInB),
|
||||||
m_useLinearReferenceFrameA(useLinearReferenceFrameB),
|
m_useLinearReferenceFrameA(useLinearReferenceFrameB),
|
||||||
m_flags(0),
|
m_flags(0),
|
||||||
|
@ -351,8 +351,7 @@ public:
|
|||||||
|
|
||||||
btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
|
btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
|
||||||
btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB);
|
btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB);
|
||||||
btGeneric6DofConstraint();
|
|
||||||
|
|
||||||
//! Calcs global transform of the offsets
|
//! Calcs global transform of the offsets
|
||||||
/*!
|
/*!
|
||||||
Calcs the global transform for the joint offset for body A an B, and also calcs the agle differences between the bodies.
|
Calcs the global transform for the joint offset for body A an B, and also calcs the agle differences between the bodies.
|
||||||
|
@ -30,16 +30,7 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
#ifndef __SPU__
|
#ifndef __SPU__
|
||||||
|
|
||||||
btHingeConstraint::btHingeConstraint()
|
|
||||||
: btTypedConstraint (HINGE_CONSTRAINT_TYPE),
|
|
||||||
m_enableAngularMotor(false),
|
|
||||||
m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
|
|
||||||
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
|
|
||||||
m_flags(0),
|
|
||||||
m_useReferenceFrameA(false)
|
|
||||||
{
|
|
||||||
m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,7 +98,6 @@ public:
|
|||||||
|
|
||||||
btHingeConstraint(btRigidBody& rbA,const btTransform& rbAFrame, bool useReferenceFrameA = false);
|
btHingeConstraint(btRigidBody& rbA,const btTransform& rbAFrame, bool useReferenceFrameA = false);
|
||||||
|
|
||||||
btHingeConstraint();
|
|
||||||
|
|
||||||
virtual void buildJacobian();
|
virtual void buildJacobian();
|
||||||
|
|
||||||
|
@ -20,12 +20,7 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
btPoint2PointConstraint::btPoint2PointConstraint()
|
|
||||||
:btTypedConstraint(POINT2POINT_CONSTRAINT_TYPE),
|
|
||||||
m_flags(0),
|
|
||||||
m_useSolveConstraintObsolete(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
btPoint2PointConstraint::btPoint2PointConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB)
|
btPoint2PointConstraint::btPoint2PointConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB)
|
||||||
:btTypedConstraint(POINT2POINT_CONSTRAINT_TYPE,rbA,rbB),m_pivotInA(pivotInA),m_pivotInB(pivotInB),
|
:btTypedConstraint(POINT2POINT_CONSTRAINT_TYPE,rbA,rbB),m_pivotInA(pivotInA),m_pivotInB(pivotInB),
|
||||||
|
@ -76,7 +76,6 @@ public:
|
|||||||
|
|
||||||
btPoint2PointConstraint(btRigidBody& rbA,const btVector3& pivotInA);
|
btPoint2PointConstraint(btRigidBody& rbA,const btVector3& pivotInA);
|
||||||
|
|
||||||
btPoint2PointConstraint();
|
|
||||||
|
|
||||||
virtual void buildJacobian();
|
virtual void buildJacobian();
|
||||||
|
|
||||||
|
@ -76,14 +76,6 @@ void btSliderConstraint::initParams()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
btSliderConstraint::btSliderConstraint()
|
|
||||||
:btTypedConstraint(SLIDER_CONSTRAINT_TYPE),
|
|
||||||
m_useSolveConstraintObsolete(false),
|
|
||||||
m_useLinearReferenceFrameA(true)
|
|
||||||
{
|
|
||||||
initParams();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
btSliderConstraint::btSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA)
|
btSliderConstraint::btSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA)
|
||||||
@ -96,9 +88,9 @@ btSliderConstraint::btSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static btRigidBody s_fixed(0, 0, 0);
|
|
||||||
btSliderConstraint::btSliderConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB)
|
btSliderConstraint::btSliderConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB)
|
||||||
: btTypedConstraint(SLIDER_CONSTRAINT_TYPE, s_fixed, rbB),
|
: btTypedConstraint(SLIDER_CONSTRAINT_TYPE, getFixedBody(), rbB),
|
||||||
m_useSolveConstraintObsolete(false),
|
m_useSolveConstraintObsolete(false),
|
||||||
m_frameInB(frameInB),
|
m_frameInB(frameInB),
|
||||||
m_useLinearReferenceFrameA(useLinearReferenceFrameB)
|
m_useLinearReferenceFrameA(useLinearReferenceFrameB)
|
||||||
|
@ -158,7 +158,7 @@ public:
|
|||||||
// constructors
|
// constructors
|
||||||
btSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
|
btSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
|
||||||
btSliderConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB);
|
btSliderConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB);
|
||||||
btSliderConstraint();
|
|
||||||
// overrides
|
// overrides
|
||||||
virtual void buildJacobian();
|
virtual void buildJacobian();
|
||||||
virtual void getInfo1 (btConstraintInfo1* info);
|
virtual void getInfo1 (btConstraintInfo1* info);
|
||||||
|
@ -17,33 +17,20 @@ subject to the following restrictions:
|
|||||||
#include "btTypedConstraint.h"
|
#include "btTypedConstraint.h"
|
||||||
#include "BulletDynamics/Dynamics/btRigidBody.h"
|
#include "BulletDynamics/Dynamics/btRigidBody.h"
|
||||||
|
|
||||||
static btRigidBody s_fixed(0, 0,0);
|
|
||||||
|
|
||||||
#define DEFAULT_DEBUGDRAW_SIZE btScalar(0.3f)
|
#define DEFAULT_DEBUGDRAW_SIZE btScalar(0.3f)
|
||||||
|
|
||||||
btTypedConstraint::btTypedConstraint(btTypedConstraintType type)
|
|
||||||
:btTypedObject(type),
|
|
||||||
m_userConstraintType(-1),
|
|
||||||
m_userConstraintId(-1),
|
|
||||||
m_needsFeedback(false),
|
|
||||||
m_rbA(s_fixed),
|
|
||||||
m_rbB(s_fixed),
|
|
||||||
m_appliedImpulse(btScalar(0.)),
|
|
||||||
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
|
|
||||||
{
|
|
||||||
s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.)));
|
|
||||||
}
|
|
||||||
btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA)
|
btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA)
|
||||||
:btTypedObject(type),
|
:btTypedObject(type),
|
||||||
m_userConstraintType(-1),
|
m_userConstraintType(-1),
|
||||||
m_userConstraintId(-1),
|
m_userConstraintId(-1),
|
||||||
m_needsFeedback(false),
|
m_needsFeedback(false),
|
||||||
m_rbA(rbA),
|
m_rbA(rbA),
|
||||||
m_rbB(s_fixed),
|
m_rbB(getFixedBody()),
|
||||||
m_appliedImpulse(btScalar(0.)),
|
m_appliedImpulse(btScalar(0.)),
|
||||||
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
|
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
|
||||||
{
|
{
|
||||||
s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -57,8 +44,6 @@ m_rbB(rbB),
|
|||||||
m_appliedImpulse(btScalar(0.)),
|
m_appliedImpulse(btScalar(0.)),
|
||||||
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
|
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
|
||||||
{
|
{
|
||||||
s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.)));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,10 +72,16 @@ protected:
|
|||||||
///internal method used by the constraint solver, don't use them directly
|
///internal method used by the constraint solver, don't use them directly
|
||||||
btScalar getMotorFactor(btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact);
|
btScalar getMotorFactor(btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact);
|
||||||
|
|
||||||
|
static btRigidBody& getFixedBody()
|
||||||
|
{
|
||||||
|
static btRigidBody s_fixed(0, 0,0);
|
||||||
|
s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.)));
|
||||||
|
return s_fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
btTypedConstraint(btTypedConstraintType type);
|
|
||||||
virtual ~btTypedConstraint() {};
|
virtual ~btTypedConstraint() {};
|
||||||
btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA);
|
btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA);
|
||||||
btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB);
|
btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB);
|
||||||
|
Loading…
Reference in New Issue
Block a user