re-introduce Bullet 2.x solver, in Bullet3Dynamics/ConstraintSolver/b3PgsJacobiSolver.*
move b3Contact and b3RigidBody
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
#ifndef BT_CONTACT4_H
|
||||
#define BT_CONTACT4_H
|
||||
|
||||
#include "Bullet3Common/b3Vector3.h"
|
||||
|
||||
|
||||
ATTRIBUTE_ALIGNED16(struct) b3Contact4
|
||||
{
|
||||
BT_DECLARE_ALIGNED_ALLOCATOR();
|
||||
|
||||
b3Vector3 m_worldPos[4];
|
||||
b3Vector3 m_worldNormal;
|
||||
// float m_restituitionCoeff;
|
||||
// float m_frictionCoeff;
|
||||
unsigned short m_restituitionCoeffCmp;
|
||||
unsigned short m_frictionCoeffCmp;
|
||||
int m_batchIdx;
|
||||
|
||||
int m_bodyAPtrAndSignBit;
|
||||
int m_bodyBPtrAndSignBit;
|
||||
|
||||
int getBodyA()const {return abs(m_bodyAPtrAndSignBit);}
|
||||
int getBodyB()const {return abs(m_bodyBPtrAndSignBit);}
|
||||
bool isBodyAFixed()const { return m_bodyAPtrAndSignBit<0;}
|
||||
bool isBodyBFixed()const { return m_bodyBPtrAndSignBit<0;}
|
||||
// todo. make it safer
|
||||
int& getBatchIdx() { return m_batchIdx; }
|
||||
const int& getBatchIdx() const { return m_batchIdx; }
|
||||
float getRestituitionCoeff() const { return ((float)m_restituitionCoeffCmp/(float)0xffff); }
|
||||
void setRestituitionCoeff( float c ) { btAssert( c >= 0.f && c <= 1.f ); m_restituitionCoeffCmp = (unsigned short)(c*0xffff); }
|
||||
float getFrictionCoeff() const { return ((float)m_frictionCoeffCmp/(float)0xffff); }
|
||||
void setFrictionCoeff( float c ) { btAssert( c >= 0.f && c <= 1.f ); m_frictionCoeffCmp = (unsigned short)(c*0xffff); }
|
||||
|
||||
float& getNPoints() { return m_worldNormal[3]; }
|
||||
float getNPoints() const { return m_worldNormal[3]; }
|
||||
|
||||
float getPenetration(int idx) const { return m_worldPos[idx][3]; }
|
||||
|
||||
bool isInvalid() const { return (getBodyA()==0 || getBodyB()==0); }
|
||||
};
|
||||
|
||||
#endif //BT_CONTACT4_H
|
||||
@@ -3,12 +3,12 @@
|
||||
#define _CONVEX_HULL_CONTACT_H
|
||||
|
||||
#include "parallel_primitives/host/btOpenCLArray.h"
|
||||
#include "b3RigidBodyCL.h"
|
||||
#include "Bullet3Collision/NarrowPhaseCollision/b3RigidBodyCL.h"
|
||||
#include "Bullet3Common/b3AlignedObjectArray.h"
|
||||
#include "b3ConvexUtility.h"
|
||||
#include "b3ConvexPolyhedronCL.h"
|
||||
#include "b3Collidable.h"
|
||||
#include "b3Contact4.h"
|
||||
#include "Bullet3Collision/NarrowPhaseCollision/b3Contact4.h"
|
||||
#include "parallel_primitives/host/btInt2.h"
|
||||
#include "parallel_primitives/host/btInt4.h"
|
||||
#include "b3OptimizedBvh.h"
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#ifndef BT_RIGID_BODY_CL
|
||||
#define BT_RIGID_BODY_CL
|
||||
|
||||
#include "Bullet3Common/b3Scalar.h"
|
||||
#include "Bullet3Common/b3Matrix3x3.h"
|
||||
|
||||
ATTRIBUTE_ALIGNED16(struct) b3RigidBodyCL
|
||||
{
|
||||
BT_DECLARE_ALIGNED_ALLOCATOR();
|
||||
|
||||
b3Vector3 m_pos;
|
||||
b3Quaternion m_quat;
|
||||
b3Vector3 m_linVel;
|
||||
b3Vector3 m_angVel;
|
||||
|
||||
int m_collidableIdx;
|
||||
float m_invMass;
|
||||
float m_restituitionCoeff;
|
||||
float m_frictionCoeff;
|
||||
|
||||
float getInvMass() const
|
||||
{
|
||||
return m_invMass;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct btInertiaCL
|
||||
{
|
||||
b3Matrix3x3 m_invInertiaWorld;
|
||||
b3Matrix3x3 m_initInvInertia;
|
||||
};
|
||||
|
||||
|
||||
#endif//BT_RIGID_BODY_CL
|
||||
Reference in New Issue
Block a user