# Physics Simulation Forum

 Page 1 of 1 [ 1 post ]
 Print view Previous topic | Next topic
Author Message
 Post subject: btConvexHullShapePosted: Sun Oct 23, 2011 9:31 am

Joined: Tue Jun 28, 2011 4:11 am
Posts: 14
Hello. I am trying to make a mesh into a bullet shape with this code first.
Code:
btVector3 verts[4];

verts[0] = btVector3(mW[k2].x+0,  5  ,mW[k2].y +0);   //<-------mW = mouse positions plus offset.
verts[1] = btVector3(mW[k2].x+0,  5  ,mW[k2].y-10);
verts[2] = btVector3(mW[k2].x-20, -5 ,mW[k2].y-10);
verts[3] = btVector3(mW[k2].x-20, -5 ,mW[k2].y -0);

btConvexHullShape * shape = new btConvexHullShape();

//add the points to the shape
for ( int ii=0; ii<4; ++ii ){
}

btTransform groundTransform11;
groundTransform11.setIdentity();

groundTransform11.setOrigin(btVector3(BtOgre::Convert::toBullet( mW[k2] + Ogre::Vector3( 0,6,0 ) )));
btScalar mass1( 0.0 );
//bool isDynamic1 = ( mass1 != 0.f );

btVector3 localInertia1( 0,0,0 );
//if ( isDynamic1 )
//mGroundShape->calculateLocalInertia( mass1,localInertia );

MyMotionState* motionState11 = new MyMotionState( groundTransform11,rampNode[k2] );
btRigidBody::btRigidBodyConstructionInfo rbInfo1( mass1,motionState11,shape,localInertia1 );
body7[0] = new btRigidBody( rbInfo1 );
body7[0]->setFriction( 0.1f );
//body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); // It should be kinematic
body7[0]->setActivationState(DISABLE_DEACTIVATION); //It should do it's job each and every frame
//add the body to the dynamics world
//errror source of access violation called before initializd
//  rampNode[k2] ->setPosition(mW[k2] + Ogre::Vector3( 0,0,0 ));
//buildDynamicsworld();

}

the shape does not show up.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 1 post ]

#### Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 4 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities