Class SubMesh
Hierarchy
- SubMesh
Implements
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
Creates a new submesh
Parameters
-
materialIndex: number
defines the material index to use
-
verticesStart: number
defines vertex index start
-
verticesCount: number
defines vertices count
-
indexStart: number
defines index start
-
indexCount: number
defines indices count
-
mesh: AbstractMesh
defines the parent mesh
-
Optional renderingMesh: Mesh
defines an optional rendering mesh
-
Optional createBoundingBox: boolean
defines if bounding box should be created for this submesh
-
Optional addToMesh: boolean
defines a boolean indicating that the submesh must be added to the mesh.subMeshes array (true by default)
Returns SubMesh
-
Properties
index CountSearch playground for indexCount
indices count
index StartSearch playground for indexStart
index start
material IndexSearch playground for materialIndex
the material index to use
vertices CountSearch playground for verticesCount
vertices count
vertices StartSearch playground for verticesStart
vertex index start
Accessors
Is Global
-
Returns true if this submesh covers the entire parent mesh
Returns boolean
effect
material Defines
-
Gets material defines used by the effect associated to the sub mesh
Returns Nullable<MaterialDefines>
-
Sets material defines used by the effect associated to the sub mesh
Parameters
-
defines: Nullable<MaterialDefines>
Returns any
-
Methods
can IntersectsSearch playground for canIntersects
-
Checks if the submesh intersects with a ray
Parameters
-
ray: Ray
defines the ray to test
Returns boolean
true is the passed ray intersects the submesh bounding box
-
cloneSearch playground for clone
-
Creates a new submesh from the passed mesh
Parameters
-
newMesh: AbstractMesh
defines the new hosting mesh
-
Optional newRenderingMesh: Mesh
defines an optional rendering mesh
Returns SubMesh
the new submesh
-
disposeSearch playground for dispose
-
Release associated resources
Returns void
get Bounding InfoSearch playground for getBoundingInfo
-
Returns the submesh BoudingInfo object
Returns BoundingInfo
current bounding info (or mesh's one if the submesh is global)
get Class NameSearch playground for getClassName
-
Gets the class name
Returns string
the string "SubMesh".
get Effective MeshSearch playground for getEffectiveMesh
-
Returns the effective mesh of the submesh
Returns AbstractMesh
the effective mesh (could be different from parent mesh)
get MaterialSearch playground for getMaterial
get MeshSearch playground for getMesh
-
Returns the mesh of the current submesh
Returns AbstractMesh
the parent mesh
get Rendering MeshSearch playground for getRenderingMesh
-
Returns the rendering mesh of the submesh
Returns Mesh
the rendering mesh (could be different from parent mesh)
get Replacement MeshSearch playground for getReplacementMesh
-
Returns the replacement mesh of the submesh
Returns Nullable<AbstractMesh>
the replacement mesh (could be different from parent mesh)
intersectsSearch playground for intersects
-
Intersects current submesh with a ray
Parameters
-
ray: Ray
defines the ray to test
-
positions: Vector3[]
defines mesh's positions array
-
indices: IndicesArray
defines mesh's indices array
-
Optional fastCheck: boolean
defines if the first intersection will be used (and not the closest)
-
Optional trianglePredicate: TrianglePickingPredicate
defines an optional predicate used to select faces when a mesh intersection is detected
Returns Nullable<IntersectionInfo>
intersection info or null if no intersection
-
is Completely InFrustumSearch playground for isCompletelyInFrustum
-
True is the submesh bounding box is completely inside the frustum defined by the passed array of planes
Parameters
-
frustumPlanes: Plane[]
defines the frustum planes
Returns boolean
true if the submesh is inside the frustum
-
is InFrustumSearch playground for isInFrustum
-
True is the submesh bounding box intersects the frustum defined by the passed array of planes.
Parameters
-
frustumPlanes: Plane[]
defines the frustum planes
Returns boolean
true if the submesh is intersecting with the frustum
-
refresh Bounding InfoSearch playground for refreshBoundingInfo
-
Sets a new updated BoundingInfo object to the submesh
Parameters
-
Optional data: Nullable<FloatArray>
defines an optional position array to use to determine the bounding info
Returns SubMesh
the SubMesh
-
renderSearch playground for render
-
Renders the submesh
Parameters
-
enableAlphaMode: boolean
defines if alpha needs to be used
Returns SubMesh
the submesh
-
set Bounding InfoSearch playground for setBoundingInfo
-
Sets the submesh BoundingInfo
Parameters
-
boundingInfo: BoundingInfo
defines the new bounding info to use
Returns SubMesh
the SubMesh
-
set EffectSearch playground for setEffect
-
Sets associated effect (effect used to render this submesh)
Parameters
-
effect: Nullable<Effect>
defines the effect to associate with
-
Optional defines: Nullable<MaterialDefines>
defines the set of defines used to compile this effect
Returns void
-
update Bounding InfoSearch playground for updateBoundingInfo
-
Updates the submesh BoundingInfo
Parameters
-
world: DeepImmutable<Matrix>
defines the world matrix to use to update the bounding info
Returns SubMesh
the submesh
-
Static Add ToMeshSearch playground for AddToMesh
-
Add a new submesh to a mesh
Parameters
-
materialIndex: number
defines the material index to use
-
verticesStart: number
defines vertex index start
-
verticesCount: number
defines vertices count
-
indexStart: number
defines index start
-
indexCount: number
defines indices count
-
mesh: AbstractMesh
defines the parent mesh
-
Optional renderingMesh: Mesh
defines an optional rendering mesh
-
Optional createBoundingBox: boolean
defines if bounding box should be created for this submesh
Returns SubMesh
the new submesh
-
Static Create From IndicesSearch playground for CreateFromIndices
-
Creates a new submesh from indices data
Parameters
-
materialIndex: number
the index of the main mesh material
-
startIndex: number
the index where to start the copy in the mesh indices array
-
indexCount: number
the number of indices to copy then from the startIndex
-
mesh: AbstractMesh
the main mesh to create the submesh from
-
Optional renderingMesh: Mesh
the optional rendering mesh
Returns SubMesh
a new submesh
-
Defines a subdivision inside a mesh