Identifying vertices within a capsule

Hi guys, I’m looking to identify all vertices of a given object within a capsule. I understand I can convert vertices to world coordinates using transform.transformPoint, but I’m unsure how to detect whether these points lie within a capsule.

Could anyone help?
Thanks

Ok, I want a capsule attached to the mouse position. The capsule will always have it's 'length' aligned with the Z axis, so that its 'into' the screen in this instance (so if it was visible the player would only see it's end - a sphere). When the user clicks the mouse button, I need to identify every vertex within the capsule. Effectively it's a volume, a space, and I need to identify every vertex within that space. Thanks for the response!

1 Answer

1

yourCapsule.renderer.bounds.Contains(someVector3);

Fantastic, thanks to both of you.

renderer.bounds encloses the shape, but there will be points outside the capsule contained in the space.

this is completely wrong. It only does the AABB bounding box "bounds" does not mean bounds in a colloquial sense. TBC, this might indeed be exactly suitable for your needs. Which would be great