Creates a new AbstractMesh
defines the name of the mesh
Optional
scene: Nullable<Scene>defines the hosting scene
Gets or sets the current action manager
https://doc.babylonjs.com/features/featuresDeepDive/events/actions
Gets 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 decal map for this mesh
Gets or sets the orientation for POV movement & rotation
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
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 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 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
An event triggered when material is changed
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
Gets or sets impostor used for physic simulation
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
BillboardChild transform with Billboard flags should or should not apply parent rotation (default if off)
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
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
Returns the current mesh absolute rotation. Returns a Quaternion.
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 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 or sets a boolean indicating that this mesh can be used in the collision engine
https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions
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 indicating that bone animations must be computed by the GPU (true by default)
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
Returns true if there is already a bounding info
Gets a boolean indicating if this mesh has instances
Gets a boolean indicating if this mesh has thin instances
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
Returns true if the mesh is blocked. Implemented by child classes
gets a boolean indicating if facetData is enabled
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#what-is-a-mesh-facet
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 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)
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
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 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 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)
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 a skeleton to apply skinning transformations
https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
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.
Gets a boolean indicating if this mesh has skinning data and an attached skeleton
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.
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
Attach 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.
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
Apply a physic impulse to the mesh
the current mesh
https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
Attach the current TransformNode to another TransformNode associated with a bone
this object
Bone affecting the TransformNode
TransformNode associated with the bone
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)
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
Clones the current mesh
the new mesh
defines the mesh name
defines the new mesh parent
Optional
doNotCloneChildren: booleandefines a boolean indicating that children must not be cloned (false by default)
Computes the world matrix of the node
the world matrix
Optional
force: booleandefines if the cache version should be invalidated forcing the world matrix to be created from scratch
Optional
camera: Nullable<Camera>defines the camera used if different from the scene active camera (This is used with modes like Billboard or infinite distance)
Creates new normals data for the mesh
the current mesh
defines if the normal vertex buffer must be flagged as updatable
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 mesh edge rendering mode
the currentAbstractMesh
Disables the feature FacetData and frees the related memory
the current mesh
https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData
Releases resources associated with this abstract mesh.
Optional
doNotRecurse: booleanSet to true to not recurse into each children (recurse into each children by default)
Optional
disposeMaterialAndTextures: booleanSet to true to also dispose referenced materials and textures (false by default)
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
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
Sets the Vector3 "result" coordinates with the mesh pivot point World coordinates.
this TransformNode.
vector3 to store the result
Get an animation by name
null if not found else the requested animation
defines the name of the animation to look for
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).
However, if the mesh contains thin instances, it will be expanded to include them. If you want the "raw" bounding data instead, then use getRawBoundingInfo()
.
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.
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 the mesh itself by default. Implemented by child classes
the currentAbstractMesh
defines the camera to use to pick the right LOD 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
Gets the current physics impostor
https://doc.babylonjs.com/features/featuresDeepDive/physics
a physics impostor or null
Sets the passed Vector3 "result" with the coordinates of the mesh pivot point in the local space.
this TransformNode.
the vector3 to store the result
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
Instantiate (when possible) or clone that node with its hierarchy
an instance (or a clone) of the current node with its hierarchy
Optional
newParent: Nullable<TransformNode>defines the new parent to use for the instance (or clone)
Optional
options: { doNotInstantiate: boolean | ((node: TransformNode) => boolean) }defines options to configure how copy is done
defines if the model must be instantiated or just cloned
Optional
onNewNodeCreated: ((source: TransformNode, clone: TransformNode) => void)defines an option callback to call when a clone or an instance is created
Checks if the passed Ray intersects with the mesh. A mesh triangle can be picked both from its front and back sides, irrespective of orientation.
the picking info
https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/mesh_intersect
defines the ray to use. It should be in the mesh's LOCAL coordinate space.
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
Returns whether the transform node world matrix computation needs the camera information to be computed. This is the case when the node is a billboard or has an infinite distance for instance.
true if the world matrix computation needs the camera information to be computed
Translates the mesh along the passed Vector3 in its local space.
the TransformNode.
the distance to translate in localspace
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
Flag the AbstractMesh as dirty (Forcing it to update everything)
this AbstractMesh
Optional
property: stringif set to "rotation" the objects rotationQuaternion will be set to null
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
This 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
If you'd like to be called back after the mesh position, rotation or scaling has been updated.
the TransformNode.
callback function to add
Disposes all the submeshes of the current meshnp
the current mesh
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.
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
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 the mesh absolute position in the World from a Vector3 or an Array(3).
the TransformNode.
the absolute position to set
Overwrite the current bounding info
the current mesh
defines the new bounding info
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
Sets the mesh indices, If the mesh has no geometry, a new Geometry object is created and set to the mesh.
the current mesh
Expects an array populated with integers or a typed array (Int32Array, Uint32Array, Uint16Array)
Defines the total number of vertices
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
Creates a physic joint between two meshes
the current mesh
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 position in its local space.
the TransformNode.
the position to set in localspace
Sets a new matrix to apply before all other transformation
the current TransformNode
defines the transform matrix
Sets the vertex data of the mesh geometry for the requested kind
.
If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data.
Note that a new underlying VertexBuffer object is created each call.
If the kind
is the PositionKind
, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.
the current mesh
defines vertex data kind:
defines the data source
Optional
updatable: booleandefines if the data must be flagged as updatable (or static)
Optional
stride: numberdefines the vertex stride (size of an entire vertex). Can be null and in this case will be deduced from vertex data kind
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.
Removes a registered callback function.
the TransformNode.
callback 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
Updates the AbstractMesh indices array
the current mesh
defines the data source
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)
Copies the parameter passed Matrix into the mesh Pose matrix.
this TransformNode.
the matrix to copy the pose from
Updates the existing vertex data of the mesh geometry for the requested kind
.
If the mesh has no geometry, it is simply returned as it is.
the current mesh
defines vertex data kind:
defines the data source
Optional
updateExtends: booleanIf kind
is PositionKind
and if updateExtends
is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed
Optional
makeItUnique: booleanIf true, a new global geometry is created from this data and is set to the mesh
Static
AddStatic
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
ParseReturns a new TransformNode object parsed from the source provided.
a new TransformNode object parsed from the source provided.
is the source.
the scene the object belongs to
is a string, it's the root URL to prefix the delayLoadingFile
property with
Static
ParseGenerated using TypeDoc
Class used to store all common mesh properties