more physics work, tuning parameters, hooking up friction etc.
authorErwin Coumans <blender@erwincoumans.com>
Sat, 30 Jul 2005 18:10:53 +0000 (18:10 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Sat, 30 Jul 2005 18:10:53 +0000 (18:10 +0000)
13 files changed:
extern/bullet/Bullet/Bullet3_vc7.vcproj
extern/bullet/Bullet/CollisionShapes/BoxShape.cpp
extern/bullet/Bullet/CollisionShapes/ConvexShape.cpp
extern/bullet/Bullet/CollisionShapes/StridingMeshInterface.cpp
extern/bullet/Bullet/CollisionShapes/TriangleMeshShape.cpp
extern/bullet/BulletDynamics/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp
extern/bullet/BulletDynamics/CollisionDispatch/ToiContactDispatcher.cpp
extern/bullet/BulletDynamics/ConstraintSolver/ContactConstraint.cpp
extern/bullet/BulletDynamics/Dynamics/ContactJoint.cpp
extern/bullet/BulletDynamics/Dynamics/RigidBody.cpp
extern/bullet/BulletDynamics/Dynamics/RigidBody.h
extern/bullet/make/msvc_7_0/Bullet3_vc7.vcproj
extern/bullet/make/msvc_7_0/Dynamics/BulletDynamics_vc7.vcproj

index dab745810a098c23f449f51b4afcdf0bc3e7708c..fcfc0ffb2ff813cd36ddc9236c1536da24ef7337 100644 (file)
@@ -390,6 +390,9 @@ ECHO Done
                        <File
                                RelativePath="..\LinearMath\GEN_random.h">
                        </File>
+                       <File
+                               RelativePath="..\LinearMath\IDebugDraw.h">
+                       </File>
                        <File
                                RelativePath="..\LinearMath\SimdMatrix3x3.h">
                        </File>
index 0fa063a2e172e97d2e44a1827f83b0a932cda6d6..37552194df0c741b41b0dc3a8c963560853e945d 100644 (file)
@@ -33,8 +33,8 @@ void BoxShape::GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3&
 
 
        //todo: this is a quick fix, we need to enlarge the aabb dependent on several criteria
-//     SimdVector3 extra(1,1,1);
-//     extent += extra;
+       SimdVector3 extra(CONVEX_DISTANCE_MARGIN,CONVEX_DISTANCE_MARGIN,CONVEX_DISTANCE_MARGIN);
+       extent += extra;
        
        aabbMin = center - extent;
        aabbMax = center + extent;
index f2afb33816675bfc4044db10da85183475710c7a..d6bf5dba5b30e36b82f63a50be99d398b4892d07 100644 (file)
@@ -33,12 +33,15 @@ void        ConvexShape::setLocalScaling(const SimdVector3& scaling)
 void   ConvexShape::GetAabbSlow(const SimdTransform& trans,SimdVector3&minAabb,SimdVector3&maxAabb) const
 {
 
-       SimdScalar margin = 0.05f;
+       SimdScalar margin = GetMargin();
        for (int i=0;i<3;i++)
        {
                SimdVector3 vec(0.f,0.f,0.f);
                vec[i] = 1.f;
-               SimdVector3 tmp = trans(LocalGetSupportingVertex(vec*trans.getBasis()));
+
+               SimdVector3 sv = LocalGetSupportingVertex(vec*trans.getBasis());
+
+               SimdVector3 tmp = trans(sv);
                maxAabb[i] = tmp[i]+margin;
                vec[i] = -1.f;
                tmp = trans(LocalGetSupportingVertex(vec*trans.getBasis()));
index bb0e7e29984fcad158b12ae10049c2135c2227da..b5194200a379b239eb210be4a3fa16fcf840a590 100644 (file)
@@ -13,4 +13,4 @@
 StridingMeshInterface::~StridingMeshInterface()
 {
 
-}
\ No newline at end of file
+}
index c9c7a73b9328f5e64097b6cf58a065987a371ce8..fb7b364b1e696bde92f1470526ad34a4ed2d8d8b 100644 (file)
 #include "SimdQuaternion.h"
 #include "StridingMeshInterface.h"
 #include "AabbUtil2.h"
+#include "NarrowPhaseCollision/CollisionMargin.h"
 
 
 
 TriangleMeshShape::TriangleMeshShape(StridingMeshInterface* meshInterface)
 : m_meshInterface(meshInterface),
-m_collisionMargin(0.1f)
+m_collisionMargin(CONVEX_DISTANCE_MARGIN)
 {
 }
 
index 6a815cb3113215b6f193fff68c0380eafdd41d40..54cbd6ca5d6e4728f68200d55f10b15a8ec3bb9f 100644 (file)
@@ -115,7 +115,7 @@ void        BoxTriangleCallback::SetTimeStepAndCounters(float timeStep,int stepCount,fl
 
        boxBody->GetCollisionShape()->GetAabb(boxInTriangleSpace,m_aabbMin,m_aabbMax);
 
-       float extraMargin = CONVEX_DISTANCE_MARGIN+0.1f;
+       float extraMargin = CONVEX_DISTANCE_MARGIN;//+0.1f;
 
        SimdVector3 extra(extraMargin,extraMargin,extraMargin);
 
@@ -133,7 +133,6 @@ void ConvexConcaveCollisionAlgorithm::ClearCache()
 void ConvexConcaveCollisionAlgorithm::ProcessCollision (BroadphaseProxy* ,BroadphaseProxy* ,float timeStep,int stepCount,bool useContinuous)
 {
 
-
        if (m_concave.GetClientObjectType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
        {
 
index ec566349bad8a117a40804629ec329d78ef22ee0..a67da9bc88927db8e9b2523b3db93bfe805f0b67 100644 (file)
@@ -163,7 +163,7 @@ void ToiContactDispatcher::SolveConstraints(float timeStep, int numIterations,in
                        info.m_numIterations = numIterations;
                        info.m_timeStep = timeStep;
                        info.m_tau = 0.4f;
-                       info.m_restitution = 0.1f;//m_restitution;
+                       info.m_restitution = 0.0f;//m_restitution;
 
 
                        m_solver->SolveGroup( &islandmanifold[0], islandmanifold.size(),info,debugDrawer );
index a23d5c13f7f2178555aa2f8599e9efdfb4764c00..1bd9a39db976e40e3394bc81789697ea66803e41 100644 (file)
@@ -22,7 +22,7 @@ static SimdScalar ContactThreshold = -10.0f;
 
 float useGlobalSettingContacts = false;//true;
 
-SimdScalar contactDamping = 0.9f;
+SimdScalar contactDamping = 0.2f;
 SimdScalar contactTau = .02f;//0.02f;//*0.02f;
 
 
index 7ac19a6d6a2cb1a3c43819a9fc1cb7e65ded2e04..b0f26a343d590e41c55b10344fb586c6c4d1cab8 100644 (file)
@@ -150,7 +150,7 @@ void ContactJoint::GetInfo2(Info2 *info)
        c2[1] = ccc2[1];
        c2[2] = ccc2[2];
        
-       float friction = m_body0->getFriction() * m_body1->getFriction();
+       float friction = 20.f*m_body0->getFriction() * m_body1->getFriction();
        
        // first friction direction
        if (m_numRows >= 2) 
index 31d20930a10f010997e1f8edd1e36a1b893c2871..a217291c756ed69b9013624d4708f454801c18d3 100644 (file)
@@ -26,8 +26,8 @@ RigidBody::RigidBody( const MassProps& massProps,SimdScalar linearDamping,SimdSc
        
        setMassProps(massProps.m_mass, massProps.m_inertiaLocal);
     setDamping(linearDamping, angularDamping);
-       updateInertiaTensor();
        m_worldTransform.setIdentity();
+       updateInertiaTensor();
 
 }
 
index 527e37bc57df2fdd35d1411256018c4605473630..4a61be786ca0c77c7c7651aab36a181200ac83b2 100644 (file)
@@ -147,7 +147,7 @@ private:
        SimdVector3             m_invInertiaLocal;
        SimdVector3             m_totalForce;
        SimdVector3             m_totalTorque;
-       SimdQuaternion  m_orn1;
+//     SimdQuaternion  m_orn1;
        
        SimdVector3             m_linearVelocity;
        
index ef833e9bc48776773194bb3af08faf10648ba619..2cf7455174550d0b7b473445550a0e950a92c3c5 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
        ProjectType="Visual C++"
-       Version="7.0"
+       Version="7.10"
        Name="Bullet3ContinuousCollision"
        ProjectGUID="{FFD3C64A-30E2-4BC7-BC8F-51818C320400}"
        SccProjectName=""
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLibrarianTool"
-                               OutputFile="..\..\..\..\..\..\build\msvc_7\libs\extern\debug\Bullet.lib"
+                               OutputFile="..\..\..\..\..\build\msvc_7\libs\extern\debug\Bullet.lib"
                                SuppressStartupBanner="TRUE"/>
                        <Tool
                                Name="VCMIDLTool"/>
                        <Tool
                                Name="VCPostBuildEventTool"
                                CommandLine="ECHO Copying header files
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
 
-XCOPY /Y ..\..\LinearMath\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include
-XCOPY /Y ..\..\Bullet\BroadphaseCollision\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
-XCOPY /Y ..\..\Bullet\CollisionShapes\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
-XCOPY /Y ..\..\Bullet\NarrowPhaseCollision\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
+XCOPY /Y ..\..\LinearMath\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include
+XCOPY /Y ..\..\Bullet\BroadphaseCollision\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
+XCOPY /Y ..\..\Bullet\CollisionShapes\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
+XCOPY /Y ..\..\Bullet\NarrowPhaseCollision\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
 
 ECHO Done
 "/>
@@ -105,22 +105,22 @@ ECHO Done
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLibrarianTool"
-                               OutputFile="..\..\..\..\..\..\build\msvc_7\libs\extern\Bullet.lib"
+                               OutputFile="..\..\..\..\..\build\msvc_7\libs\extern\Bullet.lib"
                                SuppressStartupBanner="TRUE"/>
                        <Tool
                                Name="VCMIDLTool"/>
                        <Tool
                                Name="VCPostBuildEventTool"
                                CommandLine="ECHO Copying header files
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
 
-XCOPY /Y ..\..\LinearMath\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include
-XCOPY /Y ..\..\Bullet\BroadphaseCollision\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
-XCOPY /Y ..\..\Bullet\CollisionShapes\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
-XCOPY /Y ..\..\Bullet\NarrowPhaseCollision\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
+XCOPY /Y ..\..\LinearMath\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include
+XCOPY /Y ..\..\Bullet\BroadphaseCollision\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
+XCOPY /Y ..\..\Bullet\CollisionShapes\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
+XCOPY /Y ..\..\Bullet\NarrowPhaseCollision\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
 
 ECHO Done
 "/>
@@ -176,15 +176,15 @@ ECHO Done
                        <Tool
                                Name="VCPostBuildEventTool"
                                CommandLine="ECHO Copying header files
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
 
-XCOPY /Y ..\..\LinearMath\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include
-XCOPY /Y ..\..\Bullet\BroadphaseCollision\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
-XCOPY /Y ..\..\Bullet\CollisionShapes\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
-XCOPY /Y ..\..\Bullet\NarrowPhaseCollision\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
+XCOPY /Y ..\..\LinearMath\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include
+XCOPY /Y ..\..\Bullet\BroadphaseCollision\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
+XCOPY /Y ..\..\Bullet\CollisionShapes\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
+XCOPY /Y ..\..\Bullet\NarrowPhaseCollision\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
 
 ECHO Done
 "/>
@@ -242,18 +242,17 @@ ECHO Done
                        <Tool
                                Name="VCPostBuildEventTool"
                                CommandLine="ECHO Copying header files
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
-IF NOT EXIST ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision MKDIR ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
 
-XCOPY /Y ..\..\LinearMath\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include
-XCOPY /Y ..\..\Bullet\BroadphaseCollision\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
-XCOPY /Y ..\..\Bullet\CollisionShapes\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
-XCOPY /Y ..\..\Bullet\NarrowPhaseCollision\*.h ..\..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
+XCOPY /Y ..\..\LinearMath\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include
+XCOPY /Y ..\..\Bullet\BroadphaseCollision\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\BroadphaseCollision
+XCOPY /Y ..\..\Bullet\CollisionShapes\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\CollisionShapes
+XCOPY /Y ..\..\Bullet\NarrowPhaseCollision\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\NarrowPhaseCollision
 
 ECHO Done
-
 "/>
                        <Tool
                                Name="VCPreBuildEventTool"/>
@@ -273,7 +272,8 @@ ECHO Done
                                Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
                </Configuration>
        </Configurations>
-       
+       <References>
+       </References>
        <Files>
                <Filter
                        Name="NarrowPhaseCollision"
index 7f35ad4b2e524f7ccc7839a712bcde71f083c224..1618c4cb0beb03488aff33b80454a6ff2f339be7 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
        ProjectType="Visual C++"
-       Version="7.0"
+       Version="7.10"
        Name="Bullet3Dynamics"
        ProjectGUID="{3427A9EF-FF84-4B3E-9AE5-C37CF44D7DA4}"
        Keyword="Win32Proj">
@@ -241,7 +241,8 @@ ECHO Done
                                Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
                </Configuration>
        </Configurations>
-       
+       <References>
+       </References>
        <Files>
                <Filter
                        Name="ConstraintSolver"