Constructs a new face mesh.
The name of the face mesh,
A babylon scene.
Gets or sets the current action manager
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 orientation for POV movement & rotation
Gets the delay loading state of the mesh (when delay loading is turned on)
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))
Gets or sets the ellipsoid offset used to impersonate this mesh when using collision engine (default is (0, 0, 0))
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)
Object used to store instanced buffers defined by user
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.
Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)
Gets or sets whether the mesh is occluded or not, it is used also to set the intial state of the mesh to be occluded or not
Flag to check the progress status of the query
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
This property determines the type of occlusion query algorithm to run in WebGl, you can use:
This number indicates the number of allowed retries before stop the occlusion query, this is useful if the occlusion query is taking long time before to the query result is retireved, the query result indicates if the object is visible within the scene or not and based on that Babylon.Js engine decideds to show or hide the object. The default value is -1 which means don't break the query and wait till the result
This property is responsible for starting the occlusion query within the Mesh or not, this property is also used to determine what should happen when the occlusionRetryCount is reached. It has supports 3 values:
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
User defined function used to change how LOD level selection is done
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
Use this property to change the original side orientation defined at construction time
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
Gets or sets a boolean indicating if the outline must be rendered as well
Gets or sets a boolean indicating if the overlay must be rendered as well
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
Gets / sets the number of thin instances to display. Note that you can't set a number higher than what the underlying buffer can handle.
Gets or sets a boolean defining if we want picking to pick thin instances as well
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)
Mesh side orientation : usually the internal or back surface
Mesh tile positioning : part tiles on bottom
Mesh cap setting : two caps, one at the beginning and one at the end of the mesh
Mesh cap setting : one cap at the end of the mesh
Mesh cap setting : one cap at the beginning of the mesh
Mesh tile positioning : part tiles same on left/right or top/bottom
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.
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.
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.
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.
Mesh side orientation : by default, FRONTSIDE
Mesh side orientation : both internal and external or front and back surfaces
Mesh pattern setting : rotate pattern and rotate
Mesh pattern setting : flip and rotate alternate tiles on each row or column
Mesh pattern setting : flip (reflect in y axis) all tiles on alternate rows
Mesh pattern setting : flip (reflect in y axis) alternate tiles on each row or column
Mesh side orientation : usually the external or front surface
Mesh tile positioning : part tiles on left
Mesh cap setting : no cap
Mesh pattern setting : no flip or rotate
Use an accurante occlusion algorithm
Use a conservative occlusion algorithm
No occlusion
Occlusion set to optimisitic
Occlusion set to strict
Mesh tile positioning : part tiles on right
Mesh pattern setting : rotate (180degs) all tiles on alternate rows
Mesh pattern setting : rotate (180degs) alternate tiles on each row or column
Mesh 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 animation properties override
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 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 the list of attached 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 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
Gets or sets a boolean indicating that this mesh can be used in the collision engine
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)
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 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 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.
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.
Gets or sets a boolean used to define if the node must be serialized
Gets or sets a boolean used to define if the node must be serialized
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
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
Gets the number of facets in the mesh
The forward direction of that transform in world space.
Gets the mesh internal Geometry object
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 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 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
Gets or sets a boolean indicating that this mesh does not use index buffer
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)
Gets or sets the current layer mask (default is 0x0FFFFFFF)
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 current material
Gets or sets current material
Gets or sets the morph target manager
Gets or sets the morph target manager
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
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
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)
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
Set a function to call when this mesh collides with another one
Set a function to call when the collision's position changes
Sets a callback that will be raised when the node will be disposed
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)
Gets or sets the parent of the node (without keeping the current position in the scene)
The ratio (float) to apply to the bouding box size to set to the partioning space. Ex : 1.01 (default) the partioning space is 1% bigger than the bounding box
The ratio (float) to apply to the bouding box size to set to the partioning space. Ex : 1.01 (default) the partioning space is 1% bigger than the bounding box
Gets or set the number (integer) of subdivisions per axis in the partioning space
Gets or set the number (integer) of subdivisions per axis in the partioning space
Gets or set the node position (default is (0.0, 0.0, 0.0))
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 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
Gets or sets a boolean indicating that this mesh can receive realtime shadows
Specifies the rendering group id for this mesh (0 by default)
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 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 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 Vector3 depicting the mesh scaling along each local axis X, Y, Z. Default is (1.0, 1.0, 1.0)
Gets or sets a Vector3 depicting the mesh scaling along each local axis X, Y, Z. Default is (1.0, 1.0, 1.0)
Gets or sets a skeleton to apply skining transformations
Gets or sets a skeleton to apply skining transformations
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.
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
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 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
Billboard on all axes
No billboard
Billboard on using position instead of orientation
Billboard on X axis
Billboard on Y axis
Billboard on Z axis
Attach a behavior to the node
defines the behavior to attach
defines that the behavior must be attached even if the scene is still loading
the current Node
Adds the passed mesh as a child to the current mesh
defines the child mesh
the current mesh
Add a mesh as LOD level triggered at the given distance.
The distance from the center of the object to show this level
The mesh to be added as LOD level (can be null)
This mesh (for chaining)
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.
Rotation to add
Rotation to add
Rotation to add
the TransformNode.
Align the mesh with a normal
defines the normal to use
can be used to redefined the up vector to use (will use the (0, 1, 0) by default)
the current mesh
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.
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.
is an optional Javascript function to be called just after the mesh is modified. It is passed the modified mesh and must return nothing.
is an optional vector2 used to offset UV.
is an optional vector2 used to scale UV.
defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
the Mesh.
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.
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.
is an optional vector2 used to offset UV.
is an optional vector2 used to scale UV.
defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
the Mesh.
Apply a physic impulse to the mesh
defines the force to apply
defines where to apply the force
the current mesh
Updates the vertex buffer by applying transformation from the bones
defines the skeleton to apply to current mesh
the current mesh
Attach the current TransformNode to another TransformNode associated with a bone
Bone affecting the TransformNode
TransformNode associated with the bone
this object
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.
indicates whether to preserve all child nodes' World Matrix during baking
the current mesh
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.
defines the transform matrix to use
the current mesh
Will start the animation sequence
defines the range frames for animation sequence
defines if the animation should loop (false by default)
defines the speed factor in which to run the animation (1 by default)
defines a function to be executed when the animation ended (undefined by default)
the object created for this animation. If range does not exist, it will return null
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
defines the distance on the right axis
defines the distance on the up axis
defines the distance on the forward axis
the new displacement vector
Calculate relative rotation change from the point of view of behind the front of the mesh. Supports definition of mesh facing forward or backward.
defines the flip
defines the twirl
defines the tilt
the new rotation vector
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.
Returns a new Mesh object generated from the current mesh properties. This method must not get confused with createInstance()
is a string, the name given to the new mesh
can be any Node object (default null
)
allows/denies the recursive cloning of the original mesh children if any (default false
)
allows/denies the cloning in the same time of the original mesh body
used by the physics engine, if any (default true
)
a new mesh
Computes the world matrix of the node
defines if the cache version should be invalidated forcing the world matrix to be created from scratch
the world matrix
Modify 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
Creates an animation range for this node
defines the name of the range
defines the starting key
defines the end key
Creates a new InstancedMesh object from the mesh model.
defines the name of the new instance
a new InstancedMesh
Creates new normals data for the mesh
defines if the normal vertex buffer must be flagged as updatable
the current mesh
This function will create an octree to help to select the right submeshes for rendering, picking and collision computations. Please note that you must have a decent number of submeshes to get performance improvements when using an octree
defines the maximum size of each block (64 by default)
defines the maximum depth to use (no more than 2 levels by default)
the new octree
Delete a specific animation range
defines the name of the range to delete
defines if animation frames from the range must be deleted as well
Detach the transform node if its associated with a bone
this object
Disables the mesh edge rendering mode
the currentAbstractMesh
Disables the feature FacetData and frees the related memory
the current mesh
Releases resources associated with this mesh.
Set to true to not recurse into each children (recurse into each children by default)
Set 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
defines the maximal distance between two angles to detect a face
indicates that we should check vertex list directly instead of faces
options to the edge renderer
the currentAbstractMesh
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.
will also inverts the normals
current mesh
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.
This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. It has no effect at all on other shapes. It prevents the mesh normals from being recomputed on next positions
array update.
the current mesh
Prevents the World matrix to be computed any longer
defines an optional matrix to use as world matrix
the TransformNode.
Returns a new Vector3 set with the mesh pivot point World coordinates.
a new Vector3 set with the mesh pivot point World coordinates.
Sets the Vector3 "result" coordinates with the mesh pivot point World coordinates.
vector3 to store the result
this TransformNode.
Retuns the mesh absolute position in the World.
a Vector3.
Returns as a new array populated with the mesh material and/or skeleton, if any.
an array of IAnimatable
Get an animation by name
defines the name of the animation to look for
null if not found else the requested animation
Get an animation range by name
defines the name of the animation range to look for
null if not found else the requested animation range
Gets the list of all animation ranges defined on this node
an array
Gets an attached behavior by name
defines the name of the behavior to look for
null if behavior was not found else the requested behavior
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
defines 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)
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
an array of AbstractMesh
Get all child-transformNodes of this node
defines 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
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
an array of TransformNode
Get all direct children of this node
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
defines 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)
an array of Node
Gets the class name
the string "Mesh".
Returns the closest mesh facet index at (x,y,z) World coordinates, null if not found
defines x coordinate
defines y coordinate
defines z coordinate
sets as the (x,y,z) world projection on the facet
if 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
if 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
the face index if found (or null instead)
Returns the closest mesh facet index at (x,y,z) local coordinates, null if not found
defines x coordinate
defines y coordinate
defines z coordinate
sets as the (x,y,z) local projection on the facet
if 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
if 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
the face index if found (or null instead)
This function returns all of the particle systems in the scene that use the mesh as an emitter.
an array of particle systems in the scene that use the mesh as an emitter
Will return all nodes that have this node as ascendant
defines 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
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
all children nodes of all types
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.
axis to rotate
a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh.
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 Wordl space from the mesh World matrix.
axis to rotate
the resulting transformnode
this TransformNode.
Returns the distance from the mesh to the active camera
defines the camera to use
the distance
Returns an array populated with IParticleSystem objects whose the mesh is the emitter
an array of IParticleSystem
Gets the engine of the node
a Engine
Returns the object "parameter" set with all the expected parameters for facetData computation by ComputeNormals()
the parameters
Returns the facetLocalNormals array. The normals are expressed in the mesh local spac
an array of Vector3
Returns the facetLocalPartioning array
an array of array of numbers
Returns the facetLocalPositions array. The facet positions are expressed in the mesh local space
an array of Vector3
Returns the i-th facet normal in the world system. This method allocates a new Vector3 per call
defines the facet index
a new Vector3
Sets the reference Vector3 with the i-th facet normal in the world system
defines the facet index
defines the target vector
the current mesh
Returns the i-th facet position in the world system. This method allocates a new Vector3 per call
defines the facet index
a new Vector3
Sets the reference Vector3 with the i-th facet position in the world system
defines the facet index
defines the target vector
the current mesh
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)
defines x coordinate
defines y coordinate
defines z coordinate
the array of facet indexes
Return the minimum and maximum world vectors of the entire hierarchy under current node
Include bounding info from descendants as well (true by default)
defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
the new bounding vectors
Returns an array populated with IParticleSystem objects whose the mesh or its children are the emitter
an array of IParticleSystem
Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.
If 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.
defines a boolean indicating that the returned array must be cloned upon returning it
the indices array or an empty array if the mesh has no geometry
Returns the registered LOD mesh distant from the parameter camera
position if any, else returns the current mesh.
defines the camera to use to compute distance
defines a custom bounding sphere to use instead of the one from this mesh
This mesh (for chaining)
Returns the LOD level mesh at the passed distance or null if not found.
The distance from the center of the object to show this level
a Mesh or null
Gets the list of MeshLODLevel associated with the current mesh
an array of MeshLODLevel
Gets the current physics impostor
a physics impostor or null
Returns the mesh pivot matrix. Default : Identity.
the matrix
Returns a new Vector3 set with the mesh pivot point coordinates in the local space.
the pivot point
Sets the passed Vector3 "result" with the coordinates of the mesh pivot point in the local space.
the vector3 to store the result
this TransformNode.
Returns the mesh Pose matrix.
the pose matrix
Returns the mesh position in the local space from the current World matrix values.
a new Vector3.
Gets the position of the current mesh in camera space
defines the camera to use
a position
Gets the scene of the node
a scene
Returns a positive integer : the total number of indices in this mesh geometry.
the numner of indices or zero if the mesh has no geometry.
Returns the total number of vertices within the mesh geometry or zero if the mesh has no geometry.
the total number of vertices
Returns the mesh VertexBuffer object from the requested kind
defines which buffer to read from (positions, indices, normals, etc). Possible kind
values :
a FloatArray or null if the mesh has no vertex buffer for this kind.
Returns the content of an associated vertex buffer
defines which buffer to read from (positions, indices, normals, etc). Possible kind
values :
defines a boolean indicating that if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one
defines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is
a FloatArray or null if the mesh has no geometry or no vertex buffer for this kind.
Returns a string which contains the list of existing kinds
of Vertex Data associated with this mesh.
an array of strings
Gets the current world matrix
a Matrix
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.
the number of new vertices to add to each edge of a facet, optional default 1
Checks if the passed Ray intersects with the mesh
defines the ray to use
defines if fast mode (but less precise) must be used (false by default)
defines an optional predicate used to select faces when a mesh intersection is detected
defines a boolean indicating if picking should only happen using bounding info (false by default)
defines the world matrix to use to get the world coordinate of the intersection point
a boolean indicating if we should skip the bounding info check
the picking info
True if the mesh intersects another mesh or a SolidParticle object
defines a target mesh or SolidParticle to test
Unless the parameter precise
is set to true
the intersection is computed according to Axis Aligned Bounding Boxes (AABB), else according to OBB (Oriented BBoxes)
Can be set to true to test if the mesh defined in parameters intersects with the current mesh or any child meshes
true if there is an intersection
Returns true if the passed point (Vector3) is inside the mesh bounding box
defines the point to test
true if there is an intersection
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.
defines the frustum to test
true if the mesh is completely in the frustum planes
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
defines the parent node to inspect
a boolean indicating if this node is a descendant of the given node
Gets a boolean indicating if the node has been disposed
true if the node was disposed
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
indicates 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
whether this node (and its parent) is enabled
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
defines the frustum to test
true if the mesh is in the frustum planes
Determine if the current mesh is ready to be rendered
defines if a complete check (including materials and lights) has to be done (false by default)
will check if the mesh will be ready when used with instances (false by default)
true if all associated assets are ready (material, textures, shaders)
Returns a boolean defining if the vertex data for the requested kind
is updatable.
defines which buffer to check (positions, indices, normals, etc). Possible kind
values :
a boolean
Tests if a specific vertex buffer is associated with this mesh
defines which buffer to check (positions, indices, normals, etc). Possible kind
values :
a boolean
Translates the mesh along the passed Vector3 in its local space.
the distance to translate in localspace
the TransformNode.
Orients a mesh towards a target point. Mesh must be drawn facing user.
the position (must be in same space as current mesh) to look at
optional yaw (y-axis) correction in radians
optional pitch (x-axis) correction in radians
optional roll (z-axis) correction in radians
the choosen space of the target
the TransformNode.
Creates a un-shared specific occurence of the geometry for the mesh.
the current mesh
Flag the transform node as dirty (Forcing it to update everything)
if set to "rotation" the objects rotationQuaternion will be set to null
this transform node
Flags an associated vertex buffer as updatable
defines which buffer to use (positions, indices, normals, etc). Possible kind
values :
defines 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
defines the distance on the right axis
defines the distance on the up axis
defines the distance on the forward axis
the current mesh
Move the mesh using collision engine
defines the requested displacement vector
the current mesh
Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
predicate that is passed in to getHierarchyBoundingVectors when selecting which object should be included when scaling
the current mesh
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.
an optional success callback to be called after the optimization finished.
the current mesh
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.
defines whether to apply the skeleton before computing the bounding info
the current mesh
Registers for this mesh a javascript function called just after the rendering is complete
defines the function to call after rendering this mesh
the current mesh
If you'd like to be called back after the mesh position, rotation or scaling has been updated.
callback function to add
the TransformNode.
Registers for this mesh a javascript function called just before the rendering process
defines the function to call before rendering this mesh
the current mesh
Register a custom buffer that will be instanced
defines the buffer kind
defines the stride in floats
Disposes all the submeshes of the current meshnp
the current mesh
Remove an attached behavior
defines the behavior to attach
the current Node
Removes the passed mesh from the current mesh children list
defines the child mesh
the current mesh
Remove a mesh from the LOD array
defines the mesh to be removed
This mesh (for chaining)
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
defines the subMesh to render
defines if alpha mode can be changed
defines an optional mesh used to provide info for the rendering
the current mesh
Resets this nodeTransform's local matrix to Matrix.Identity().
indicates if all child nodeTransform's world-space transform should be preserved.
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 axis to rotate around
the amount to rotate in radians
Space to rotate in (Default: local)
the TransformNode.
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 point to rotate around
the axis to rotate around
the amount to rotate in radians
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
defines the flip
defines the twirl
defines the tilt
the current mesh
Serialize current mesh
defines the object which will receive the serialization data
Serialize animation ranges into a JSON compatible object
serialization object
Sets the mesh absolute position in the World from a Vector3 or an Array(3).
the absolute position to set
the TransformNode.
Overwrite the current bounding info
defines the new bounding info
the current mesh
Sets this transform node rotation to the given local axis.
the axis in local space
optional yaw (y-axis) correction in radians
optional pitch (x-axis) correction in radians
optional roll (z-axis) correction in radians
this TransformNode
Set the enabled state of this node
defines the new enabled state
Set the index buffer of this mesh
defines the source data
defines the total number of vertices referenced by this index data (can be null)
defines if the updated index buffer must be flagged as updatable (default is false)
the current mesh
Sets the mesh material by the material or multiMaterial id
property
is a string identifying the material or the multiMaterial
the current mesh
Prepare internal normal array for software CPU skinning
original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.
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
the node ot set as the parent
this TransformNode.
Creates a physic joint between two meshes
defines the other mesh to use
defines the pivot to use on this mesh
defines the pivot to use on the other mesh
defines additional options (can be plugin dependent)
the current mesh
Sets a new pivot matrix to the current node
defines the new pivot matrix to use
defines 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
the current TransformNode
Sets a new pivot point to the current node
defines the new pivot point to use
defines if the point is in world or local space (local by default)
the current TransformNode
Sets the mesh position in its local space.
the position to set in localspace
the TransformNode.
Prepare internal position array for software CPU skinning
original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh
Sets a new matrix to apply before all other transformation
defines the transform matrix
the current TransformNode
Sets the mesh global Vertex Buffer
defines the buffer to use
the current mesh
Copy a FloatArray into a specific associated vertex buffer
defines which buffer to write to (positions, indices, normals, etc). Possible kind
values :
defines the data source
defines if the updated vertex buffer must be flagged as updatable
defines the data stride size (can be null)
the current mesh
Simplify the mesh according to the given array of settings. Function will return immediately and will simplify async
a collection of simplification settings
should all levels calculate parallel or one after the other
the type of simplification to run
optional success callback to be called after the simplification finished processing all settings
the current mesh
This function will subdivide the mesh into multiple submeshes
defines the expected number of submeshes
Synchronises all the mesh instance submeshes to the current mesh submeshes, if any. After this call, all the mesh instances have the same submeshes than the current mesh.
the current mesh
Creates a new thin instance
the matrix or array of matrices (position, rotation, scale) of the thin instance(s) to create
true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance
the thin instance index number. If you pass an array of matrices, other instance indexes are index+1, index+2, etc
Adds the transformation (matrix) of the current mesh as a thin instance
true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance
the thin instance index number
Synchronize the gpu buffers with a thin instance buffer. Call this method if you update later on the buffers passed to thinInstanceSetBuffer
name of the attribute to update. Use "matrix" to update the buffer of matrices
Gets the list of world matrices
an array containing all the world matrices from the thin instances
Applies a partial update to a buffer directly on the GPU Note that the buffer located on the CPU is NOT updated! It's up to you to update it (or not) with the same data you pass to this method
name of the attribute to update. Use "matrix" to update the buffer of matrices
the data to set in the GPU buffer
the offset in the GPU buffer where to update the data
Refreshes the bounding info, taking into account all the thin instances defined
true to force recomputing the mesh bounding info and use it to compute the aggregated bounding info
Registers a custom attribute to be used with thin instances
name of the attribute
size in floats of the attribute
Sets the value of a custom attribute for a thin instance
name of the attribute
index of the thin instance
value to set
true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance
Sets a buffer to be used with thin instances. This method is a faster way to setup multiple instances than calling thinInstanceAdd repeatedly
name of the attribute. Use "matrix" to setup the buffer of matrices
buffer to set
size in floats of each value of the buffer
indicates that the buffer is static, so that you won't change it after it is set (better performances - false by default)
Sets the matrix of a thin instance
index of the thin instance
matrix to set
true to refresh the underlying gpu buffer (default: true). If you do multiple calls to this method in a row, set refresh to true only for the last call to save performance
Invert the geometry to move from a right handed system to a left handed one.
the current mesh
Returns a description of this mesh
define if full details about this mesh must be used
a descriptive string representing this mesh
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 axis to translate in
the distance to translate
Space to rotate in (Default: local)
the TransformNode.
This function affects parametric shapes on vertex position update only : ribbons, tubes, etc. It has no effect at all on other shapes. It reactivates the mesh normals computation if it was previously frozen
the current mesh
Allows back the World matrix computation.
the TransformNode.
Disposes a previously registered javascript function called after the rendering.
defines the function to remove
the current mesh
Removes a registered callback function.
callback function to remove
the TransformNode.
Disposes a previously registered javascript function called before the rendering
defines the function to remove
the current mesh
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
Update the current index buffer
defines the source data
defines the offset in the index buffer where to store the new data (can be null)
defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)
the current mesh
This method updates the vertex positions of an updatable mesh according to the positionFunction
returned values.
is a simple JS function what is passed the mesh positions
array. It doesn't need to return anything
is a boolean (default true) to enable/disable the mesh normal recomputation after the vertex position update
the current mesh
Copies the parameter passed Matrix into the mesh Pose matrix.
the matrix to copy the pose from
this TransformNode.
Update a specific associated vertex buffer
defines which buffer to write to (positions, indices, normals, etc). Possible kind
values :
defines the data source
defines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind
defines 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)
the current mesh
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
Add a new node constructor
defines the type name of the node to construct
defines the constructor function
Returns the center of the {min:
Vector3, max:
Vector3}
or the center of MinMax vector3 computed from a mesh array
could be an array of meshes or a {min:
Vector3, max:
Vector3}
object
a vector3
Returns a node constructor based on type name
defines the type name
defines the new node name
defines the hosting scene
defines optional options to transmit to constructors
the new constructor or null
Creates a box mesh. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
sets the size (float) of each box side (default 1)
defines the hosting scene
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
a new Mesh
Creates a Capsule Mesh
defines the name of the mesh.
the constructors options used to shape the mesh.
defines the scene the mesh is scoped to.
the capsule mesh
Creates a cylinder or a cone mesh. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
sets the height size (float) of the cylinder/cone (float, default 2)
set the top cap diameter (floats, default 1)
set the bottom cap diameter (floats, default 1). This value can't be zero
sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance
sets the number of rings along the cylinder height (positive integer, default 1)
defines the hosting scene
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
a new Mesh
Creates a dashed line mesh. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
is an array successive Vector3
is the size of the dashes relatively the dash number (positive float, default 3)
is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)
is the intended total number of dashes (positive integer, default 200)
defines the hosting scene
defines if the mesh must be flagged as updatable
is an instance of an existing LineMesh object to be updated with the passed points
parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines)
a new Mesh
Creates a decal mesh. Please consider using the same method from the MeshBuilder class instead. A decal is a mesh usually applied as a model onto the surface of another mesh
defines the name of the mesh
defines the mesh receiving the decal
sets the position of the decal in world coordinates
sets the normal of the mesh where the decal is applied onto in world coordinates
sets the decal scaling
sets the angle to rotate the decal
a new Mesh
Creates a plane polygonal mesh. By default, this is a disc. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
sets the radius size (float) of the polygon (default 0.5)
sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc
defines the hosting scene
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
a new Mesh
Creates a ground mesh. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
set the width of the ground
set the height of the ground
sets the number of subdivisions per side
defines the hosting scene
defines if the mesh must be flagged as updatable
a new Mesh
Creates a ground mesh from a height map. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
sets the URL of the height map image resource
set the ground width size
set the ground height size
sets the number of subdivision per side
is the minimum altitude on the ground
is the maximum altitude on the ground
defines the hosting scene
defines if the mesh must be flagged as updatable
is a callback function that will be called once the mesh is built (the height map download can last some time)
will filter any data where the alpha channel is below this value, defaults 0 (all data visible)
a new Mesh
Creates a hemisphere mesh. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
sets the sphere number of horizontal stripes (positive integer, default 32)
sets the diameter size (float) of the sphere (default 1)
defines the hosting scene
a new Mesh
Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided
radius
sets the radius size (float) of the icosphere (default 1)radiusX
, radiusY
and radiusZ
(all by default have the same value than radius
)subdivisions
sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its sizeflat
(boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surfacefrontUVs
and backUVs
(Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientationupdatable
(default false) if its internal geometry is supposed to change once createddefines the name of the mesh
defines the options used to create the mesh
defines the hosting scene
a new Mesh
Creates lathe mesh. The lathe is a shape with a symetry axis : a 2D model shape is rotated around this axis to design the lathe. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero
is the radius value of the lathe
is the side number of the lathe.
defines the hosting scene
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
a new Mesh
Creates a line mesh. Please consider using the same method from the MeshBuilder class instead.
defines the name of the mesh to create
is an array successive Vector3
defines the hosting scene
defines if the mesh must be flagged as updatable
is an instance of an existing LineMesh object to be updated with the passed points
parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#lines-and-dashedlines).
a new Mesh
Creates a plane mesh. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
sets the size (float) of both sides of the plane at once (default 1)
defines the hosting scene
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
a new Mesh
Creates a polygon mesh.Please consider using the same method from the MeshBuilder class instead
The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh.
The parameter shape
is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors.
You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
The mesh can be set to updatable with the boolean parameter updatable
(default false) if its internal geometry is supposed to change once created.
Remember you can only change the shape positions, not their number when updating a polygon.
defines the name of the mesh to create
is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors
defines the hosting scene
is a required array of arrays of successive Vector3 used to defines holes in the polygon
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
can be used to inject your own earcut reference
a new Mesh
Creates a polyhedron mesh. Please consider using the same method from the MeshBuilder class instead.
type
(positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embbeded types. Please refer to the type sheet in the tutorial to choose the wanted typesize
(positive float, default 1) sets the polygon sizesize
on each dimension bu using the parameters sizeX
, sizeY
or sizeZ
(positive floats, default to size
value)custom
(polyhedronObject
, default null). If you set the parameter custom
, this overwrittes the parameter type
polyhedronObject
is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/PolyhedronfaceColors
(Color4, default (1, 1, 1, 1)
) and faceUV (Vector4, default (0, 0, 1, 1)
)faceUV
or faceColors
, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : https://doc.babylonjs.com/how_to/createbox_per_face_textures_and_colorsflat
(boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, faceColors
and faceUV
are ignoredfrontUVs
and backUVs
(Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientationupdatable
(default false) if its internal geometry is supposed to change once createddefines the name of the mesh to create
defines the options used to create the mesh
defines the hosting scene
a new Mesh
Creates a ribbon mesh. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry.
creates a seam between the first and the last paths of the path array (default is false)
creates a seam between the first and the last points of each path of the path array
is taken in account only if the pathArray
is containing a single path
defines the hosting scene
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
defines an instance of an existing Ribbon object to be updated with the passed pathArray
parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#ribbon)
a new Mesh
Creates a sphere mesh. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
sets the sphere number of horizontal stripes (positive integer, default 32)
sets the diameter size (float) of the sphere (default 1)
defines the hosting scene
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
a new Mesh
Creates a tiled ground mesh. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
set the ground minimum X coordinate
set the ground minimum Y coordinate
set the ground maximum X coordinate
set the ground maximum Z coordinate
is an object {w: positive integer, h: positive integer}
(default {w: 6, h: 6}
). w
and h
are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile
is an object {w: positive integer, h: positive integer}
(default {w: 2, h: 2}
). w
and h
are the numbers of subdivisions on the ground width and height of each tile
defines the hosting scene
defines if the mesh must be flagged as updatable
a new Mesh
Creates a torus mesh. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
sets the diameter size (float) of the torus (default 1)
sets the diameter size of the tube of the torus (float, default 0.5)
sets the number of torus sides (postive integer, default 16)
defines the hosting scene
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
a new Mesh
Creates a torus knot mesh. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
sets the global radius size (float) of the torus knot (default 2)
sets the diameter size of the tube of the torus (float, default 0.5)
sets the number of sides on each tube segments (positive integer, default 32)
sets the number of tubes to decompose the knot into (positive integer, default 32)
the number of windings on X axis (positive integers, default 2)
the number of windings on Y axis (positive integers, default 3)
defines the hosting scene
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
a new Mesh
Creates a tube mesh. The tube is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
is a required array of successive Vector3. It is the curve used as the axis of the tube
sets the tube radius size
is the number of sides on the tubular surface
is a custom function. If it is not null, it overwrittes the parameter radius
. This function is called on each point of the tube path and is passed the index i
of the i-th point and the distance of this point from the first point of the path
sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
defines the hosting scene
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
is an instance of an existing Tube object to be updated with the passed pathArray
parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#tube)
a new Mesh
Creates an extruded polygon mesh, with depth in the Y direction. Please consider using the same method from the MeshBuilder class instead.
defines the name of the mesh to create
is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors
defines the height of extrusion
defines the hosting scene
is a required array of arrays of successive Vector3 used to defines holes in the polygon
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
can be used to inject your own earcut reference
a new Mesh
Creates an extruded shape mesh. The extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis
is a required array of successive Vector3. This is the axis curve the shape is extruded along
is the value to scale the shape
is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve
sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
defines the hosting scene
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
is an instance of an existing ExtrudedShape object to be updated with the passed shape
, path
, scale
or rotation
parameters (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#extruded-shape)
a new Mesh
Creates an custom extruded shape mesh. The custom extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters. Please consider using the same method from the MeshBuilder class instead
defines the name of the mesh to create
is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis
is a required array of successive Vector3. This is the axis curve the shape is extruded along
is a custom Javascript function called on each path point
is a custom Javascript function called on each path point
forces the extrusion underlying ribbon to close all the paths in its pathArray
forces the extrusion underlying ribbon to close its pathArray
sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
defines the hosting scene
defines if the mesh must be flagged as updatable
defines the mesh side orientation (https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
is an instance of an existing ExtrudedShape object to be updated with the passed shape
, path
, scale
or rotation
parameters (https://doc.babylonjs.com/how_to/how_to_dynamically_morph_a_mesh#extruded-shape)
a new Mesh
Merge the array of meshes into a single mesh for performance reasons.
defines he vertices source. They should all be of the same material. Entries can empty
when true (default), dispose of the vertices from the source meshes
when the sum of the vertices > 64k, this must be set to true
when set, vertices inserted into this Mesh. Meshes can then be merged into a Mesh sub-class.
when true (false default), subdivide mesh to his subMesh array with meshes source.
when true (false default), subdivide mesh and accept multiple multi materials, ignores subdivideWithSubMeshes.
a new mesh
Returns 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
defines the list of meshes to scan
an object {min:
Vector3, max:
Vector3}
Returns a new Mesh object parsed from the source provided.
is the source
defines the hosting scene
is the root URL to prefix the delayLoadingFile
property with
a new Mesh
Parse 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
A BABYLON.mesh which updates as the user's face and deforms as the user's expression changes.
https://docs.zap.works/universal-ar/web-libraries/babylonjs/face-tracking/