summaryrefslogtreecommitdiff
path: root/thirdparty/bullet/Bullet3Collision/NarrowPhaseCollision/b3Contact4.h
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/bullet/Bullet3Collision/NarrowPhaseCollision/b3Contact4.h')
-rw-r--r--thirdparty/bullet/Bullet3Collision/NarrowPhaseCollision/b3Contact4.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/thirdparty/bullet/Bullet3Collision/NarrowPhaseCollision/b3Contact4.h b/thirdparty/bullet/Bullet3Collision/NarrowPhaseCollision/b3Contact4.h
index fb25165673..c2cd3c729b 100644
--- a/thirdparty/bullet/Bullet3Collision/NarrowPhaseCollision/b3Contact4.h
+++ b/thirdparty/bullet/Bullet3Collision/NarrowPhaseCollision/b3Contact4.h
@@ -19,28 +19,37 @@ subject to the following restrictions:
#include "Bullet3Common/b3Vector3.h"
#include "Bullet3Collision/NarrowPhaseCollision/shared/b3Contact4Data.h"
-B3_ATTRIBUTE_ALIGNED16(struct) b3Contact4 : public b3Contact4Data
+B3_ATTRIBUTE_ALIGNED16(struct)
+b3Contact4 : public b3Contact4Data
{
B3_DECLARE_ALIGNED_ALLOCATOR();
- 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;}
+ 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 ) { b3Assert( 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 ) { b3Assert( c >= 0.f && c <= 1.f ); m_frictionCoeffCmp = (unsigned short)(c*0xffff); }
+ float getRestituitionCoeff() const { return ((float)m_restituitionCoeffCmp / (float)0xffff); }
+ void setRestituitionCoeff(float c)
+ {
+ b3Assert(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)
+ {
+ 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_worldNormalOnB.w; }
+ int getNPoints() const { return (int)m_worldNormalOnB.w; }
float getPenetration(int idx) const { return m_worldPosB[idx].w; }
- bool isInvalid() const { return (getBodyA()==0 || getBodyB()==0); }
+ bool isInvalid() const { return (getBodyA() == 0 || getBodyB() == 0); }
};
-#endif //B3_CONTACT4_H
+#endif //B3_CONTACT4_H