Game Development Reference
In-Depth Information
Note
Note that this chapter's source code uses a
SoftBodyDemo
application to spe-
cifically test this feature.
Finally, because of the complexity of soft bodies, an entire project/library file must
be included in the project in order to compile and launch the application with
soft bodies. We must add the
BulletSoftBody
project, and the
Bul-
letSoftBody_vs2010_debug.lib
file.
Initialization
Initialization of the world and collision configuration for soft bodies are not particularly
special.
m_pCollisionConfiguration = new
btSoftBodyRigidBodyCollisionConfiguration();
m_pWorld = new
btSoftRigidDynamicsWorld(m_pDispatcher,
m_pBroadphase, m_pSolver,
m_pCollisionConfiguration);
These calls are identical to the calls used earlier, except using new class types (with
much longer names). The most significant change to the soft body world initialization
is with the
btSoftBodyWorldInfo
object:
btSoftBodyWorldInfo m_softBodyWorldInfo;
m_softBodyWorldInfo.m_dispatcher =
m_pDispatcher;
m_softBodyWorldInfo.m_broadphase =
m_pBroadphase;
m_softBodyWorldInfo.m_sparsesdf.Initialize();
Suffice it to say that this object simply needs the pointers for the collision dispatcher
and broad phase objects, and must have it's
Signed Distance Field
(
SDF
for short)
Search WWH ::
Custom Search