collision detection - isInside not working for btConvexHullShape of Bullet Physics library -


i have created btconvexhullshape using .obj file. have checked other properties , seems created properly.

now have perform collision detection check. need use isinside function. returning false whether point inside or outside.

can 1 help?

human = new btconvexhullshape();  	for (int = 0; < av->verti; i++)  	{  		human->addpoint(btvector3(btscalar(av->vertices[i][0]), btscalar(av->vertices[i][1]), btscalar(av->vertices[i][2])));    	}    	cstring s;  	btvector3 cx(0, -2, 1);  	if (human->isinside(cx, btscalar(1)))  	{  		outputdebugstring(l"true\n");  	}  	else  		outputdebugstring(l"false\n");

i reproduced same issue using bulletsharp in c#. here code:

    // test isinside     convexhullshape hull = new convexhullshape();     hull.addpoint(new vector3(100,0,0));     hull.addpoint(new vector3(100, 100, 0));     hull.addpoint(new vector3(0, 100, 0))     hull.addpoint(new vector3(0,0, 0));     hull.addpoint(new vector3(50,50,100));     bool checkinside = hull.isinside(new vector3(50, 50, 50), 1); 

checkinside false, whereas point {50,50,50} inside convex hull. looked btconvexhullshape class implemententation. seems isinside function not implemented yet , returns false.

    //not yet     bool btconvexhullshape::isinside(const btvector3& ,btscalar ) const     {          btassert(0);          return false;     } 

i did googling on own , found isinside() implementation triangular mesh objects. proposed solution uses ray-casting. haven't tested code yet, looks promising.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -