From 158c19541b7ff671308f603a2df1e4cf626ea851 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Wed, 26 Dec 2012 02:18:51 +0100 Subject: [PATCH] Add methods to get the friction vectors of the contact --- src/constraint/Contact.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/constraint/Contact.h b/src/constraint/Contact.h index ab4b1f86..57203845 100644 --- a/src/constraint/Contact.h +++ b/src/constraint/Contact.h @@ -135,6 +135,12 @@ class Contact : public Constraint { // Set the contact world point on body 2 void setWorldPointOnBody2(const Vector3& worldPoint); + // Get the first friction vector + Vector3 getFrictionVector1() const; + + // Get the second friction vector + Vector3 getFrictionVector2() const; + // Compute the jacobian matrix for all mathematical constraints virtual void computeJacobian(int noConstraint, decimal J_SP[NB_MAX_CONSTRAINTS][2*6]) const; @@ -229,6 +235,16 @@ inline void Contact::setWorldPointOnBody2(const Vector3& worldPoint) { mWorldPointOnBody2 = worldPoint; } +// Get the first friction vector +inline Vector3 Contact::getFrictionVector1() const { + return mFrictionVectors[0]; +} + +// Get the second friction vector +inline Vector3 Contact::getFrictionVector2() const { + return mFrictionVectors[1]; +} + // Return the penetration depth of the contact inline decimal Contact::getPenetrationDepth() const { return mPenetrationDepth;