Click or drag to resize
Ab4d.SharpEngine logo

MeshFactory Class

MeshFactory class provides methods that can create many types of meshes.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.MeshesMeshFactory

Namespace: Ab4d.SharpEngine.Meshes
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 1.0.8740+deb2991acfe86a95cca780cd4f82bcae2805c1a5
Syntax
C#
public static class MeshFactory

The MeshFactory type exposes the following members.

Methods
 NameDescription
Public methodStatic memberAddPlaneTriangleIndices(IListInt32) AddPlaneTriangleIndices adds triangle indexes to the specified list of triangle indices.
Public methodStatic memberAddPlaneTriangleIndices(Int32, Int32, IListInt32, Int32) AddPlaneTriangleIndices adds triangle indexes to the specified list of triangle indices.
Public methodStatic memberAddPlaneVertices AddPlaneVertices adds PositionNormalTextureVertex for the plane with specified parameters to the existing IList of vertices. The method also updates the boundingBox of the positions.
Public methodStatic memberCreateArrowMesh(Vector3, Vector3, Single, Int32, Boolean, String) Create a 3D arrow mesh. The arrow tip radius is set to twice the body radius, and arrow angle is set to 60 degrees.
Public methodStatic memberCreateArrowMesh(Vector3, Vector3, Single, Single, Single, Single, Int32, Boolean, String) Create a 3D arrow mesh with parametrized arrow tip.
Public methodStatic memberCreateBoxMesh(Vector3, Vector3, String) CreateBoxMesh creates a box and returns a StandardMesh with filled vertices array and index array.
Public methodStatic memberCreateBoxMesh(Vector3, Vector3, Int32, Int32, Int32, String) CreateBoxMesh creates a box and returns a StandardMesh with filled vertices array and index array.
Public methodStatic memberCreateCircleMesh Create a 3D mesh representing a flat 2D circle.
Public methodStatic memberCreateConeMesh Create an upright cone mesh.
Public methodStatic memberCreateCylinderMesh Create an upright cylinder mesh as a special case of a cone with equal top and bottom radii.
Public methodStatic memberCreateExtrudedMesh(Vector2, Boolean, Vector3, Vector3, Boolean, Boolean, String) Generate a mesh extruded from a 2D shape. The base surface is defined by a polygon given as a sequence of positions, and is extruded in the direction of the extrudeVector. The texture coordinates are generated using cylindrical projection.
Public methodStatic memberCreateExtrudedMesh(Vector2, Boolean, Vector3, Vector3, Vector3, MeshFactoryExtrudeTextureCoordinatesGenerationType, Boolean, Boolean, String) Generate a mesh extruded from a 2D shape. The base surface is defined by a polygon given as a sequence of positions, and is extruded in the direction of the extrudeVector. The texture coordinates are generated according to the textureCoordinatesGenerationType parameter.
Public methodStatic memberCreateExtrudedMesh(Vector2, Int32, Boolean, Boolean, Vector3, Vector3, Vector3, MeshFactoryExtrudeTextureCoordinatesGenerationType, Boolean, Boolean, String) Generate a mesh extruded from a 2D shape. The base surface is defined by sequence of positions and triangle indices, and is extruded in the direction of the extrudeVector. The texture coordinates are generated according to the textureCoordinatesGenerationType parameter.
Public methodStatic memberCreateExtrudedMeshAlongPath(Vector2, Vector3, Vector3, Boolean, Boolean, String) Generate a mesh extruded from a 2D shape along the defined path in the 3D.
Public methodStatic memberCreateExtrudedMeshAlongPath(Vector2, Int32, Vector3, Vector3, Boolean, Boolean, Boolean, String) Generate a mesh extruded from a 2D shape along the defined path in the 3D.
Public methodStatic memberCreateHashSymbolMesh Creates a mesh that represents a customized hash symbol. This method is used to create a 3D hash symbol for Ab4d.SharpEngine logo.
Public methodStatic memberCreateLatheMesh(Vector3, Vector3, MeshFactoryLatheSection, Int32, Boolean, Boolean, Boolean, NullableVector3, String) Create a 3D lathe mesh using a standard 0-to-360-degrees rotation. A lathe is a 3D shape obtained by rotating a pre-defined control profile around an axis.
Public methodStatic memberCreateLatheMesh(Vector3, Vector3, MeshFactoryLatheSection, Int32, Boolean, Boolean, Boolean, Single, Single, Boolean, NullableVector3, String) Create a 3D lathe mesh using a custom rotation. A lathe is a 3D shape obtained by rotating a pre-defined control profile around an axis.
Public methodStatic memberCreateLogoHashSymbolMesh Creates a mesh that represents a hash symbol that is used for Ab4d.SharpEngine logo.
Public methodStatic memberCreatePlaneMesh CreatePlaneMesh creates a plane and returns a StandardMesh with filled vertices array and index array.
Public methodStatic memberCreatePyramidMesh CreatePyramidMesh creates a plane and returns StandardMesh with filled vertices array and index array.
Public methodStatic memberCreateSphereMesh CreateSphereMesh creates a sphere and returns StandardMesh with filled vertices array and index array.
Public methodStatic memberCreateTrapezoidMesh(Vector3, Vector2, Vector3, Vector2, String) Create an upright trapezoid mesh.
Public methodStatic memberCreateTrapezoidMesh(Vector3, Vector2, Vector3, Vector2, Vector3, Vector3, String) Create a trapezoid mesh with custom base vectors.
Public methodStatic memberCreateTubeLineMesh Create a 3D line mesh from start to end point.
Public methodStatic memberCreateTubeMesh(Vector3, Single, Single, Single, Int32, String) Create an upright 3D tube mesh with same inner and outer radius at both ends. When height is zero, the resulting mesh is a flat 2D shape. When inner radius is zero, the mesh becomes a cylinder (generated as a lathe mesh).
Public methodStatic memberCreateTubeMesh(Vector3, Vector3, Single, Single, Single, Int32, String) Create a 3D tube mesh with same inner and outer radius at both ends, and direction given by the specified height direction vector. When height is zero, the resulting mesh is a flat 2D shape. When inner radius is zero, the mesh becomes a cylinder (generated as a lathe mesh).
Public methodStatic memberCreateTubeMesh(Vector3, Vector3, Single, Single, Single, Single, Single, Int32, Single, Single, String) Create a 3D tube mesh with custom parametrization (i.e., height direction vector, start and end angle for the tube's side surface, separate radii settings for each end of the tube). When height is zero, the resulting mesh is a flat 2D shape. When inner radius is zero, the mesh becomes a cylinder (generated as a lathe mesh).
Public methodStatic memberCreateTubeMeshAlongPath Create a 3D mesh that consists of 3D tubes connecting the path between the given points.
Public methodStatic memberGetBoxTriangleIndicesArray Returns an array of triangle indexes that can be used with vertex buffer created by SetBoxVerticesArray(Vector3, Vector3, PositionNormalTextureVertex, BoundingBox) method.
Public methodStatic memberGetPlaneTriangleIndicesArray Returns an array of triangle indexes that can be used with vertex buffer created by SetPlaneVerticesArray(Vector3, Vector3, Vector3, Single, Single, Int32, Int32, PositionNormalTextureVertex, BoundingBox) method.
Public methodStatic memberGetSharedBoxMesh Gets the shared mesh of a box with center at (0, 0, 0) and size (1, 1, 1).
Public methodStatic memberGetSharedPlaneMesh Gets the shared mesh of a plane with CenterPosition at (0,0,0), PlaneNormal as (0,0,1), PlaneHeightDirection as (0, 1, 0) and Size as (1, 1).
Public methodStatic memberGetSharedSphereMesh Gets the shared sphere mesh with center at (0, 0, 0), radius of 1 and 30 sphere segments.
Public methodStatic memberGetSphereTriangleIndicesArray Returns an array of triangle indexes that can be used with vertex buffer created by SetSphereVerticesArray(Vector3, Single, Int32, PositionNormalTextureVertex, BoundingBox) method.
Public methodStatic memberSetBoxVerticesArray SetBoxVerticesArray fills the PositionNormalTextureVertex array with position, normal and texture coordinates for the box with specified parameters. If the specified vertexBufferArray is null or its Length is not 24, then a new array of PositionNormalTextureVertex with 24 items is created. The method also sets the boundingBox of the positions.
Public methodStatic memberSetPlaneVerticesArray SetPlaneVerticesArray fills the PositionNormalTextureVertex array with position, normal and texture coordinates for the plane with specified parameters. If the specified verticesArray is null or its Length is not correct, then a new array of PositionNormalTextureVertex is created. The method also sets the boundingBox of the positions.
Public methodStatic memberSetSphereVerticesArray SetSphereVerticesArray fills the PositionNormalTextureVertex array with position, normal and texture coordinates for the sphere with specified parameters. If the specified verticesArray is null or its Length is not correct, then a new array of PositionNormalTextureVertex is created. The method also sets the boundingBox of the positions.
Top
Fields
 NameDescription
Public fieldStatic memberSharedSphereSegmentsCount Number of segments used to generate the shared sphere mesh.
Top
See Also