Bouncing ball in Bullet

旧巷老猫 提交于 2019-12-06 09:24:14
  1. Yes, I believe that should be correct
  2. Restitution and friction can be set per object by supplying them to the btRigidBodyConstructionInfo object passed into the btRigidBody constructor

For example:

btBoxShape * box = new btBoxShape(0.5f,0.5f,0.5f);
btVector3 inertia;
float mass = 10.0f;
box->calculateLocalInertia(mass,inertia);
btRigidBodyConstructionInfo info(10.0f,null,mass,inertia); //motion state would actually be non-null in most real usages
info.m_restitution = 1.3f;
info.m_friction = 1.5f;
btRigidBody * rb = new btRigidBody(info);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!