![]() |
VOOZH | about |
dotnet add package SimulationTree.Meshes --version 0.3.9
NuGet\Install-Package SimulationTree.Meshes -Version 0.3.9
<PackageReference Include="SimulationTree.Meshes" Version="0.3.9" />
<PackageVersion Include="SimulationTree.Meshes" Version="0.3.9" />Directory.Packages.props
<PackageReference Include="SimulationTree.Meshes" />Project file
paket add SimulationTree.Meshes --version 0.3.9
#r "nuget: SimulationTree.Meshes, 0.3.9"
#:package SimulationTree.Meshes@0.3.9
#addin nuget:?package=SimulationTree.Meshes&version=0.3.9Install as a Cake Addin
#tool nuget:?package=SimulationTree.Meshes&version=0.3.9Install as a Cake Tool
Data type for storing 3D shapes/geometry.
Below is an example of building a quad mesh from scratch:
Mesh mesh = new(world);
USpan<Vector3> positions = mesh.CreatePositions(4);
USpan<Vector2> uvs = mesh.CreateUVs(4);
USpan<Vector3> normals = mesh.CreateNormals(4);
positions[0] = new(0, 0, 0);
positions[1] = new(1, 0, 0);
positions[2] = new(1, 1, 0);
positions[3] = new(0, 1, 0);
uvs[0] = new(0, 0);
uvs[1] = new(1, 0);
uvs[2] = new(1, 1);
uvs[3] = new(0, 1);
normals[0] = new(0, 0, 1);
normals[1] = new(0, 0, 1);
normals[2] = new(0, 0, 1);
normals[3] = new(0, 0, 1);
mesh.AddTriangle(0, 1, 2);
mesh.AddTriangle(2, 3, 0);
USpan<uint> indices = quadMesh.GetIndices();
Whenever arrays of a mesh are modified in length, the version of the mesh increments.
This gives feedback for systems to update when necessary. But for the cases where the
array lengths remain the same and only contents change, the IncrementVersion function
should be used:
USpan<Vector3> positions = mesh.GetPositions();
positions[0] *= 2;
positions[1] *= 2;
positions[2] *= 2;
positions[3] *= 2;
mesh.IncrementVersion();
positions = mesh.ResizePositions(8);
positions[4] = new(0, 0, 0);
positions[5] = new(1, 0, 0);
positions[6] = new(1, 1, 0);
positions[7] = new(0, 1, 0);
//incrementing version is already done
Often mesh data is wanted in a specific formats . The Assemble function can be used to
retrieve a flat list of float values containing vertex data in the specified order:
USpan<Mesh.Channel> channels = [Mesh.Channel.Position, Mesh.Channel.UV];
USpan<float> vertexData = stackalloc float[(int)channels.GetVertexSize() * 4];
quadMesh.Assemble(vertexData, channels);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 4 NuGet packages that depend on SimulationTree.Meshes:
| Package | Downloads |
|---|---|
|
SimulationTree.Rendering
Package Description |
|
|
SimulationTree.Rendering.Systems
Package Description |
|
|
SimulationTree.Meshes.NineSliced
Package Description |
|
|
SimulationTree.Models
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.3.9 | 473 | 9/24/2025 |