hkpSimpleMeshShape won't come to rest

vfgdfg
Total Points:
560
Status Points:
60
Brown Belt
October 16, 2008 11:51 AM PDT
Rate
 
#3 Reply to #2

Hi,

I have now replaced the other shape in my code to hkpExtendedMeshShape. I'm creating just one test triangle to it for now. But something's wrong, it now crashes to physicsWorld->addEntity(g_floor);

		hkpExtendedMeshShape* shape2 = new hkpExtendedMeshShape();

		hkpExtendedMeshShape::TrianglesSubpart part;
		
		float verts[9];
		verts[0]=0; verts[1]=1; verts[2]=2;
		verts[3]=3; verts[4]=4; verts[5]=5;
		verts[6]=6; verts[7]=7; verts[8]=8;

		part.m_vertexBase = verts;
		part.m_vertexStriding = sizeof(float)*3;
		part.m_numVertices = 3;

		unsigned short faces[3];
		faces[0]=0; faces[1]=3; faces[2]=6;

		part.m_indexBase = faces;
		part.m_indexStriding = sizeof( unsigned short)*3;
		part.m_numTriangleShapes = 1;

		part.m_stridingType = hkpExtendedMeshShape::INDICES_INT16;

		shape2->addTrianglesSubpart( part );

		boxInfo.m_shape = shape2;
		boxInfo.m_motionType = hkpMotion::MOTION_FIXED;
		boxInfo.m_position.set(0.0f, 0.0f, 0.0f);
		boxInfo.m_restitution = 0.9f;

		g_floor = new hkpRigidBody(boxInfo);
		shape2->removeReference();

		physicsWorld->addEntity(g_floor);

 

Would you have any ideas what could be wrong?

Best Regards,

vfgdfg



Intel Software Network Forums Statistics

8290 users have contributed to 31237 threads and 99114 posts to date.
In the past 24 hours, we have 8 new thread(s) 19 new posts(s), and 25 new user(s).

In the past 3 days, the most popular thread for everyone has been comparison cilk++, openmp, pthreads first results The most posts were made to Pipeline buffer between stages? The post with the most views is Very amusing...  Escalated as

Please welcome our newest member zq.x