# How to know if point is inside a volume?

How can I test if point A is inside volume B. Of course I can test each vertex in all 6 direction but is this possible with a big number of vertecies. I must be a smarter way.

Best regards

If you limit your test to convex shape the test is quite fast.

With convex shape you have to test for each triangle if the point is in the right side. If pass the test for every triangle the point is inside.
If you want to optimize and you donâ€™t want to recompute the plane every time you can store them.
Remember to transform the point in the same space of the planes, so if the vertexes/planes are stored in local object space so must be the point.

For non convex shape you can subdivide the shape in more simple convex shape.
Is not exactly a simple task but you can find a lot of paper about it.

First, AABB and/or bounding-sphere. Then the 6+ planes forming the convex hull, that you and Rosario mentioned.

Thanks for your replay. I turns out I just have to test against planes witch makes it much more easy.