Bullet Physics

Bullet Physics はオープンソースの物理演算用のライブラリです。


リンク:

Shader.jp - DirectX + Bullet のサンプル - http://www.shader.jp/xoops/html/modules/mydownloads/singlefile.php?cid=5&lid=20



リンクチェック用コード(デモからコピペ改変):

#include <btBulletDynamicsCommon.h>
#include "LinearMath/btAlignedObjectArray.h"

int main(void) 
{
btDefaultCollisionConfiguration* p_collisionConfiguration = new btDefaultCollisionConfiguration();
btCollisionDispatcher* p_dispatcher = new btCollisionDispatcher(p_collisionConfiguration);
btBroadphaseInterface* p_broadphase = new btDbvtBroadphase();
btConstraintSolver* p_solver = new btSequentialImpulseConstraintSolver;
btDynamicsWorld* p_dynamicsWorld = new btDiscreteDynamicsWorld(p_dispatcher,p_broadphase,p_solver,p_collisionConfiguration);
p_dynamicsWorld->setGravity(btVector3(0,-10,0));
btAlignedObjectArray<btCollisionShape*> p_collisionShapes;

delete p_dynamicsWorld;
delete p_solver;
delete p_broadphase;
delete p_dispatcher;
delete p_collisionConfiguration;

return 0;
}



Comments