Optional
pSource: ThickLinesMeshOptional
pDoNotCloneChildren: booleanProtected
_accessibilityProtected
_boundingProtected
_boundingProtected
_isProtected
_isProtected
_parentProtected
_rangesProtected
_scalingGets or sets the alpha index used to sort transparent meshes
True if the mesh must be rendered in any case (this will shortcut the frustum clipping phase)
Gets a list of Animations associated with the node
The culling strategy to use to check whether the mesh must be rendered or not. This value can be changed at any time and will be used on the next render mesh selection. The possible values are :
Gets or sets the orientation for POV movement & rotation
Gets the delay loading state of the mesh (when delay loading is turned on)
https://doc.babylonjs.com/features/featuresDeepDive/importers/incrementalLoading
Gets the file containing delay loading data for this mesh
Gets or sets a boolean indicating that the bounding info does not need to be kept in sync (for performance reason)
Defines edge color used when edgesRenderer is enabled
Gets the edgesRenderer associated with the mesh
true to use the edge renderer for all instances of this mesh
Defines edge width used when edgesRenderer is enabled
Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))
https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
Gets or sets the ellipsoid offset used to impersonate this mesh when using collision engine (default is (0, 0, 0))
https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
Gets or sets the id of the node
Gets or sets a boolean indicating whether to render ignoring the active camera's max z setting. (false by default) Note this will reduce performance when set to true.
Gets or sets a boolean indicating that non uniform scaling (when at least one component is different from others) should be ignored. By default the system will update normals to compensate
List of inspectable custom properties (used by the Inspector)
https://doc.babylonjs.com/toolsAndResources/inspector#extensibility
Object used to store instanced buffers defined by user
https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances#custom-buffers
Gets the list of instances created from this mesh it is not supposed to be modified manually. Note also that the order of the InstancedMesh wihin the array is not significant and might change.
https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)
https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
Gets or sets a boolean indicating if the mesh can be near grabbed. Default is false
Gets or sets a boolean indicating if the mesh can be near picked. Default is false
Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true
Gets or sets a boolean indicating if the mesh is visible (renderable). Default is true
Gets or sets an object used to store user defined information for the node
Gets or sets the name of the node
An event triggered after the world matrix is updated
An event triggered when this mesh collides with another one
An event triggered when the collision's position changes
An event triggered when the mesh is disposed
User defined function used to change how LOD level selection is done
https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
An event triggered when material is changed
Will notify when the mesh is completely ready, including materials. Observers added to this observable will be removed once triggered
Callback raised when the node is ready to be used
An event triggered when the mesh is rebuilt.
Defines color to use when rendering outline
Define width to use when rendering outline
Defines alpha to use when rendering overlay
Defines color to use when rendering overlay
Use this property to change the original side orientation defined at construction time
Gets or sets a boolean indicating that even if rotationQuaternion is defined, you can keep updating rotation property and Babylon.js will just mix both
For internal use only. Please do not use.
Multiplication factor on scale x/y/z when computing the world matrix. Eg. for a 1x1x1 cube setting this to 2 will make it a 2x2x2 cube
Gets or sets a boolean indicating if the bounding box must be rendered as well (false by default)
Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default)
Gets or sets a string used to store user defined state for the node
Gets or sets the list of subMeshes
https://doc.babylonjs.com/features/featuresDeepDive/materials/using/multiMaterials
Gets or sets the unique id of the node
Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default)
Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes picking (true by default)
Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default)
Static
Readonly
BACKSIDEMesh side orientation : usually the internal or back surface
Static
Readonly
BOTTOMMesh tile positioning : part tiles on bottom
Static
BillboardChild transform with Billboard flags should or should not apply parent rotation (default if off)
Static
Readonly
CAP_Mesh cap setting : two caps, one at the beginning and one at the end of the mesh
Static
Readonly
CAP_Mesh cap setting : one cap at the end of the mesh
Static
Readonly
CAP_Mesh cap setting : one cap at the beginning of the mesh
Static
Readonly
CENTERMesh tile positioning : part tiles same on left/right or top/bottom
Static
Readonly
CULLINGSTRATEGY_Culling strategy : Bounding Sphere Only. This is an exclusion test. It's faster than the standard strategy because the bounding box is not tested. It's also less accurate than the standard because some not visible objects can still be selected. Test : is the bounding sphere outside the frustum ? If not, then the cullable object is in the frustum.
Static
Readonly
CULLINGSTRATEGY_Culling strategy : Optimistic Inclusion. This in an inclusion test first, then the standard exclusion test. This can be faster when a cullable object is expected to be almost always in the camera frustum. This could also be a little slower than the standard test when the tested object center is not the frustum but one of its bounding box vertex is still inside. Anyway, it's as accurate as the standard strategy. Test : Is the cullable object bounding sphere center in the frustum ? If not, apply the default culling strategy.
Static
Readonly
CULLINGSTRATEGY_Culling strategy : Optimistic Inclusion then Bounding Sphere Only. This in an inclusion test first, then the bounding sphere only exclusion test. This can be the fastest test when a cullable object is expected to be almost always in the camera frustum. This could also be a little slower than the BoundingSphereOnly strategy when the tested object center is not in the frustum but its bounding sphere still intersects it. It's less accurate than the standard strategy and as accurate as the BoundingSphereOnly strategy. Test : Is the cullable object bounding sphere center in the frustum ? If not, apply the Bounding Sphere Only strategy. No Bounding Box is tested here.
Static
Readonly
CULLINGSTRATEGY_Default culling strategy : this is an exclusion test and it's the more accurate. Test order : Is the bounding sphere outside the frustum ? If not, are the bounding box vertices outside the frustum ? It not, then the cullable object is in the frustum.
Static
Readonly
DEFAULTSIDEMesh side orientation : by default, FRONTSIDE
Static
Readonly
DOUBLESIDEMesh side orientation : both internal and external or front and back surfaces
Static
Readonly
FLIP_Mesh pattern setting : rotate pattern and rotate
Static
Readonly
FLIP_Mesh pattern setting : flip and rotate alternate tiles on each row or column
Static
Readonly
FLIP_Mesh pattern setting : flip (reflect in y axis) all tiles on alternate rows
Static
Readonly
FLIP_Mesh pattern setting : flip (reflect in y axis) alternate tiles on each row or column
Static
Readonly
FRONTSIDEMesh side orientation : usually the external or front surface
Static
INSTANCEDMESH_Indicates that the instanced meshes should be sorted from back to front before rendering if their material is transparent
Static
Readonly
LEFTMesh tile positioning : part tiles on left
Static
Readonly
NO_Mesh cap setting : no cap
Static
Readonly
NO_Mesh pattern setting : no flip or rotate
Static
OCCLUSION_Use an accurate occlusion algorithm
Static
OCCLUSION_Use a conservative occlusion algorithm
Static
OCCLUSION_No occlusion
Static
OCCLUSION_Occlusion set to optimistic
Static
OCCLUSION_Occlusion set to strict
Static
Readonly
RIGHTMesh tile positioning : part tiles on right
Static
Readonly
ROTATE_Mesh pattern setting : rotate (180degs) all tiles on alternate rows
Static
Readonly
ROTATE_Mesh pattern setting : rotate (180degs) alternate tiles on each row or column
Static
Readonly
TOPMesh tile positioning : part tiles on top
Returns the current mesh absolute position. Returns a Vector3.
Returns the current mesh absolute rotation. Returns a Quaternion.
Returns the current mesh absolute scaling. Returns a Vector3.
Gets or sets the accessibility tag to describe the node for accessibility purpose.
Gets or sets the animation properties override
Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default)
Gets a boolean indicating if the normals aren't to be recomputed on next mesh positions
array update. This property is pertinent only for updatable parametric shapes.
Gets or sets the baked vertex animation manager
https://doc.babylonjs.com/features/featuresDeepDive/animation/baked_texture_animations
Gets the list of attached behaviors
https://doc.babylonjs.com/features/featuresDeepDive/behaviors
Gets or sets the billboard mode. Default is 0.
Value | Type | Description |
---|---|---|
0 | BILLBOARDMODE_NONE | |
1 | BILLBOARDMODE_X | |
2 | BILLBOARDMODE_Y | |
4 | BILLBOARDMODE_Z | |
7 | BILLBOARDMODE_ALL |
Gets the list of clones of this mesh The scene must have been constructed with useClonedMeshMap=true for this to work! Note that useClonedMeshMap=true is the default setting
Gets Collider object used to compute collisions (not physics)
https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
Gets or sets the current collision group mask (-1 by default). A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
Gets or sets a collision mask used to mask collisions (default is -1). A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
Gets or sets a collision response flag (default is true). when collisionResponse is false, events are still triggered but colliding entity has no response This helps creating trigger volume when user wants collision feedback events but not position/velocity to respond to the collision.
number of collision detection tries. Change this value if not all collisions are detected and handled properly
Gets or sets a boolean used to define if the node must be serialized
When enabled, decompose picking matrices for better precision with large values for mesh position and scling
The location (Vector3) where the facet depth sort must be computed from. By default, the active camera position. Used only when facet depth sort is enabled
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#facet-depth-sort
Gets the number of facets in the mesh
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#what-is-a-mesh-facet
Gets or sets a boolean indicating that the update of the instance buffer of the world matrices must be performed in all cases (and notably even in frozen mode)
Gets or sets the forced number of instances to display. If 0 (default value), the number of instances is not forced and depends on the draw type (regular / instance / thin instances mesh)
The forward direction of that transform in world space.
Gets the mesh internal Geometry object
Returns true if there is already a bounding info
Gets a boolean indicating if this mesh has LOD
Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values
Gets or sets the distance of the object to max, often used by skybox
Gets a boolean indicating if this mesh is an instance or a regular mesh
gets a boolean indicating if facetData is enabled
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#what-is-a-mesh-facet
Gets or sets a boolean indicating that this mesh does not use index buffer
True if the World matrix has been frozen.
Gets or sets the current layer mask (default is 0x0FFFFFFF)
https://doc.babylonjs.com/features/featuresDeepDive/cameras/layerMasksAndMultiCam
Gets the list of lights affecting that mesh
Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual
Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual
Gets or sets the morph target manager
https://doc.babylonjs.com/features/featuresDeepDive/mesh/morphTargets
Gets or sets a boolean indicating that the facets must be depth sorted on next call to updateFacetData()
.
Works only for updatable meshes.
Doesn't work with multi-materials
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#facet-depth-sort
True if the scaling property of this object is non uniform eg. (1,2,1)
Gets or sets the number of allowed bone influences per vertex (4 by default)
An event triggered after rendering the mesh
An event triggered before binding the mesh
Sets a callback to call before drawing the mesh. It is recommended to use onBeforeDrawObservable instead
An event triggered before drawing the mesh
An event triggered before rendering the mesh
An event triggeredbetween rendering pass when using separateCullingPass = true
An event triggered when the node is cloned
Set a function to call when this mesh collides with another one
Optional
collidedMesh: AbstractMeshSet a function to call when the collision's position changes
Sets a callback that will be raised when the node will be disposed
An event triggered when the enabled state of the node changes
Sets a value overriding the instance count. Only applicable when custom instanced InterleavedVertexBuffer are used rather than InstancedMeshs
Gets or sets the parent of the node (without keeping the current position in the scene)
https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/parent
The ratio (float) to apply to the bounding box size to set to the partitioning space. Ex : 1.01 (default) the partitioning space is 1% bigger than the bounding box
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#tweaking-the-partitioning
Gets or set the number (integer) of subdivisions per axis in the partitioning space
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#tweaking-the-partitioning
Gets or sets the property which disables the test that is checking that the mesh under the pointer is the same than the previous time we tested for it (default: false). Set this property to true if you want thin instances picking to be reported accurately when moving over the mesh. Note that setting this property to true will incur some performance penalties when dealing with pointer events for this mesh so use it sparingly.
Gets or set the node position (default is (0.0, 0.0, 0.0))
Gets or sets a boolean indicating that parent rotation should be preserved when using billboards. This could be useful for glTF objects where parent rotation helps converting from right handed to left handed
Gets the array buffer used to store the instanced buffer used for instances' previous world matrices
Gets or sets a boolean indicating that this mesh can receive realtime shadows
https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
Specifies the rendering group id for this mesh (0 by default)
The right direction of that transform in world space.
Gets or sets the rotation property : a Vector3 defining the rotation value in radians around each local axis X, Y, Z (default is (0.0, 0.0, 0.0)). If rotation quaternion is set, this Vector3 will be ignored and copy from the quaternion
Gets or sets the rotation Quaternion property : this a Quaternion object defining the node rotation by using a unit quaternion (undefined by default, but can be null). If set, only the rotationQuaternion is then used to compute the node rotation (ie. node.rotation will be ignored)
Gets or sets the scaling property : a Vector3 defining the node scaling along each local axis X, Y, Z (default is (1.0, 1.0, 1.0)).
Gets or sets a skeleton to apply skinning transformations
https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
Gets the source mesh (the one used to clone this one from)
Gets or sets current surrounding meshes (null by default).
By default collision detection is tested against every mesh in the scene. It is possible to set surroundingMeshes to a defined list of meshes and then only these specified meshes will be tested for the collision.
Note: if set to an empty array no collision will happen when this mesh is moved.
The up direction of that transform in world space.
Gets a boolean indicating if this mesh has skinning data and an attached skeleton
Determines if the LOD levels are intended to be calculated using screen coverage (surface area ratio) instead of distance.
Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry)
Gets or sets mesh visibility between 0 and 1 (default is 1)
Gets or sets mesh visibility between 0 and 1 (default is 1)
Returns directly the latest state of the mesh World matrix. A Matrix is returned.
Gets the array buffer used to store the instanced buffer used for instances' world matrices
Static
BILLBOARDMODE_Billboard on all axes
Static
BILLBOARDMODE_No billboard
Static
BILLBOARDMODE_Billboard on using position instead of orientation
Static
BILLBOARDMODE_Billboard on X axis
Static
BILLBOARDMODE_Billboard on Y axis
Static
BILLBOARDMODE_Billboard on Z axis
Protected
_afterProtected
_buildAttach a behavior to the node
https://doc.babylonjs.com/features/featuresDeepDive/behaviors
the current Node
defines the behavior to attach
Optional
attachImmediately: booleandefines that the behavior must be attached even if the scene is still loading
Adds the passed mesh as a child to the current mesh
the current mesh
defines the child mesh
Optional
preserveScalingSign: booleanif true, keep scaling sign of child. Otherwise, scaling sign might change.
Add a mesh as LOD level triggered at the given distance.
https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
This mesh (for chaining)
Either distance from the center of the object to show this level or the screen coverage if useScreenCoverage
is set to true
.
If screen coverage, value is a fraction of the screen's total surface, between 0 and 1.
Example Playground for distance https://playground.babylonjs.com/#QE7KM#197
Example Playground for screen coverage https://playground.babylonjs.com/#QE7KM#196
The mesh to be added as LOD level (can be null)
Adds a rotation step to the mesh current rotation. x, y, z are Euler angles expressed in radians. This methods updates the current mesh rotation, either mesh.rotation, either mesh.rotationQuaternion if it's set. This means this rotation is made in the mesh local space only. It's useful to set a custom rotation order different from the BJS standard one YXZ. Example : this rotates the mesh first around its local X axis, then around its local Z axis, finally around its local Y axis.
mesh.addRotation(x1, 0, 0).addRotation(0, 0, z2).addRotation(0, 0, y3);
Note that addRotation()
accumulates the passed rotation values to the current ones and computes the .rotation or .rotationQuaternion updated values.
Under the hood, only quaternions are used. So it's a little faster is you use .rotationQuaternion because it doesn't need to translate them back to Euler angles.
the TransformNode.
Rotation to add
Rotation to add
Rotation to add
Align the mesh with a normal
the current mesh
defines the normal to use
Optional
upDirection: Vector3can be used to redefined the up vector to use (will use the (0, 1, 0) by default)
Modifies the mesh geometry according to a displacement map. A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex. The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated.
the Mesh.
is a string, the URL from the image file is to be downloaded.
is the lower limit of the displacement.
is the upper limit of the displacement.
Optional
onSuccess: ((mesh: Mesh) => void)is an optional Javascript function to be called just after the mesh is modified. It is passed the modified mesh and must return nothing.
Optional
uvOffset: Vector2is an optional vector2 used to offset UV.
Optional
uvScale: Vector2is an optional vector2 used to scale UV.
Optional
forceUpdate: booleandefines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
Modifies the mesh geometry according to a displacementMap buffer. A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex. The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated.
the Mesh.
is a Uint8Array
buffer containing series of Uint8
lower than 255, the red, green, blue and alpha values of each successive pixel.
is the width of the buffer image.
is the height of the buffer image.
is the lower limit of the displacement.
is the upper limit of the displacement.
Optional
uvOffset: Vector2is an optional vector2 used to offset UV.
Optional
uvScale: Vector2is an optional vector2 used to scale UV.
Optional
forceUpdate: booleandefines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
Attach the current TransformNode to another TransformNode associated with a bone
this object
Bone affecting the TransformNode
TransformNode associated with the bone
Modifies the mesh geometry according to its own current World Matrix. The mesh World Matrix is then reset. This method returns nothing but really modifies the mesh even if it's originally not set as updatable. Note that, under the hood, this method sets a new VertexBuffer each call.
https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/bakingTransforms
the current mesh
Optional
bakeIndependentlyOfChildren: booleanindicates whether to preserve all child nodes' World Matrix during baking
Modifies the mesh geometry according to the passed transformation matrix. This method returns nothing, but it really modifies the mesh even if it's originally not set as updatable. The mesh normals are modified using the same transformation. Note that, under the hood, this method sets a new VertexBuffer each call.
https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/bakingTransforms
the current mesh
defines the transform matrix to use
Will start the animation sequence
the object created for this animation. If range does not exist, it will return null
defines the range frames for animation sequence
Optional
loop: booleandefines if the animation should loop (false by default)
Optional
speedRatio: numberdefines the speed factor in which to run the animation (1 by default)
Optional
onAnimationEnd: (() => void)defines a function to be executed when the animation ended (undefined by default)
Creates a new bounding info for the mesh
the new bounding info
min vector of the bounding box/sphere
max vector of the bounding box/sphere
Optional
worldMatrix: DeepImmutableObject<Matrix>defines the new world matrix
Calculate relative position change from the point of view of behind the front of the mesh. This is performed taking into account the meshes current rotation, so you do not have to care. Supports definition of mesh facing forward or backward definedFacingForwardSearch | See definedFacingForwardSearch.
the new displacement vector
defines the distance on the right axis
defines the distance on the up axis
defines the distance on the forward axis
Calculate relative rotation change from the point of view of behind the front of the mesh. Supports definition of mesh facing forward or backward definedFacingForwardSearch | See definedFacingForwardSearch.
the new rotation vector
defines the flip
defines the twirl
defines the tilt
Renormalize the mesh and patch it up if there are no weights Similar to normalization by adding the weights compute the reciprocal and multiply all elements, this wil ensure that everything adds to 1. However in the case of zero weights then we set just a single influence to 1. We check in the function for extra's present and if so we use the normalizeSkinWeightsWithExtras rather than the FourWeights version.
Optional
pNewParent: null | NodeOptional
pDoNotCloneChildren: booleanModify the mesh to get a flat shading rendering. This means each mesh facet will then have its own normals. Usually new vertices are added in the mesh geometry to get this result. Warning : the mesh is really modified even if not set originally as updatable and, under the hood, a new VertexBuffer is allocated.
current mesh
This method removes all the mesh indices and add new vertices (duplication) in order to unfold facets into buffers. In other words, more vertices, no more indices and a single bigger VBO. The mesh is really modified even if not set originally as updatable. Under the hood, a new VertexBuffer is allocated.
current mesh
Detach the transform node if its associated with a bone
this object
Optional
resetToPreviousParent: booleanIndicates if the parent that was in effect when attachToBone was called should be set back or if we should set parent to null instead (defaults to the latter)
Disables the feature FacetData and frees the related memory
the current mesh
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
Enables the edge rendering mode on the mesh. This mode makes the mesh edges visible
the currentAbstractMesh
Optional
epsilon: numberdefines the maximal distance between two angles to detect a face
Optional
checkVerticesInsteadOfIndices: booleanindicates that we should check vertex list directly instead of faces
Optional
options: IEdgesRendererOptionsoptions to the edge renderer
Inverses facet orientations. Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.
current mesh
Optional
flipNormals: booleanwill also inverts the normals
Force adjacent facets to share vertices and remove any facets that have all vertices in a line This will undo any application of covertToFlatShadedMesh Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.
Prevents the World matrix to be computed any longer
the TransformNode.
Optional
newWorldMatrix: Nullable<Matrix>defines an optional matrix to use as world matrix
Optional
decompose: booleandefines whether to decompose the given newWorldMatrix or directly assign
Gets an attached behavior by name
https://doc.babylonjs.com/features/featuresDeepDive/behaviors
null if behavior was not found else the requested behavior
defines the name of the behavior to look for
Returns the mesh BoundingInfo object or creates a new one and returns if it was undefined.
Note that it returns a shallow bounding of the mesh (i.e. it does not include children).
To get the full bounding of all children, call getHierarchyBoundingVectors
instead.
a BoundingInfo
Get all child-meshes of this node
an array of AbstractMesh
Optional
directDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)
Optional
predicate: ((node: Node) => node is T)defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Get all child-meshes of this node
an array of AbstractMesh
Optional
directDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)
Optional
predicate: ((node: Node) => boolean)defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Get all child-transformNodes of this node
an array of TransformNode
Optional
directDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
Optional
predicate: ((node: Node) => boolean)defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Get all direct children of this node
an array of Node
Optional
predicate: ((node: Node) => node is T)defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Optional
directDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)
Get all direct children of this node
an array of Node
Optional
predicate: ((node: Node) => boolean)defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Optional
directDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)
Returns the closest mesh facet index at (x,y,z) World coordinates, null if not found
the face index if found (or null instead)
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
defines x coordinate
defines y coordinate
defines z coordinate
Optional
projected: Vector3sets as the (x,y,z) world projection on the facet
Optional
checkFace: booleanif true (default false), only the facet "facing" to (x,y,z) or only the ones "turning their backs", according to the parameter "facing" are returned
Optional
facing: booleanif facing and checkFace are true, only the facet "facing" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet "turning their backs" to (x, y, z) are returned : negative dot (x, y, z) * facet position
Returns the closest mesh facet index at (x,y,z) local coordinates, null if not found
the face index if found (or null instead)
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
defines x coordinate
defines y coordinate
defines z coordinate
Optional
projected: Vector3sets as the (x,y,z) local projection on the facet
Optional
checkFace: booleanif true (default false), only the facet "facing" to (x,y,z) or only the ones "turning their backs", according to the parameter "facing" are returned
Optional
facing: booleanif facing and checkFace are true, only the facet "facing" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet "turning their backs" to (x, y, z) are returned : negative dot (x, y, z) * facet position
Will return all nodes that have this node as ascendant
all children nodes of all types
Optional
directDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
Optional
predicate: ((node: Node) => node is T)defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Will return all nodes that have this node as ascendant
all children nodes of all types
Optional
directDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
Optional
predicate: ((node: Node) => boolean)defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Returns a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh. This Vector3 is expressed in the World space.
a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh.
axis to rotate
Sets the Vector3 "result" as the rotated Vector3 "localAxis" in the same rotation than the mesh. localAxis is expressed in the mesh local space. result is computed in the World space from the mesh World matrix.
this TransformNode.
axis to rotate
the resulting transformnode
Returns the object "parameter" set with all the expected parameters for facetData computation by ComputeNormals()
the parameters
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
Returns the facetLocalNormals array. The normals are expressed in the mesh local spac
an array of Vector3
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
Returns the facetLocalPartitioning array
an array of array of numbers
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
Returns the facetLocalPositions array. The facet positions are expressed in the mesh local space
an array of Vector3
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
Returns the i-th facet normal in the world system. This method allocates a new Vector3 per call
a new Vector3
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
defines the facet index
Sets the reference Vector3 with the i-th facet normal in the world system
the current mesh
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
defines the facet index
defines the target vector
Returns the i-th facet position in the world system. This method allocates a new Vector3 per call
a new Vector3
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
defines the facet index
Sets the reference Vector3 with the i-th facet position in the world system
the current mesh
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
defines the facet index
defines the target vector
Returns the facets (in an array) in the same partitioning block than the one the passed coordinates are located (expressed in the mesh local system)
the array of facet indexes
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
defines x coordinate
defines y coordinate
defines z coordinate
Return the minimum and maximum world vectors of the entire hierarchy under current node
the new bounding vectors
Optional
includeDescendants: booleanInclude bounding info from descendants as well (true by default)
Optional
predicate: Nullable<((abstractMesh: AbstractMesh) => boolean)>defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.
the indices array or an empty array if the mesh has no geometry
Optional
copyWhenShared: booleanIf true (default false) and and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one.
Optional
forceCopy: booleandefines a boolean indicating that the returned array must be cloned upon returning it
Returns the registered LOD mesh distant from the parameter camera
position if any, else returns the current mesh.
https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
This mesh (for chaining)
defines the camera to use to compute distance
Optional
boundingSphere: BoundingSpheredefines a custom bounding sphere to use instead of the one from this mesh
Returns the LOD level mesh at the passed distance or null if not found.
https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
a Mesh or null
The distance from the center of the object to show this level
Gets the material used to render the mesh in a specific render pass
material used for the render pass. If no specific material is used for this render pass, undefined is returned (meaning mesh.material is used for this pass)
render pass id
Get the normals vertex data and optionally apply skeleton and morphing.
the normals data
Optional
applySkeleton: booleandefines whether to apply the skeleton
Optional
applyMorph: booleandefines whether to apply the morph target
Get the position vertex data and optionally apply skeleton and morphing.
the position data
Optional
applySkeleton: booleandefines whether to apply the skeleton
Optional
applyMorph: booleandefines whether to apply the morph target
Optional
data: Nullable<FloatArray>defines the position data to apply the skeleton and morph to
Returns the mesh VertexBuffer object from the requested kind
a FloatArray or null if the mesh has no vertex buffer for this kind.
defines which buffer to read from (positions, indices, normals, etc). Possible kind
values :
Returns the content of an associated vertex buffer
a FloatArray or null if the mesh has no geometry or no vertex buffer for this kind.
defines which buffer to read from (positions, indices, normals, etc). Possible kind
values :
Optional
copyWhenShared: booleandefines a boolean indicating that if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one
Optional
forceCopy: booleandefines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is
Increase the number of facets and hence vertices in a mesh Vertex normals are interpolated from existing vertex normals Warning : the mesh is really modified even if not set originally as updatable. A new VertexBuffer is created under the hood each call.
Optional
numberPerEdge: numberthe number of new vertices to add to each edge of a facet, optional default 1
Optional
newParent: Nullable<TransformNode>Optional
options: { Optional
onNewNodeCreated: ((source: TransformNode, clone: TransformNode) => void)Checks if the passed Ray intersects with the mesh
the picking info
https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/mesh_intersect
defines the ray to use
Optional
fastCheck: booleandefines if fast mode (but less precise) must be used (false by default)
Optional
trianglePredicate: TrianglePickingPredicatedefines an optional predicate used to select faces when a mesh intersection is detected
Optional
onlyBoundingInfo: booleandefines a boolean indicating if picking should only happen using bounding info (false by default)
Optional
worldToUse: Matrixdefines the world matrix to use to get the world coordinate of the intersection point
Optional
skipBoundingInfo: booleana boolean indicating if we should skip the bounding info check
True if the mesh intersects another mesh or a SolidParticle object
true if there is an intersection
defines a target mesh or SolidParticle to test
Optional
precise: booleanUnless the parameter precise
is set to true
the intersection is computed according to Axis Aligned Bounding Boxes (AABB), else according to OBB (Oriented BBoxes)
Optional
includeDescendants: booleanCan be set to true to test if the mesh defined in parameters intersects with the current mesh or any child meshes
Returns true
if the mesh is completely in the frustum defined be the passed array of planes.
A mesh is completely in the frustum if its bounding box it completely inside the frustum.
true if the mesh is completely in the frustum planes
defines the frustum to test
Is this node a descendant of the given node? The function will iterate up the hierarchy until the ancestor was found or no more parents defined
a boolean indicating if this node is a descendant of the given node
defines the parent node to inspect
Is this node enabled? If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true
whether this node (and its parent) is enabled
Optional
checkAncestors: booleanindicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors
Returns true
if the mesh is within the frustum defined by the passed array of planes.
A mesh is in the frustum if its bounding box intersects the frustum
true if the mesh is in the frustum planes
defines the frustum to test
Determine if the current mesh is ready to be rendered
true if all associated assets are ready (material, textures, shaders)
Optional
completeCheck: booleandefines if a complete check (including materials and lights) has to be done (false by default)
Optional
forceInstanceSupport: booleanwill check if the mesh will be ready when used with instances (false by default)
Returns a boolean defining if the vertex data for the requested kind
is updatable.
a boolean
defines which buffer to check (positions, indices, normals, etc). Possible kind
values :
Tests if a specific vertex buffer is associated with this mesh
a boolean
defines which buffer to check (positions, indices, normals, etc). Possible kind
values :
Orients a mesh towards a target point. Mesh must be drawn facing user.
the TransformNode.
the position (must be in same space as current mesh) to look at
Optional
yawCor: numberoptional yaw (y-axis) correction in radians
Optional
pitchCor: numberoptional pitch (x-axis) correction in radians
Optional
rollCor: numberoptional roll (z-axis) correction in radians
Optional
space: Spacethe chosen space of the target
Flags an associated vertex buffer as updatable
defines which buffer to use (positions, indices, normals, etc). Possible kind
values :
Optional
updatable: booleandefines if the updated vertex buffer must be flagged as updatable
Perform relative position change from the point of view of behind the front of the mesh. This is performed taking into account the meshes current rotation, so you do not have to care. Supports definition of mesh facing forward or backward definedFacingForwardSearch | See definedFacingForwardSearch.
the current mesh
defines the distance on the right axis
defines the distance on the up axis
defines the distance on the forward axis
Move the mesh using collision engine
https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
the current mesh
defines the requested displacement vector
Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
the current mesh
Optional
includeDescendants: booleanUse the hierarchy's bounding box instead of the mesh's bounding box. Default is false
Optional
ignoreRotation: booleanignore rotation when computing the scale (ie. object will be axis aligned). Default is false
Optional
predicate: Nullable<((node: AbstractMesh) => boolean)>predicate that is passed in to getHierarchyBoundingVectors when selecting which object should be included when scaling
Optimization of the mesh's indices, in case a mesh has duplicated vertices. The function will only reorder the indices and will not remove unused vertices to avoid problems with submeshes. This should be used together with the simplification to avoid disappearing triangles.
the current mesh
Optional
successCallback: ((mesh?: Mesh) => void)an optional success callback to be called after the optimization finished.
Optional
mesh: MeshThis method recomputes and sets a new BoundingInfo to the mesh unless it is locked. This means the mesh underlying bounding box and sphere are recomputed.
the current mesh
Optional
applySkeleton: booleandefines whether to apply the skeleton before computing the bounding info
Optional
applyMorph: booleandefines whether to apply the morph target before computing the bounding info
Registers for this mesh a javascript function called just after the rendering is complete
the current mesh
defines the function to call after rendering this mesh
If you'd like to be called back after the mesh position, rotation or scaling has been updated.
the TransformNode.
callback function to add
Registers for this mesh a javascript function called just before the rendering process
the current mesh
defines the function to call before rendering this mesh
Register a custom buffer that will be instanced
https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances#custom-buffers
defines the buffer kind
defines the stride in floats
Remove an attached behavior
https://doc.babylonjs.com/features/featuresDeepDive/behaviors
the current Node
defines the behavior to attach
Removes the passed mesh from the current mesh children list
the current mesh
defines the child mesh
Optional
preserveScalingSign: booleanif true, keep scaling sign of child. Otherwise, scaling sign might change.
Remove a mesh from the LOD array
https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
This mesh (for chaining)
defines the mesh to be removed
Delete a vertex buffer associated with this mesh
defines which buffer to delete (positions, indices, normals, etc). Possible kind
values :
Triggers the draw call for the mesh. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager
the current mesh
defines the subMesh to render
defines if alpha mode can be changed
Optional
effectiveMeshReplacement: AbstractMeshdefines an optional mesh used to provide info for the rendering
Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in the given space.
space (default LOCAL) can be either Space.LOCAL, either Space.WORLD.
Note that the property rotationQuaternion
is then automatically updated and the property rotation
is set to (0,0,0) and no longer used.
The passed axis is also normalized.
the TransformNode.
the axis to rotate around
the amount to rotate in radians
Optional
space: SpaceSpace to rotate in (Default: local)
Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in world space.
Note that the property rotationQuaternion
is then automatically updated and the property rotation
is set to (0,0,0) and no longer used.
The passed axis is also normalized. .
Method is based on http://www.euclideanspace.com/maths/geometry/affine/aroundPoint/index.htm
the TransformNode
the point to rotate around
the axis to rotate around
the amount to rotate in radians
Perform relative rotation change from the point of view of behind the front of the mesh. Supports definition of mesh facing forward or backward definedFacingForwardSearch | See definedFacingForwardSearch.
the current mesh
defines the flip
defines the twirl
defines the tilt
Sets this transform node rotation to the given local axis.
this TransformNode
the axis in local space
Optional
yawCor: numberoptional yaw (y-axis) correction in radians
Optional
pitchCor: numberoptional pitch (x-axis) correction in radians
Optional
rollCor: numberoptional roll (z-axis) correction in radians
Set the index buffer of this mesh
the current mesh
defines the source data
Optional
totalVertices: Nullable<number>defines the total number of vertices referenced by this index data (can be null)
Optional
updatable: booleandefines if the updated index buffer must be flagged as updatable (default is false)
Sets the material to be used to render the mesh in a specific render pass
render pass id
Optional
material: Materialmaterial to use for this render pass. If undefined is passed, no specific material will be used for this render pass but the regular material will be used instead (mesh.material)
Defines the passed node as the parent of the current node. The node will remain exactly where it is and its position / rotation will be updated accordingly. Note that if the mesh has a pivot matrix / point defined it will be applied after the parent was updated. In that case the node will not remain in the same space as it is, as the pivot will be applied. To avoid this, you can set updatePivot to true and the pivot will be updated to identity
https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/parent
this TransformNode.
the node ot set as the parent
Optional
preserveScalingSign: booleanif true, keep scaling sign of child. Otherwise, scaling sign might change.
Optional
updatePivot: booleanif true, update the pivot matrix to keep the node in the same space as before
Sets a new pivot matrix to the current node
the current TransformNode
defines the new pivot matrix to use
Optional
postMultiplyPivotMatrix: booleandefines if the pivot matrix must be cancelled in the world matrix. When this parameter is set to true (default), the inverse of the pivot matrix is also applied at the end to cancel the transformation effect
Sets a new pivot point to the current node
the current TransformNode
defines the new pivot point to use
Optional
space: Spacedefines if the point is in world or local space (local by default)
Sets the mesh global Vertex Buffer
the current mesh
defines the buffer to use
Optional
disposeExistingBuffer: booleandisposes the existing buffer, if any (default: true)
Copy a FloatArray into a specific associated vertex buffer
the current mesh
defines which buffer to write to (positions, indices, normals, etc). Possible kind
values :
defines the data source
Optional
updatable: booleandefines if the updated vertex buffer must be flagged as updatable
Optional
stride: numberdefines the data stride size (can be null)
Translates the mesh along the axis vector for the passed distance in the given space. space (default LOCAL) can be either Space.LOCAL, either Space.WORLD.
the TransformNode.
the axis to translate in
the distance to translate
Optional
space: SpaceSpace to rotate in (Default: local)
Allows back the World matrix computation.
the TransformNode.
Disposes a previously registered javascript function called after the rendering.
the current mesh
defines the function to remove
Removes a registered callback function.
the TransformNode.
callback function to remove
Disposes a previously registered javascript function called before the rendering
the current mesh
defines the function to remove
Updates the mesh facetData arrays and the internal partitioning when the mesh is morphed or updated. This method can be called within the render loop. You don't need to call this method by yourself in the render loop when you update/morph a mesh with the methods CreateXXX() as they automatically manage this computation
the current mesh
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
Update the current index buffer
the current mesh
defines the source data
Optional
offset: numberdefines the offset in the index buffer where to store the new data (can be null)
Optional
gpuMemoryOnly: booleandefines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)
This method updates the vertex positions of an updatable mesh according to the positionFunction
returned values.
the current mesh
is a simple JS function what is passed the mesh positions
array. It doesn't need to return anything
Optional
computeNormals: booleanis a boolean (default true) to enable/disable the mesh normal recomputation after the vertex position update
Update a specific associated vertex buffer
the current mesh
defines which buffer to write to (positions, indices, normals, etc). Possible kind
values :
defines the data source
Optional
updateExtends: booleandefines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind
Optional
makeItUnique: booleandefines if the geometry associated with the mesh must be cloned to make the change only for this mesh (and not all meshes associated with the same geometry)
ValidateSkinning is used to determine that a mesh has valid skinning data along with skin metrics, if missing weights, or not normalized it is returned as invalid mesh the string can be used for console logs, or on screen messages to let the user know there was an issue with importing the mesh
a validation object with skinned, valid and report string
Static
AddStatic
CenterReturns the center of the {min:
Vector3, max:
Vector3}
or the center of MinMax vector3 computed from a mesh array
a vector3
could be an array of meshes or a {min:
Vector3, max:
Vector3}
object
Static
ConstructReturns a node constructor based on type name
the new constructor or null
defines the type name
defines the new node name
defines the hosting scene
Optional
options: anydefines optional options to transmit to constructors
Static
CreateStatic
MergeMerge the array of meshes into a single mesh for performance reasons.
a new mesh
array of meshes with the vertices to merge. Entries cannot be empty meshes.
Optional
disposeSource: booleanwhen true (default), dispose of the vertices from the source meshes.
Optional
allow32BitsIndices: booleanwhen the sum of the vertices > 64k, this must be set to true.
Optional
meshSubclass: Mesh(optional) can be set to a Mesh where the merged vertices will be inserted.
Optional
subdivideWithSubMeshes: booleanwhen true (false default), subdivide mesh into subMeshes.
Optional
multiMultiMaterials: booleanwhen true (false default), subdivide mesh into subMeshes with multiple materials, ignores subdivideWithSubMeshes.
Static
MergeMerge the array of meshes into a single mesh for performance reasons.
a new mesh
array of meshes with the vertices to merge. Entries cannot be empty meshes.
Optional
disposeSource: booleanwhen true (default), dispose of the vertices from the source meshes.
Optional
allow32BitsIndices: booleanwhen the sum of the vertices > 64k, this must be set to true.
Optional
meshSubclass: Mesh(optional) can be set to a Mesh where the merged vertices will be inserted.
Optional
subdivideWithSubMeshes: booleanwhen true (false default), subdivide mesh into subMeshes.
Optional
multiMultiMaterials: booleanwhen true (false default), subdivide mesh into subMeshes with multiple materials, ignores subdivideWithSubMeshes.
Static
MinReturns an object containing a min and max Vector3 which are the minimum and maximum vectors of each mesh bounding box from the passed array, in the world coordinates
an object {min:
Vector3, max:
Vector3}
defines the list of meshes to scan
Static
ParseReturns a new Mesh object parsed from the source provided.
a new Mesh
is the source
defines the hosting scene
is the root URL to prefix the delayLoadingFile
property with
Static
ParseParse animation range data from a serialization object and store them into a given node
defines where to store the animation ranges
defines the serialization object to read data from
defines the hosting scene
Generated using TypeDoc
Gets or sets the current action manager
See
https://doc.babylonjs.com/features/featuresDeepDive/events/actions