RayMeshGridIntersect - superclass: ReferenceTarget; super-superclass:MAXWrapper - 1:0 - classID: #(930131240, 656216840)
Provides advanced ray-to-mesh intersection methods using a uniform voxel grid as acceleration method.
Initializes the voxel grid with the specified grid size.
The grid size value defines the number of voxels along all 3 axes.
The actual size of the voxels depends on the bounding box of the nodes to be processed.
Please see the Note above - only the first object on the list will be used!
Fills in the voxel grid with data.
Removes all data from the voxel grid.
Performs a box intersection using the specified min. and max. points in world space.
Performs a sphere intersection using the specified center and radius.
Performs a ray intersection using the specified position and direction.
If the doubleSided argument is False, only intersection with faces whose normals point towards the ray will be collected.
When it is True, the faces will be considered double-sided and intersected even when their normals are pointing in the direction of the ray.
The result is 0 if not intersection was detected, or a positive number representing the number of faces that have been intersected.
Performs a segment intersection using the specified two world positions.
This is similar to intersectRay, but instead of a point and direction, the intersection ray is defined using two absolute positions in space, where p1 is the origin and the direction is from p1 to p2.
If the doubleSided argument is False, only intersection with faces whose normals point towards the ray will be collected.
When it is True, the faces will be considered double-sided and intersected even when their normals are pointing in the direction of the ray.
The result is 0 if no intersection was detected, or a positive number representing the number of faces that have been hit.
Returns the index of the TriMesh face for the indexed hit.
The index can be a positive number between 1 and the number of hits reported by the last intersection method.
Returns the Barycentric Coordinates of the TriMesh face for the indexed hit.
The index can be a positive number between 1 and the number of hits reported by the last intersection method.
Returns the face normal of the TriMesh face for the indexed hit in world space.
The index can be a positive number between 1 and the number of hits reported by the last intersection method.
Returns the distance to the indexed hit.
The index can be a positive number between 1 and the number of hits reported by the last intersection method.
This method is for debugging purposes only.
Returns the index of the closest hit.
Returns the index of the farthest hit.
Performsintersections from the specified world point with all faces and returns the number of hits as integer.
You can use the getClosestHit() and getFarthestHit() to determine the closest and farthest faces to the specified world point, getHitDist() to determine the distance to every face, and getPerpDist() to determine the perpendicular distance to the point.
Returns the perpendicular distance to the indexed hit.
The index can be a positive number between 1 and the number of hits reported by the last intersection method.
Prints current statistics, including number of faces and number of searches performed.
The following example creates a sphere and a geosphere, registers the sphere with the voxel grid and then shoots rays from each vertex of the geosphere and selects the faces of the sphere that these rays have hit.