added some get methods and stuff
authorErwin Coumans <blender@erwincoumans.com>
Tue, 6 Sep 2005 16:45:48 +0000 (16:45 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Tue, 6 Sep 2005 16:45:48 +0000 (16:45 +0000)
extern/bullet/Bullet/CollisionShapes/CollisionShape.h
extern/bullet/Bullet/CollisionShapes/ConvexShape.h
extern/bullet/Bullet/CollisionShapes/CylinderShape.h
extern/bullet/Bullet/CollisionShapes/TriangleMeshShape.cpp
extern/bullet/Bullet/CollisionShapes/TriangleMeshShape.h
extern/bullet/Bullet/NarrowPhaseCollision/PersistentManifold.cpp
extern/bullet/Bullet/NarrowPhaseCollision/RaycastCallback.cpp
extern/bullet/Bullet/NarrowPhaseCollision/SubSimplexConvexCast.cpp

index 2a2d0543bb271398619a3aca265a1a3ea48a98a4..c43ce933a2f314c9a7e0c6bd03b16ed3097cdcb3 100644 (file)
@@ -59,6 +59,7 @@ public:
 
 
        virtual void    setLocalScaling(const SimdVector3& scaling) =0;
+       virtual const SimdVector3& getLocalScaling() const =0;
 
        virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia) = 0;
 
index 345358e47fc52752eb115ebc633ed67187784d63..1ec962c591c33234503a1f8c5093f45d3c4d46dc 100644 (file)
@@ -51,6 +51,10 @@ public:
 
 
        virtual void    setLocalScaling(const SimdVector3& scaling);
+       virtual const SimdVector3& getLocalScaling() const 
+       {
+               return m_localScaling;
+       }
 
 
        virtual void    SetMargin(float margin)
index 11f184db761cb0a783b342484620053aa7c7a73c..4fa40e92f1e6cf91e801c099e8cccd47129aa6d9 100644 (file)
@@ -24,6 +24,11 @@ class CylinderShape : public BoxShape
 public:
        CylinderShape (const SimdVector3& halfExtents);
        
+       ///GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
+       void GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const
+       {
+               GetAabbSlow(t,aabbMin,aabbMax);
+       }
 
        virtual SimdVector3     LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const;
 
index c09599f39b17db10228ac45638c3a711dfd29880..259e673759a783914ee4733a78dfcad67c13bc9c 100644 (file)
@@ -100,6 +100,13 @@ void TriangleMeshShape::setLocalScaling(const SimdVector3& scaling)
        m_meshInterface->setScaling(scaling);
 }
 
+const SimdVector3& TriangleMeshShape::getLocalScaling() const
+{
+       return m_meshInterface->getScaling();
+}
+
+
+
 void   TriangleMeshShape::ProcessAllTriangles(TriangleCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const
 {
 
index 2083985e6ccd1e33759363e8425b0ad0d9b18708..6ca8fef8ef02169e1609a53ae71166304cb706f6 100644 (file)
@@ -53,6 +53,7 @@ public:
        virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia);
 
        virtual void    setLocalScaling(const SimdVector3& scaling);
+       virtual const SimdVector3& getLocalScaling() const;
        
 
        //debugging
index 2d4e7f014200a81451b04b8abfab83ce2c59e886..d923d6f51f16dd7b2e18d35efe5dc5a544b57bc0 100644 (file)
@@ -103,8 +103,13 @@ void PersistentManifold::AddManifoldPoint(const ManifoldPoint& newPoint)
        int insertIndex = GetNumContacts();
        if (insertIndex == MANIFOLD_CACHE_SIZE)
        {
-               //sort cache so best points come first
+#if MANIFOLD_CACHE_SIZE >= 4
+               //sort cache so best points come first, based on area
                insertIndex = SortCachedPoints(newPoint);
+#else
+               insertIndex = 0;
+#endif
+
        } else
        {
                m_cachedPoints++;
index 98eb1067063eb5b1c6c6bea267d4bd32c51ab453..62ca91f768c9dc6f061825475b0eb3aa012652bc 100644 (file)
@@ -26,6 +26,8 @@ RaycastCallback::RaycastCallback(const SimdVector3& from,const SimdVector3& to)
 
 void RaycastCallback::ProcessTriangle(SimdVector3* triangle)
 {
+       
+
        const SimdVector3 &vert0=triangle[0];
        const SimdVector3 &vert1=triangle[1];
        const SimdVector3 &vert2=triangle[2];
index a280c031a27d0d179fc11bbf403780b193c950d9..80fea51988702f5ccd5f1b0aeaba206c0b13ebb7 100644 (file)
@@ -114,8 +114,6 @@ bool        SubsimplexConvexCast::calcTimeOfImpact(
 
        int numiter = MAX_ITERATIONS - maxIter;
 //     printf("number of iterations: %d", numiter);
-
-       //printf("lambd%f",lambda);
        result.m_fraction = lambda;
        result.m_normal = n;