some finishing touches for drawing shadows/clusters/textures.
This commit is contained in:
@@ -1108,6 +1108,7 @@ psb0->appendLinearJoint(lj,psb1);
|
||||
//
|
||||
static void Init_ClusterCar(SoftDemo* pdemo)
|
||||
{
|
||||
pdemo->setAzi(270);
|
||||
const btVector3 origin(100,80,0);
|
||||
const btQuaternion orientation(-SIMD_PI/2,0,0);
|
||||
const btScalar widthf=8;
|
||||
@@ -1446,6 +1447,19 @@ void SoftDemo::renderme()
|
||||
|
||||
}
|
||||
|
||||
void SoftDemo::setDrawClusters(bool drawClusters)
|
||||
{
|
||||
if (drawClusters)
|
||||
{
|
||||
getSoftDynamicsWorld()->setDrawFlags(getSoftDynamicsWorld()->getDrawFlags()|fDrawFlags::Clusters);
|
||||
} else
|
||||
{
|
||||
getSoftDynamicsWorld()->setDrawFlags(getSoftDynamicsWorld()->getDrawFlags()& (~fDrawFlags::Clusters));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SoftDemo::keyboardCallback(unsigned char key, int x, int y)
|
||||
{
|
||||
switch(key)
|
||||
@@ -1580,6 +1594,10 @@ void SoftDemo::initPhysics()
|
||||
{
|
||||
///create concave ground mesh
|
||||
|
||||
//reset and disable motorcontrol at the start
|
||||
motorcontrol.goal = 0;
|
||||
motorcontrol.maxtorque = 0;
|
||||
m_azi = 0;
|
||||
|
||||
btCollisionShape* groundShape = 0;
|
||||
bool useConcaveMesh = false;//not ready yet true;
|
||||
|
||||
@@ -110,14 +110,16 @@ public:
|
||||
return demo;
|
||||
}
|
||||
|
||||
const btSoftRigidDynamicsWorld* getSoftDynamicsWorld() const
|
||||
virtual void setDrawClusters(bool drawClusters);
|
||||
|
||||
virtual const btSoftRigidDynamicsWorld* getSoftDynamicsWorld() const
|
||||
{
|
||||
///just make it a btSoftRigidDynamicsWorld please
|
||||
///or we will add type checking
|
||||
return (btSoftRigidDynamicsWorld*) m_dynamicsWorld;
|
||||
}
|
||||
|
||||
btSoftRigidDynamicsWorld* getSoftDynamicsWorld()
|
||||
virtual btSoftRigidDynamicsWorld* getSoftDynamicsWorld()
|
||||
{
|
||||
///just make it a btSoftRigidDynamicsWorld please
|
||||
///or we will add type checking
|
||||
|
||||
Reference in New Issue
Block a user