fix compile issues
This commit is contained in:
@@ -105,6 +105,17 @@
|
|||||||
description = "Do not build bullet3 libs"
|
description = "Do not build bullet3 libs"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newoption
|
||||||
|
{
|
||||||
|
trigger = "double",
|
||||||
|
description = "Double precision version of Bullet"
|
||||||
|
}
|
||||||
|
|
||||||
|
if _OPTIONS["double"] then
|
||||||
|
defines {"BT_USE_DOUBLE_PRECISION"}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
configurations {"Release", "Debug"}
|
configurations {"Release", "Debug"}
|
||||||
configuration "Release"
|
configuration "Release"
|
||||||
flags { "Optimize", "EnableSSE2","StaticRuntime", "NoMinimalRebuild", "FloatFast"}
|
flags { "Optimize", "EnableSSE2","StaticRuntime", "NoMinimalRebuild", "FloatFast"}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ void RigidBodyFromObjExample::initPhysics()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//load our obj mesh
|
//load our obj mesh
|
||||||
const char* fileName = "textured_sphere_smooth.obj";//teddy.obj";//sphere8.obj";//sponza_closed.obj";//sphere8.obj";
|
const char* fileName = "teddy.obj";//sphere8.obj";//sponza_closed.obj";//sphere8.obj";
|
||||||
char relativeFileName[1024];
|
char relativeFileName[1024];
|
||||||
if (b3ResourcePath::findResourcePath(fileName, relativeFileName, 1024))
|
if (b3ResourcePath::findResourcePath(fileName, relativeFileName, 1024))
|
||||||
{
|
{
|
||||||
@@ -87,8 +87,10 @@ void RigidBodyFromObjExample::initPhysics()
|
|||||||
|
|
||||||
const GLInstanceVertex& v = glmesh->m_vertices->at(0);
|
const GLInstanceVertex& v = glmesh->m_vertices->at(0);
|
||||||
btConvexHullShape* shape = new btConvexHullShape((const btScalar*)(&(v.xyzw[0])), glmesh->m_numvertices, sizeof(GLInstanceVertex));
|
btConvexHullShape* shape = new btConvexHullShape((const btScalar*)(&(v.xyzw[0])), glmesh->m_numvertices, sizeof(GLInstanceVertex));
|
||||||
|
|
||||||
|
float scaling[4] = {0.1,0.1,0.1,1};
|
||||||
|
|
||||||
btVector3 localScaling(2,2,2);//0.1,0.1,0.1);
|
btVector3 localScaling(scaling[0],scaling[1],scaling[2]);
|
||||||
shape->setLocalScaling(localScaling);
|
shape->setLocalScaling(localScaling);
|
||||||
|
|
||||||
if (m_options & OptimizeConvexObj)
|
if (m_options & OptimizeConvexObj)
|
||||||
@@ -115,11 +117,14 @@ void RigidBodyFromObjExample::initPhysics()
|
|||||||
if (isDynamic)
|
if (isDynamic)
|
||||||
shape->calculateLocalInertia(mass,localInertia);
|
shape->calculateLocalInertia(mass,localInertia);
|
||||||
|
|
||||||
btVector3 position(0,3,0);
|
float color[4] = {1,1,1,1};
|
||||||
|
float orn[4] = {0,0,0,1};
|
||||||
|
float pos[4] = {0,3,0,0};
|
||||||
|
btVector3 position(pos[0],pos[1],pos[2]);
|
||||||
startTransform.setOrigin(position);
|
startTransform.setOrigin(position);
|
||||||
btRigidBody* body = createRigidBody(mass,startTransform,shape);
|
btRigidBody* body = createRigidBody(mass,startTransform,shape);
|
||||||
|
|
||||||
btVector3 color(1,1,1);
|
|
||||||
|
|
||||||
bool useConvexHullForRendering = ((m_options & ObjUseConvexHullForRendering)!=0);
|
bool useConvexHullForRendering = ((m_options & ObjUseConvexHullForRendering)!=0);
|
||||||
|
|
||||||
@@ -131,7 +136,7 @@ void RigidBodyFromObjExample::initPhysics()
|
|||||||
&glmesh->m_indices->at(0),
|
&glmesh->m_indices->at(0),
|
||||||
glmesh->m_numIndices);
|
glmesh->m_numIndices);
|
||||||
shape->setUserIndex(shapeId);
|
shape->setUserIndex(shapeId);
|
||||||
int renderInstance = m_guiHelper->registerGraphicsInstance(shapeId,position,startTransform.getRotation(),color,localScaling);
|
int renderInstance = m_guiHelper->registerGraphicsInstance(shapeId,pos,orn,color,scaling);
|
||||||
body->setUserIndex(renderInstance);
|
body->setUserIndex(renderInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ else
|
|||||||
end
|
end
|
||||||
defines {"B3_USE_STANDALONE_EXAMPLE"}
|
defines {"B3_USE_STANDALONE_EXAMPLE"}
|
||||||
|
|
||||||
includedirs {"../../bsrc"}
|
includedirs {"../../src"}
|
||||||
|
|
||||||
links {
|
links {
|
||||||
"BulletInverseDynamicsUtils", "BulletInverseDynamics","BulletDynamics","BulletCollision", "LinearMath", "Bullet3Common"
|
"BulletInverseDynamicsUtils", "BulletInverseDynamics","BulletDynamics","BulletCollision", "LinearMath", "Bullet3Common"
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public:
|
|||||||
clearBuffers(clearColor);
|
clearBuffers(clearColor);
|
||||||
|
|
||||||
|
|
||||||
ATTRIBUTE_ALIGNED16(float modelMat[16]);
|
ATTRIBUTE_ALIGNED16(btScalar modelMat[16]);
|
||||||
ATTRIBUTE_ALIGNED16(float viewMat[16]);
|
ATTRIBUTE_ALIGNED16(float viewMat[16]);
|
||||||
ATTRIBUTE_ALIGNED16(float projMat[16]);
|
ATTRIBUTE_ALIGNED16(float projMat[16]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user