Skip to content

Instantly share code, notes, and snippets.

@yoavlt
Created July 1, 2013 18:19
Show Gist options
  • Save yoavlt/5903250 to your computer and use it in GitHub Desktop.
Save yoavlt/5903250 to your computer and use it in GitHub Desktop.
// 衝突検出方法の選択(デフォルトを選択)
btDefaultCollisionConfiguration *config = new btSoftBodyRigidBodyCollisionConfiguration();
btCollisionDispatcher *dispatcher = new btCollisionDispatcher(config);
// ブロードフェーズ法の設定(Dynamic AABB tree method)
btDbvtBroadphase *broadphase = new btDbvtBroadphase();
// 拘束(剛体間リンク)のソルバ設定
btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver();
// Bulletのワールド作成
m_dynamic_world = new btSoftRigidDynamicsWorld(dispatcher, broadphase, solver, config, 0);
// 重力加速度の設定(OpenGLに合わせてy軸方向を上下方向にする)
// m_dynamic_world->setGravity(btVector3(0, -9.8, 0));
m_world_info.m_dispatcher = dispatcher;
m_world_info.m_broadphase = broadphase;
m_world_info.m_sparsesdf.Initialize();
m_world_info.m_gravity.setValue(0, -9.8, 0);
m_world_info.air_density = 1.2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment