Closed SrinivasPrabhu794 closed 2 years ago
I'm not fully following what your strategy is here. If you'd like to place something on the surface and find the highest point over a certain section of the mesh you can use the shapecast function to check the height of the triangles in your target region.
Either way generally the structural properties of the BVH should not be relied upon because the depth, organization, etc can change dramatically depending on the options used during construction.
Hi @gkjohnson
If you'd like to place something on the surface and find the highest point over a certain section of the mesh you can use the shapecast function to check the height of the triangles in your target region.
Do you mean by using the "intersectsTriangle" callback in the shapecast function? Do you have any examples that I can take a look at that does this ? Basically, what I want to implement is basic physics where if a drop an object it should fall on the surface of the mesh below it.
Either way generally the structural properties of the BVH should not be relied upon because the depth, organization, etc can change dramatically depending on the options used during construction.
Ok I understand.
If you look in the examples files there are a couple demos that show to to implement basic physics:
Hi @gkjohnson ,
I have a use case where I need to raycast to a BVH and find a Bounding volume at say level=20, enclosing that intersection point only so that I can do some intersection checks myself. Is that possible to do this at the moment?
USE_CASE: There are multiple complex geometries in the scene and the objects need to be placed/stacked on top of each other. The top surface of one object acts as the ground/base for another object that will be placed on it. For this, I first shapecast and find the top most Y position at any point of intersection. Sometimes for concave objects there are certain hole sections where I need to place the object. In such a case I thought of doing a raycast intersection in -Y direction from the main object in question to the BVH of the geometry below it. If I can get a BV at level=20 for example then I can check if the object is already on the top surface of an object right below it or floating in the air.
Let me know if this is possible.
Thanks!