contact normal should point from B to A (to be consistent with Bullet 2.x)
stringify: pre-allocate bigger buffer (10MB, workaround)
This commit is contained in:
@@ -36,9 +36,9 @@ B3_ATTRIBUTE_ALIGNED16(struct) b3Contact4 : public b3Contact4Data
|
||||
void setFrictionCoeff( float c ) { b3Assert( c >= 0.f && c <= 1.f ); m_frictionCoeffCmp = (unsigned short)(c*0xffff); }
|
||||
|
||||
//float& getNPoints() { return m_worldNormal[3]; }
|
||||
int getNPoints() const { return (int) m_worldNormal[3]; }
|
||||
int getNPoints() const { return (int) m_worldNormalOnB[3]; }
|
||||
|
||||
float getPenetration(int idx) const { return m_worldPos[idx][3]; }
|
||||
float getPenetration(int idx) const { return m_worldPosB[idx][3]; }
|
||||
|
||||
bool isInvalid() const { return (getBodyA()==0 || getBodyB()==0); }
|
||||
};
|
||||
|
||||
@@ -7,9 +7,10 @@ typedef struct b3Contact4Data b3Contact4Data_t;
|
||||
|
||||
struct b3Contact4Data
|
||||
{
|
||||
b3Float4 m_worldPos[4];
|
||||
b3Float4 m_worldPosB[4];
|
||||
// b3Float4 m_localPosA[4];
|
||||
// b3Float4 m_localPosB[4];
|
||||
b3Float4 m_worldNormal; // w: m_nPoints
|
||||
b3Float4 m_worldNormalOnB; // w: m_nPoints
|
||||
unsigned short m_restituitionCoeffCmp;
|
||||
unsigned short m_frictionCoeffCmp;
|
||||
int m_batchIdx;
|
||||
@@ -21,17 +22,17 @@ struct b3Contact4Data
|
||||
int m_unused1;
|
||||
int m_unused2;
|
||||
|
||||
// b3Float4 m_localPosA;
|
||||
|
||||
};
|
||||
|
||||
inline int b3Contact4Data_getNumPoints(const struct b3Contact4Data* contact)
|
||||
{
|
||||
return (int)contact->m_worldNormal.w;
|
||||
return (int)contact->m_worldNormalOnB.w;
|
||||
};
|
||||
|
||||
inline void b3Contact4Data_setNumPoints(struct b3Contact4Data* contact, int numPoints)
|
||||
{
|
||||
contact->m_worldNormal.w = (float)numPoints;
|
||||
contact->m_worldNormalOnB.w = (float)numPoints;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user