나는 총알에 새롭다. 아마도 나는 기본적인 문제가있다. 나는 굴곡 핀이 떨어지는 것을 시뮬레이션하려고하지만, 추락 한 후에는 힘이 추가되지 않고 스스로 일어나고 있습니다.불릿 물리학 센터와 이상한 물체 반응
어디에서 실수했는지 궁금합니다. 누구든지 도와 주시면 감사하겠습니다. 여기
는 어떻게되는지 보여주는 비디오입니다 : https://www.sendspace.com/file/78tncr을 여기에 내가 바닥에 추가하는 방법입니다
tTransform l;
l.setIdentity();
l.setOrigin(btVector3(0,0,0));
btStaticPlaneShape* plane=new btStaticPlaneShape(btVector3(0,1,0),0);
btMotionState* motion=new btDefaultMotionState(l);
btRigidBody::btRigidBodyConstructionInfo info(0.0,motion,plane);
btRigidBody* body=new btRigidBody(info);
world->addRigidBody(body);
bodies.push_back(body);
를이 내가 bolwing 핀을 추가하는 방법입니다
btRigidbodyaddBolw (float x, float y , float z,float mass)
{
btTransform t;
t.setIdentity();
t.setOrigin(btVector3(x,y,z));
btTriangleMesh * tmptri= new btTriangleMesh();
//this is simply reading from std::vector, where I have vertex of a shape
for(int i=0;i<=faces.size()-3;i=i+3)
{
if(faces[i].wektor==-100)
{
i=i-2;
continue;
}
btVector3 vertex1(vertexy[faces[i].wektor].GetX(), vertexy[faces[i].wektor].GetY(), vertexy[faces[i].wektor].GetZ());
btVector3 vertex2(vertexy[faces[i+1].wektor].GetX(), vertexy[faces[i+1].wektor].GetY(), vertexy[faces[i+1].wektor].GetZ());
btVector3 vertex3(vertexy[faces[i+2].wektor].GetX(), vertexy[faces[i+2].wektor].GetY(), vertexy[faces[i+2].wektor].GetZ());
tmptri->addTriangle(vertex1, vertex2, vertex3);
}
btConvexShape *tmpshape = new btConvexTriangleMeshShape(tmptri);
btShapeHull *hull = new btShapeHull(tmpshape);
btScalar margin = tmpshape->getMargin();
hull->buildHull(margin);
btConvexHullShape* simplifiedConvexShape = new btConvexHullShape();
for (int i=0;i<hull->numVertices();i++)
{
simplifiedConvexShape->addPoint(hull->getVertexPointer()[i]);
}
delete tmpshape;
delete hull;
btMotionState * motion = new btDefaultMotionState(t);
btVector3 inertia(0,0,0);
if(mass!=0.0)
simplifiedConvexShape->calculateLocalInertia(mass,inertia);
btRigidBody::btRigidBodyConstructionInfo info(mass,motion,simplifiedConvexShape,inertia);
btRigidBody* body=new btRigidBody(info);
world->addRigidBody(body); //and let the world know about it
bodies.push_back(body); //to be easier to clean, I store them a vector
return body;
}
I을 핀, 질량, 마찰 및 배상의 변화 모양을 시도했지만 아무것도 헤 뿌리지 않았고, 질량 중심을 변경할 수있는 방법이 있습니까? 아마도 도움이 될까요?
"sendspace"사이트에서 mp4를 다운로드하도록 초대하고, 시도 할 때 나에게 dmg을 보내려고합니다. dmg는 무해 할지도 모르지만 나는 만지지 않을 것입니다. – Beta