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 void
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 BoundingInfo 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 In FrustumSearch 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 In FrustumSearch 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
project To RefSearch playground for projectToRef
Projects a point on this submesh and stores the result in "ref"
Parameters
vector: Vector3
point to project
positions: Vector3[]
defines mesh's positions array
indices: IndicesArray
defines mesh's indices array
ref: Vector3
vector that will store the result
Returns number
distance from the point and the submesh, or -1 if the mesh rendering mode doesn't support projections
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
reset Draw CacheSearch playground for resetDrawCache
Resets the draw wrappers cache
Parameters
Optional passId: number
If provided, releases only the draw wrapper corresponding to this render pass id
Returns void
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<string | MaterialDefines>
defines the set of defines used to compile this effect
Optional materialContext: IMaterialContext
material context associated to the effect
Optional resetContext: boolean
true to reset the draw context
Returns void
update Bounding InfoSearch playground for updateBoundingInfo
Updates the submesh BoundingInfo
Parameters
world: DeepImmutableObject<Matrix>
defines the world matrix to use to update the bounding info
Returns SubMesh
the submesh
Static Add To MeshSearch 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
Optional createBoundingBox: boolean
defines if bounding box should be created for this submesh
Returns SubMesh
a new submesh
Defines a subdivision inside a mesh