summaryrefslogtreecommitdiff
path: root/thirdparty/bullet/Bullet3Collision/NarrowPhaseCollision/b3Contact4.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-01-07 15:08:41 +0100
committerGitHub <noreply@github.com>2019-01-07 15:08:41 +0100
commitdab650fcaa3eb37deee5118d678a3763ac78a58a (patch)
tree3131df01280f91a61b4721eed132a5b6b21881ba /thirdparty/bullet/Bullet3Collision/NarrowPhaseCollision/b3Contact4.h
parenta3a537c2cf86ff4bf82385bbd17606654f8013c4 (diff)
parent22b7c9dfa80d0f7abca40f061865c2ab3c136a74 (diff)
Merge pull request #24740 from OBKF/update-bullet-physics
Update Bullet physics to commit 126b676
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