C# Class world3D.TriangleMesh

Represents a standard triangle mesh consisting of vertices and faces. A vertex stores - a positions - bone weights and indices - a normal - texture coordinates TriangleMeshes are loaded from 3dsmax .fbx files. The following restrictions apply to *accepted* .fbx files: - The mesh has to have a material assigned to it. - The mesh has to be skinned with at least 1 bone. - The file has to contain exactly one animation called "Take 001" in which every(!) bone of the mesh is animated. - The mesh has to contain >= 2^16 vertices and indices. A TriangleMesh can also convert itself to a DynamicOctree.
Datei anzeigen Open project: denniskb/asvo_cuda

Public Methods

Method Description
TriangleMesh ( string fileName, ContentManager content )

Constructs a triangle mesh from a .fbx file. See TriangleMesh on which restrictions apply to it.

toBFSOctree ( byte maxLevel ) : BFSOctree

Converts this trianlge mesh into a BFSOctree.

Private Methods

Method Description
createFromFBX ( string fileName, ContentManager content ) : void

Reads a .fbx file and creates the triangle mesh out of it.

toDynamicOctree ( byte maxLevel ) : DynamicOctree

Converts this triangle mesh into a DynamicOctree. !Important: Although nodes can have as few as 1 and as many as 8 children, all leavs have the same depth. This is an important property that allows the created octree to be rendred on a CUDA implementation of asvo.

traverse ( byte pos, ushort x, ushort y, ushort z, Vector3 octreeMin, double gridDimension, int index, Vector3 triBBmin, Vector3 triBBmax, byte level, byte maxLevel, DynamicOctreeNode parent ) : void

Helper method used by TriangleMesh.toDynamicOctree. It constructs the DynamicOctree recursively. It is supplied a triangle and adds all nodes to the octree that intersect the triangle.

weight ( DynamicOctreeNode node, FBXVertexFormat vertices, int indices, int index, float u, float v, float w ) : void

Helper function used to assign bone weights to voxels. Since a voxel is approximated by a triangle, in the worst case, 12 bone weights could affect it. This function determines the 4 most influential bones for a voxel and assigns them to it.

Method Details

TriangleMesh() public method

Constructs a triangle mesh from a .fbx file. See TriangleMesh on which restrictions apply to it.
public TriangleMesh ( string fileName, ContentManager content )
fileName string Path to the .fbx file.
content ContentManager ContentManager used to load .fbx files.

toBFSOctree() public method

Converts this trianlge mesh into a BFSOctree.
public toBFSOctree ( byte maxLevel ) : BFSOctree
maxLevel byte The maximum node level/depth of any node in /// the created DynamicOctree.
return BFSOctree