The reason I ask is because raycasts don't work if the begin and end point of the ray is inside a convex hull shape, so for convex shapes I tried to use the isInside() method and found out that it's not implemented for btConvexHullShape nor btConvexPointCloudShape.
Thanks in advance for any help.
cg
Best way to check if a point is inside a convex hull shape?
-
- Posts: 20
- Joined: Mon Sep 24, 2007 5:45 am
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Best way to check if a point is inside a convex hull sha
You can use the btCollisionWorld::contactPairTest.
Object 1 = convex hull
Object 2 = btSphereShape with zero radius
Alternatively, you can go low level (digg into the source code) and use btGjkPairDetector directly. See Demos\ConvexHullDistance\ConvexHullDistanceDemo.cpp.
Object 1 = convex hull
Object 2 = btSphereShape with zero radius
Alternatively, you can go low level (digg into the source code) and use btGjkPairDetector directly. See Demos\ConvexHullDistance\ConvexHullDistanceDemo.cpp.
-
- Posts: 20
- Joined: Mon Sep 24, 2007 5:45 am
Re: Best way to check if a point is inside a convex hull sha
Ah! thank you, sir!
-
- Posts: 3
- Joined: Mon Jun 24, 2013 1:32 am
Re: Best way to check if a point is inside a convex hull sha
I was hoping that the isInside had been updated on the more recent versions but it doesn't seem to be. Did you end up getting your project working with checking if a point is inside the convex hull?
I am also in need of this for my research application. I am very new to bullet and don't quite see how to use the btGjkPairdetector. Do I only need to set a radius of the btSphereShape or can I also set a point for the center to be at?
I am also in need of this for my research application. I am very new to bullet and don't quite see how to use the btGjkPairdetector. Do I only need to set a radius of the btSphereShape or can I also set a point for the center to be at?