Color legend plain property method
Your mesh as the library reads it: a triangle count, and the three corners of each triangle in the mesh’s own space.
An interface, in the namespace BorrowedTorch.RayTracing. Implement it over whatever your engine keeps on the CPU, and hand it to MeshBlas.Build; nothing is copied into a format of the library’s. The meshes page shows it in context, with code.
Names are colored by what they are: a property or a method; values and fields keep the plain color.
Properties
TriangleCount →
int · Read-only. How many triangles the mesh has. A BLAS is built over this many, and Refit needs the same count again: a mesh whose count changed needs a new build.
Methods
GetTriangle() →
GetTriangle(int triangle, out Vector3 v0, out Vector3 v1, out Vector3 v2) · The three corners of a triangle, in the mesh’s own space. Asked for every triangle twice by a build and once by every refit, and never in between: the BLAS keeps a copy of its own. A hit names its triangle by this index, in TriangleIndex.
| Parameter | Type | Description |
|---|---|---|
triangle |
int |
Which triangle, from 0 to TriangleCount - 1. Keep the numbering stable: it is the one hits report. |
v0 |
out Vector3 |
The first corner. Its weight at a hit is 1 - U - V. |
v1 |
out Vector3 |
The second corner, weighted U at a hit. |
v2 |
out Vector3 |
The third corner, weighted V at a hit. |