compile fixes for trunk on OSX
This commit is contained in:
@@ -1,3 +1,18 @@
|
|||||||
SubDir TOP Demos Gpu3dDemo ;
|
SubDir TOP Demos Gpu3dDemo ;
|
||||||
|
|
||||||
BulletDemo Gpu3dDemo : [ Wildcard *.h *.cpp ] ;
|
|
||||||
|
rule BulletMTDemo
|
||||||
|
{
|
||||||
|
Application $(<) : $(>) : noinstall console nomanifest ;
|
||||||
|
LinkWith $(<) : bulletopenglsupport bulletmultithreaded bulletdynamics bulletcollision bulletmath ;
|
||||||
|
CFlags $(<) : [ FIncludes $(TOP)/Demos/OpenGL ]
|
||||||
|
[ FIncludes $(TOP)/Extras/ConvexHull ]
|
||||||
|
;
|
||||||
|
MsvcIncDirs $(<) :
|
||||||
|
"../../Demos/OpenGL"
|
||||||
|
"../../src" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BulletMTDemo Gpu3dDemo : [ Wildcard *.h *.cpp ] ;
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ subject to the following restrictions:
|
|||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "LinearMath/btMinMax.h"
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
#define USE_FRICTION 1
|
#define USE_FRICTION 1
|
||||||
@@ -57,7 +59,7 @@ BT_GPU___device__ float computeImpulse3D(float3 rVel,
|
|||||||
if(positionConstraint >= 0)
|
if(positionConstraint >= 0)
|
||||||
return lambdaDt;
|
return lambdaDt;
|
||||||
|
|
||||||
positionConstraint = min(0.0f,positionConstraint+penetrationError);
|
positionConstraint = btMin(0.0f,positionConstraint+penetrationError);
|
||||||
|
|
||||||
lambdaDt = -(BT_GPU_dot(cNormal,rVel)*(collisionConstant));
|
lambdaDt = -(BT_GPU_dot(cNormal,rVel)*(collisionConstant));
|
||||||
lambdaDt -= (baumgarteConstant/dt*positionConstraint);
|
lambdaDt -= (baumgarteConstant/dt*positionConstraint);
|
||||||
@@ -104,6 +106,7 @@ BT_GPU___global__ void collisionWithWallBox3DD(float4 *trans,
|
|||||||
float3 dy = BT_GPU_make_float34(trans[idx * 4 + 1]);
|
float3 dy = BT_GPU_make_float34(trans[idx * 4 + 1]);
|
||||||
float3 dz = BT_GPU_make_float34(trans[idx * 4 + 2]);
|
float3 dz = BT_GPU_make_float34(trans[idx * 4 + 2]);
|
||||||
float3 rerVertex = ((iVtx & 1) ? dx : dx * (-1.f));
|
float3 rerVertex = ((iVtx & 1) ? dx : dx * (-1.f));
|
||||||
|
|
||||||
rerVertex += ((iVtx & 2) ? dy : dy * (-1.f));
|
rerVertex += ((iVtx & 2) ? dy : dy * (-1.f));
|
||||||
rerVertex += ((iVtx & 4) ? dz : dz * (-1.f));
|
rerVertex += ((iVtx & 4) ? dz : dz * (-1.f));
|
||||||
float3 vPos = aPos + rerVertex;
|
float3 vPos = aPos + rerVertex;
|
||||||
@@ -227,7 +230,7 @@ BT_GPU___global__ void collisionBatchResolutionBox3DD(int2 *constraints,
|
|||||||
{
|
{
|
||||||
float rLambdaDt=lambdaDtBox[idx * 4 + iVtx];
|
float rLambdaDt=lambdaDtBox[idx * 4 + iVtx];
|
||||||
float pLambdaDt=rLambdaDt;
|
float pLambdaDt=rLambdaDt;
|
||||||
rLambdaDt=max(pLambdaDt+lambdaDt,0.0f);
|
rLambdaDt=btMax(pLambdaDt+lambdaDt,0.0f);
|
||||||
lambdaDt=rLambdaDt-pLambdaDt;
|
lambdaDt=rLambdaDt-pLambdaDt;
|
||||||
lambdaDtBox[idx * 4 + iVtx]=rLambdaDt;
|
lambdaDtBox[idx * 4 + iVtx]=rLambdaDt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src } )
|
INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src } )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SET(BulletDynamics_SRCS
|
SET(BulletDynamics_SRCS
|
||||||
|
ConstraintSolver/btGeneric6DofSpringConstraint.cpp
|
||||||
|
ConstraintSolver/btHinge2Constraint.cpp
|
||||||
|
ConstraintSolver/btUniversalConstraint.cpp
|
||||||
ConstraintSolver/btContactConstraint.cpp
|
ConstraintSolver/btContactConstraint.cpp
|
||||||
ConstraintSolver/btConeTwistConstraint.cpp
|
ConstraintSolver/btConeTwistConstraint.cpp
|
||||||
ConstraintSolver/btGeneric6DofConstraint.cpp
|
ConstraintSolver/btGeneric6DofConstraint.cpp
|
||||||
@@ -24,6 +29,9 @@ SET(Root_HDRS
|
|||||||
../btBulletCollisionCommon.h
|
../btBulletCollisionCommon.h
|
||||||
)
|
)
|
||||||
SET(ConstraintSolver_HDRS
|
SET(ConstraintSolver_HDRS
|
||||||
|
ConstraintSolver/btGeneric6DofSpringConstraint.h
|
||||||
|
ConstraintSolver/btHinge2Constraint.h
|
||||||
|
ConstraintSolver/btUniversalConstraint.h
|
||||||
ConstraintSolver/btConstraintSolver.h
|
ConstraintSolver/btConstraintSolver.h
|
||||||
ConstraintSolver/btContactConstraint.h
|
ConstraintSolver/btContactConstraint.h
|
||||||
ConstraintSolver/btContactSolverInfo.h
|
ConstraintSolver/btContactSolverInfo.h
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ inline float4& operator*=(float4& a, float fact)
|
|||||||
a = fact * a;
|
a = fact * a;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
inline float4& operator+=(float4& a, float4& b)
|
inline float4& operator+=(float4& a, const float4& b)
|
||||||
{
|
{
|
||||||
a = a + b;
|
a = a + b;
|
||||||
return a;
|
return a;
|
||||||
@@ -169,12 +169,12 @@ inline float3 operator*(const float3& a, float fact)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline float3& operator+=(float3& a, float3& b)
|
inline float3& operator+=(float3& a, const float3& b)
|
||||||
{
|
{
|
||||||
a = a + b;
|
a = a + b;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
inline float3& operator-=(float3& a, float3& b)
|
inline float3& operator-=(float3& a, const float3& b)
|
||||||
{
|
{
|
||||||
a = a - b;
|
a = a - b;
|
||||||
return a;
|
return a;
|
||||||
|
|||||||
Reference in New Issue
Block a user