Mesh

Mesh class

A mesh is made of many n-sided polygons.

Methods

constructor

NameDescription
constructor()Initializes a new instance of the Mesh class.

Result:


constructor_overload

NameDescription
constructor_overload(name)Initializes a new instance of the Mesh class.

Parameters:

NameTypeDescription
nameStringName.

Result:


getEdges

NameDescription
getEdges()Gets edges of the Mesh. Edge is optional in mesh, so it can be empty.

Result:


getPolygonCount

NameDescription
getPolygonCount()Gets the count of polygons The polygon count.

Result:


getPolygons

NameDescription
getPolygons()Gets the polygons definition of the mesh

Result:


getVisible

NameDescription
getVisible()Gets or sets if the geometry is visible

Result:


setVisible

NameDescription
setVisible(value)Gets or sets if the geometry is visible

Result:


getDeformers

NameDescription
getDeformers()Gets all deformers associated with this geometry. The deformers.

Result:


getControlPoints

NameDescription
getControlPoints()Gets all control points

Result:


getCastShadows

NameDescription
getCastShadows()Gets or sets whether this geometry can cast shadow

Result:


setCastShadows

NameDescription
setCastShadows(value)Gets or sets whether this geometry can cast shadow

Result:


getReceiveShadows

NameDescription
getReceiveShadows()Gets or sets whether this geometry can receive shadow.

Result:


setReceiveShadows

NameDescription
setReceiveShadows(value)Gets or sets whether this geometry can receive shadow.

Result:


getVertexElements

NameDescription
getVertexElements()Gets all vertex elements

Result:


getParentNodes

NameDescription
getParentNodes()Gets all parent nodes, an entity can be attached to multiple parent nodes for geometry instancing The nodes.

Result:


getExcluded

NameDescription
getExcluded()Gets or sets whether to exclude this entity during exporting.

Result:


setExcluded

NameDescription
setExcluded(value)Gets or sets whether to exclude this entity during exporting.

Result:


getParentNode

NameDescription
getParentNode()Gets or sets the first parent node, if set the first parent node, this entity will be detached from other parent nodes. The parent node.

Result:


setParentNode

NameDescription
setParentNode(value)Gets or sets the first parent node, if set the first parent node, this entity will be detached from other parent nodes. The parent node.

Result:


getScene

NameDescription
getScene()Gets the scene that this object belongs to

Result:


getName

NameDescription
getName()Gets or sets the name. The name.

Result:


setName

NameDescription
setName(value)Gets or sets the name. The name.

Result:


getProperties

NameDescription
getProperties()Gets the collection of all properties.

Result:


getPolygonSize

NameDescription
getPolygonSize(index)Gets the vertex count of the specified polygon.

Parameters:

NameTypeDescription
indexNumberIndex.

Result: Number


createPolygon

NameDescription
createPolygon(indices, offset, length)Creates a new polygon with all vertices defined in indices. To create polygon vertex by vertex, please use PolygonBuilder.

Parameters:

NameTypeDescription
indicesNumber[]Array of the polygon indices, each index points to a control point that forms the polygon.
offsetNumberThe offset of the first polygon index
lengthNumberThe length of the indices

Result: Number


createPolygon

NameDescription
createPolygon(indices)Creates a new polygon with all vertices defined in indices. To create polygon vertex by vertex, please use PolygonBuilder.

Parameters:

NameTypeDescription
indicesNumber[]Array of the polygon indices, each index points to a control point that forms the polygon.

Result: Number


createPolygon

NameDescription
createPolygon(v1, v2, v3, v4)Create a polygon with 4 vertices(quad)

Parameters:

NameTypeDescription
v1NumberIndex of the first vertex
v2NumberIndex of the second vertex
v3NumberIndex of the third vertex
v4NumberIndex of the fourth vertex

Result: Number


createPolygon

NameDescription
createPolygon(v1, v2, v3)Create a polygon with 3 vertices(triangle)

Parameters:

NameTypeDescription
v1NumberIndex of the first vertex
v2NumberIndex of the second vertex
v3NumberIndex of the third vertex

Result: Number


toMesh

NameDescription
toMesh()Gets the Mesh instance from current entity.

Result: Mesh


getElement

NameDescription
getElement(type)Gets a vertex element with specified type

Parameters:

NameTypeDescription
typeVertexElementTypeVertexElementType

Result: VertexElement


getVertexElementOfUV

NameDescription
getVertexElementOfUV(textureMapping)Gets a VertexElementUV instance with given texture mapping type

Parameters:

NameTypeDescription
textureMappingTextureMappingTextureMapping

Result: VertexElementUV


createElement

NameDescription
createElement(type)Creates a vertex element with specified type and add it to the geometry. If type is VertexElementType.UV, a VertexElementUV with texture mapping type to TextureMapping.DIFFUSE will be created.

Parameters:

NameTypeDescription
typeVertexElementTypeVertexElementType

Result: VertexElement


addElement

NameDescription
addElement(element)Adds an existing vertex element to current geometry

Parameters:

NameTypeDescription
elementVertexElementThe vertex element to add

Result: VertexElement


createElement

NameDescription
createElement(type, mappingMode, referenceMode)Creates a vertex element with specified type and add it to the geometry. If type is VertexElementType.UV, a VertexElementUV with texture mapping type to TextureMapping.DIFFUSE will be created.

Parameters:

NameTypeDescription
typeVertexElementTypeVertexElementType
mappingModeMappingModeMappingMode
referenceModeReferenceModeReferenceMode

Result: VertexElement


createElementUV

NameDescription
createElementUV(uvMapping)Creates a VertexElementUV with given texture mapping type.

Parameters:

NameTypeDescription
uvMappingTextureMappingTextureMapping

Result: VertexElementUV


createElementUV

NameDescription
createElementUV(uvMapping, mappingMode, referenceMode)Creates a VertexElementUV with given texture mapping type.

Parameters:

NameTypeDescription
uvMappingTextureMappingTextureMapping
mappingModeMappingModeMappingMode
referenceModeReferenceModeReferenceMode

Result: VertexElementUV


getBoundingBox

NameDescription
getBoundingBox()Gets the bounding box of current entity in its object space coordinate system.

Result: VertexElementUV


getEntityRendererKey

NameDescription
getEntityRendererKey()Gets the key of the entity renderer registered in the renderer

Result: EntityRendererKey


removeProperty

NameDescription
removeProperty(property)Removes a dynamic property.

Parameters:

NameTypeDescription
propertyPropertyWhich property to remove

Result: boolean


removeProperty

NameDescription
removeProperty(property)Remove the specified property identified by name

Parameters:

NameTypeDescription
propertStringnull

Result: boolean


getProperty

NameDescription
getProperty(property)Get the value of specified property

Parameters:

NameTypeDescription
propertyStringProperty name

Result: Object


setProperty

NameDescription
setProperty(property, value)Sets the value of specified property

Parameters:

NameTypeDescription
propertyStringProperty name
valueObjectThe value of the property

Result: Object


findProperty

NameDescription
findProperty(propertyName)Finds the property. It can be a dynamic property (Created by CreateDynamicProperty/SetProperty) or native property(Identified by its name)

Parameters:

NameTypeDescription
propertyNameStringProperty name.

Result: Property


iterator

NameDescription
iterator()Reserved for internal use.

Result: Property