Class LinesMesh
Hierarchy
- Mesh
- LinesMesh
Index
Constructors
Properties
- action
Manager - alpha
- alpha
Index - always
Select As Active Mesh - animations
- color
- culling
Strategy - decal
Map - defined
Facing Forward - delay
Load State - delay
Loading File - do
Not Sync Bounding Info - edges
Color - edges
Renderer - edges
Share With Instances - edges
Width - ellipsoid
- ellipsoid
Offset - enable
Pointer Move Events - force
Rendering When Occluded - id
- ignore
Camera MaxZ - ignore
Non Uniform Scaling - inspectable
Custom Properties - instanced
Buffers - instances
- intersection
Threshold - is
Blocker - is
Near Grabbable - is
Near Pickable - is
Occluded - is
Occlusion Query In Progress - is
Pickable - is
Visible - metadata
- name
- occlusion
Query Algorithm Type - occlusion
Retry Count - occlusion
Type - on
Accessibility Tag Changed Observable - on
After World Matrix Update Observable - on
Collide Observable - on
Collision Position Change Observable - on
Dispose Observable - onLODLevel
Selection - on
Material Changed Observable - on
Mesh Ready Observable - on
Ready - on
Rebuild Observable - outline
Color - outline
Width - overlay
Alpha - overlay
Color - override
Material Side Orientation - physics
Body - physics
Impostor - re
Integrate Rotation Into Rotation Quaternion - render
Outline - render
Overlay - reserved
Data Store - scaling
Determinant - show
Bounding Box - show
Sub Meshes Bounding Box - state
- sub
Meshes - thin
Instance Count - thin
Instance Enable Picking - unique
Id - use
Octree For Collisions - use
Octree For Picking - use
Octree For Rendering Selection - use
Vertex Alpha - use
Vertex Color - BACKSIDE
- BOTTOM
- Billboard
Use Parent Orientation - CAP_
ALL - CAP_
END - CAP_
START - CENTER
- CULLINGSTRATEGY_
BOUNDINGSPHERE_ ONLY - CULLINGSTRATEGY_
OPTIMISTIC_ INCLUSION - CULLINGSTRATEGY_
OPTIMISTIC_ INCLUSION_ THEN_ BSPHERE_ ONLY - CULLINGSTRATEGY_
STANDARD - DEFAULTSIDE
- DOUBLESIDE
- FLIP_
N_ ROTATE_ ROW - FLIP_
N_ ROTATE_ TILE - FLIP_
ROW - FLIP_
TILE - FRONTSIDE
- INSTANCEDMESH_
SORT_ TRANSPARENT - LEFT
- NO_
CAP - NO_
FLIP - OCCLUSION_
ALGORITHM_ TYPE_ ACCURATE - OCCLUSION_
ALGORITHM_ TYPE_ CONSERVATIVE - OCCLUSION_
TYPE_ NONE - OCCLUSION_
TYPE_ OPTIMISTIC - OCCLUSION_
TYPE_ STRICT - RIGHT
- ROTATE_
ROW - ROTATE_
TILE - TOP
Accessors
- absolute
Position - absolute
Rotation Quaternion - absolute
Scaling - accessibility
Tag - animation
Properties Override - apply
Fog - are
Normals Frozen - baked
Vertex Animation Manager - behaviors
- billboard
Mode - clone
Mesh Map - collider
- collision
Group - collision
Mask - collision
Response - collision
Retry Count - compute
Bones Using Shaders - do
Not Serialize - enable
Distant Picking - facet
Depth Sort From - facet
Nb - force
World Matrix Instanced Buffer Update - forced
Instance Count - forward
- geometry
- has
Bounding Info - has
Instances - hasLODLevels
- has
Thin Instances - has
Vertex Alpha - infinite
Distance - is
An Instance - is
Blocked - is
Facet Data Enabled - is
Un Indexed - is
World Matrix Frozen - layer
Mask - light
Sources - manual
Update Of Previous World Matrix Instanced Buffer - manual
Update Of World Matrix Instanced Buffer - morph
Target Manager - must
Depth Sort Facets - non
Uniform Scaling - num
Bone Influencers - on
After Render Observable - on
Before Bind Observable - on
Before Draw - on
Before Draw Observable - on
Before Render Observable - on
Between Pass Observable - on
Cloned Observable - on
Collide - on
Collision Position Change - on
Dispose - on
Enabled State Changed Observable - override
Rendering Fill Mode - overriden
Instance Count - parent
- partitioningBBox
Ratio - partitioning
Subdivisions - pointer
Over Disable Mesh Testing - position
- preserve
Parent Rotation For Billboard - previous
World Matrix Instanced Buffer - receive
Shadows - rendering
Group Id - right
- rotation
- rotation
Quaternion - scaling
- skeleton
- source
- surrounding
Meshes - up
- use
Bones - useLODScreen
Coverage - use
Vertex Colors - visibility
- world
Matrix From Cache - world
Matrix Instanced Buffer - BILLBOARDMODE_
ALL - BILLBOARDMODE_
NONE - BILLBOARDMODE_
USE_ POSITION - BILLBOARDMODE_
X - BILLBOARDMODE_
Y - BILLBOARDMODE_
Z
Methods
- _invalidate
Instance Vertex Array Object - add
Behavior - add
Child - addLODLevel
- add
Rotation - align
With Normal - apply
Displacement Map - apply
Displacement Map From Buffer - apply
Impulse - apply
Skeleton - attach
To Bone - bake
Current Transform Into Vertices - bake
Transform Into Vertices - begin
Animation - build
Bounding Info - calc
MovePOV - calc
RotatePOV - clean
Matrix Weights - clone
- compute
World Matrix - convert
To Flat Shaded Mesh - convert
To Un Indexed Mesh - create
Animation Range - create
Instance - create
Normals - create
Or Update Submeshes Octree - delete
Animation Range - detach
From Bone - disable
Edges Rendering - disable
Facet Data - dispose
- enable
Edges Rendering - flip
Faces - force
Shared Vertices - freeze
Normals - freeze
World Matrix - get
Absolute Pivot Point - get
Absolute Pivot Point To Ref - get
Absolute Position - get
Animatables - get
Animation By Name - get
Animation Range - get
Animation Ranges - get
Behavior By Name - get
Bounding Info - get
Child Meshes - get
Child Transform Nodes - get
Children - get
Class Name - get
Closest Facet At Coordinates - get
Closest Facet At Local Coordinates - get
Connected Particle Systems - get
Descendants - get
Direction - get
Direction To Ref - get
Distance To Camera - get
Emitted Particle Systems - get
Engine - get
Facet Data Parameters - get
Facet Local Normals - get
Facet Local Partitioning - get
Facet Local Positions - get
Facet Normal - get
Facet Normal To Ref - get
Facet Position - get
Facet Position To Ref - get
Facets At Local Coordinates - get
Hierarchy Bounding Vectors - get
Hierarchy Emitted Particle Systems - get
Indices - getLOD
- getLODLevel
At Distance - getLODLevels
- get
Material For Render Pass - get
Mesh Uniform Buffer - get
Normals Data - get
Physics Body - get
Physics Impostor - get
Pivot Matrix - get
Pivot Point - get
Pivot Point To Ref - get
Pose Matrix - get
Position Data - get
Position Expressed In Local Space - get
Position In Camera Space - get
Raw Bounding Info - get
Scene - get
Total Indices - get
Total Vertices - get
Vertex Buffer - get
Vertices Data - get
Vertices Data Kinds - get
World Matrix - increase
Vertices - instantiate
Hierarchy - intersects
- intersects
Mesh - intersects
Point - is
Completely In Frustum - is
Descendant Of - is
Disposed - is
Enabled - is
In Frustum - is
Ready - is
Using Pivot Matrix - is
Using Post Multiply Pivot Matrix - is
Vertex Buffer Updatable - is
Vertices Data Present - is
World Matrix Camera Dependent - locally
Translate - look
At - make
Geometry Unique - mark
As Dirty - mark
Vertices Data As Updatable - movePOV
- move
With Collisions - normalize
To Unit Cube - optimize
Indices - refresh
Bounding Info - register
After Render - register
After World Matrix Update - register
Before Render - register
Instanced Buffer - release
Sub Meshes - remove
Behavior - remove
Child - removeLODLevel
- remove
Vertices Data - render
- render
With Render Pass Id - reset
Draw Cache - reset
Local Matrix - rotate
- rotate
Around - rotatePOV
- serialize
- serialize
Animation Ranges - set
Absolute Position - set
Bounding Info - set
Direction - set
Enabled - set
Index Buffer - set
Indices - set
Material ByID - set
Material By Id - set
Material For Render Pass - set
Normals ForCPUSkinning - set
Parent - set
Physics Link With - set
Pivot Matrix - set
Pivot Point - set
Position With Local Vector - set
Positions ForCPUSkinning - set
Pre Transform Matrix - set
Vertices Buffer - set
Vertices Data - simplify
- subdivide
- synchronize
Instances - thin
Instance Add - thin
Instance Add Self - thin
Instance Buffer Updated - thin
Instance Get World Matrices - thin
Instance Partial Buffer Update - thin
Instance Refresh Bounding Info - thin
Instance Register Attribute - thin
Instance Set Attribute At - thin
Instance Set Buffer - thin
Instance Set Matrix At - to
Left Handed - to
String - transfer
To Effect - translate
- unfreeze
Normals - unfreeze
World Matrix - unregister
After Render - unregister
After World Matrix Update - unregister
Before Render - update
Facet Data - update
Indices - update
Mesh Positions - update
Pose Matrix - update
Vertices Data - validate
Skinning - Add
Node Constructor - Center
- Construct
- Create
Box - Create
Capsule - Create
Cylinder - Create
Dashed Lines - Create
Decal - Create
Disc - Create
Ground - Create
Ground From Height Map - Create
Hemisphere - Create
Ico Sphere - Create
Lathe - Create
Lines - Create
Plane - Create
Polygon - Create
Polyhedron - Create
Ribbon - Create
Sphere - Create
Tiled Ground - Create
Torus - Create
Torus Knot - Create
Tube - Extend
To Goldberg - Extrude
Polygon - Extrude
Shape - Extrude
Shape Custom - Merge
Meshes - Merge
Meshes Async - Min
Max - Parse
- Parse
Animation Ranges
Constructors
constructor
Creates a new LinesMesh
Parameters
name: string
defines the name
Optional scene: Nullable<Scene>
defines the hosting scene
Optional parent: Nullable<Node>
defines the parent mesh if any
Optional source: Nullable<LinesMesh>
defines the optional source LinesMesh used to clone data from
Optional doNotCloneChildren: boolean
When cloning, skip cloning child meshes of source, default False. When false, achieved by calling a clone(), also passing False. This will make creation of children, recursive.
Optional useVertexColor: boolean
defines if this LinesMesh supports vertex color
Optional useVertexAlpha: boolean
defines if this LinesMesh supports vertex alpha
Optional material: Material
material to use to draw the line. If not provided, will create a new one
Returns LinesMesh
Properties
action ManagerSearch playground for actionManager
Gets or sets the current action manager
alphaSearch playground for alpha
Alpha of the line (Default: 1)
alpha IndexSearch playground for alphaIndex
Gets or sets the alpha index used to sort transparent meshes
always Select As Active MeshSearch playground for alwaysSelectAsActiveMesh
True if the mesh must be rendered in any case (this will shortcut the frustum clipping phase)
animationsSearch playground for animations
Gets a list of Animations associated with the node
colorSearch playground for color
Color of the line (Default: White)
culling StrategySearch playground for cullingStrategy
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 :
- AbstractMesh.CULLINGSTRATEGY_STANDARD
- AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY
- AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION
- AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY Please read each static variable documentation to get details about the culling process.
decal MapSearch playground for decalMap
Gets or sets the decal map for this mesh
defined Facing ForwardSearch playground for definedFacingForward
Gets or sets the orientation for POV movement & rotation
delay Load StateSearch playground for delayLoadState
Gets the delay loading state of the mesh (when delay loading is turned on)
delay Loading FileSearch playground for delayLoadingFile
Gets the file containing delay loading data for this mesh
do Not Sync Bounding InfoSearch playground for doNotSyncBoundingInfo
Gets or sets a boolean indicating that the bounding info does not need to be kept in sync (for performance reason)
edges ColorSearch playground for edgesColor
Defines edge color used when edgesRenderer is enabled
edges RendererSearch playground for edgesRenderer
Gets the edgesRenderer associated with the mesh
edges Share With InstancesSearch playground for edgesShareWithInstances
true to use the edge renderer for all instances of this mesh
edges WidthSearch playground for edgesWidth
Defines edge width used when edgesRenderer is enabled
ellipsoidSearch playground for ellipsoid
Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))
ellipsoid OffsetSearch playground for ellipsoidOffset
Gets or sets the ellipsoid offset used to impersonate this mesh when using collision engine (default is (0, 0, 0))
enable Pointer Move EventsSearch playground for enablePointerMoveEvents
Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
force Rendering When OccludedSearch playground for forceRenderingWhenOccluded
Flag to force rendering the mesh even if occluded
idSearch playground for id
Gets or sets the id of the node
ignore Camera MaxZSearch playground for ignoreCameraMaxZ
Gets or sets a boolean indicating whether to render ignoring the active camera's max z setting. (false by default) You should not mix meshes that have this property set to true with meshes that have it set to false if they all write to the depth buffer, because the z-values are not comparable in the two cases and you will get rendering artifacts if you do. You can set the property to true for meshes that do not write to the depth buffer, or set the same value (either false or true) otherwise. Note this will reduce performance when set to true.
ignore Non Uniform ScalingSearch playground for ignoreNonUniformScaling
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
inspectable Custom PropertiesSearch playground for inspectableCustomProperties
List of inspectable custom properties (used by the Inspector)
instanced BuffersSearch playground for instancedBuffers
Object used to store instanced buffers defined by user
Type declaration
[key: string]: any
instancesSearch playground for instances
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.
intersection ThresholdSearch playground for intersectionThreshold
The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray. This margin is expressed in world space coordinates, so its value may vary. Default value is 0.1
is BlockerSearch playground for isBlocker
Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)
is Near GrabbableSearch playground for isNearGrabbable
Gets or sets a boolean indicating if the mesh can be near grabbed. Default is false
is Near PickableSearch playground for isNearPickable
Gets or sets a boolean indicating if the mesh can be near picked. Default is false
is OccludedSearch playground for isOccluded
Gets or sets whether the mesh is occluded or not, it is used also to set the initial state of the mesh to be occluded or not
is Occlusion Query In ProgressSearch playground for isOcclusionQueryInProgress
Flag to check the progress status of the query
is PickableSearch playground for isPickable
Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true
is VisibleSearch playground for isVisible
Gets or sets a boolean indicating if the mesh is visible (renderable). Default is true
metadataSearch playground for metadata
Gets or sets an object used to store user defined information for the node
nameSearch playground for name
Gets or sets the name of the node
occlusion Query Algorithm TypeSearch playground for occlusionQueryAlgorithmType
This property determines the type of occlusion query algorithm to run in WebGl, you can use:
- AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE which is mapped to GL_ANY_SAMPLES_PASSED.
- AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE (Default Value) which is mapped to GL_ANY_SAMPLES_PASSED_CONSERVATIVE which is a false positive algorithm that is faster than GL_ANY_SAMPLES_PASSED but less accurate.
occlusion Retry CountSearch playground for occlusionRetryCount
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 retrieved, the query result indicates if the object is visible within the scene or not and based on that Babylon.Js engine decides to show or hide the object. The default value is -1 which means don't break the query and wait till the result
occlusion TypeSearch playground for occlusionType
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:
- OCCLUSION_TYPE_NONE (Default Value): this option means no occlusion query within the Mesh.
- OCCLUSION_TYPE_OPTIMISTIC: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken show the mesh.
- OCCLUSION_TYPE_STRICT: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken restore the last state of the mesh occlusion if the mesh was visible then show the mesh if was hidden then hide don't show.
on Accessibility Tag Changed ObservableSearch playground for onAccessibilityTagChangedObservable
on After World Matrix Update ObservableSearch playground for onAfterWorldMatrixUpdateObservable
An event triggered after the world matrix is updated
on Collide ObservableSearch playground for onCollideObservable
An event triggered when this mesh collides with another one
on Collision Position Change ObservableSearch playground for onCollisionPositionChangeObservable
An event triggered when the collision's position changes
on Dispose ObservableSearch playground for onDisposeObservable
An event triggered when the mesh is disposed
onLODLevel SelectionSearch playground for onLODLevelSelection
on Material Changed ObservableSearch playground for onMaterialChangedObservable
An event triggered when material is changed
on Mesh Ready ObservableSearch playground for onMeshReadyObservable
Will notify when the mesh is completely ready, including materials. Observers added to this observable will be removed once triggered
on ReadySearch playground for onReady
Callback raised when the node is ready to be used
on Rebuild ObservableSearch playground for onRebuildObservable
An event triggered when the mesh is rebuilt.
outline ColorSearch playground for outlineColor
Defines color to use when rendering outline
outline WidthSearch playground for outlineWidth
Define width to use when rendering outline
overlay AlphaSearch playground for overlayAlpha
Defines alpha to use when rendering overlay
overlay ColorSearch playground for overlayColor
Defines color to use when rendering overlay
override Material Side OrientationSearch playground for overrideMaterialSideOrientation
Use this property to change the original side orientation defined at construction time
physics BodySearch playground for physicsBody
physics ImpostorSearch playground for physicsImpostor
Gets or sets impostor used for physic simulation
re Integrate Rotation Into Rotation QuaternionSearch playground for reIntegrateRotationIntoRotationQuaternion
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
render OutlineSearch playground for renderOutline
Gets or sets a boolean indicating if the outline must be rendered as well
render OverlaySearch playground for renderOverlay
Gets or sets a boolean indicating if the overlay must be rendered as well
reserved Data StoreSearch playground for reservedDataStore
For internal use only. Please do not use.
scaling DeterminantSearch playground for scalingDeterminant
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
show Bounding BoxSearch playground for showBoundingBox
Gets or sets a boolean indicating if the bounding box must be rendered as well (false by default)
show Sub Meshes Bounding BoxSearch playground for showSubMeshesBoundingBox
Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default)
stateSearch playground for state
Gets or sets a string used to store user defined state for the node
sub MeshesSearch playground for subMeshes
Gets or sets the list of subMeshes
thin Instance CountSearch playground for thinInstanceCount
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.
thin Instance Enable PickingSearch playground for thinInstanceEnablePicking
Gets or sets a boolean defining if we want picking to pick thin instances as well
unique IdSearch playground for uniqueId
Gets or sets the unique id of the node
use Octree For CollisionsSearch playground for useOctreeForCollisions
Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default)
use Octree For PickingSearch playground for useOctreeForPicking
Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes picking (true by default)
use Octree For Rendering SelectionSearch playground for useOctreeForRenderingSelection
Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default)
Optional Readonly use Vertex AlphaSearch playground for useVertexAlpha
If vertex alpha should be applied to the mesh
Optional Readonly use Vertex ColorSearch playground for useVertexColor
If vertex color should be applied to the mesh
Static Readonly BACKSIDESearch playground for BACKSIDE
Mesh side orientation : usually the internal or back surface
Static Readonly BOTTOMSearch playground for BOTTOM
Mesh tile positioning : part tiles on bottom
Static Billboard Use Parent OrientationSearch playground for BillboardUseParentOrientation
Child transform with Billboard flags should or should not apply parent rotation (default if off)
Static Readonly CAP_ ALLSearch playground for CAP_ALL
Mesh cap setting : two caps, one at the beginning and one at the end of the mesh
Static Readonly CAP_ ENDSearch playground for CAP_END
Mesh cap setting : one cap at the end of the mesh
Static Readonly CAP_ STARTSearch playground for CAP_START
Mesh cap setting : one cap at the beginning of the mesh
Static Readonly CENTERSearch playground for CENTER
Mesh tile positioning : part tiles same on left/right or top/bottom
Static Readonly CULLINGSTRATEGY_ BOUNDINGSPHERE_ ONLYSearch playground for CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY
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_ OPTIMISTIC_ INCLUSIONSearch playground for CULLINGSTRATEGY_OPTIMISTIC_INCLUSION
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_ OPTIMISTIC_ INCLUSION_ THEN_ BSPHERE_ ONLYSearch playground for CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY
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_ STANDARDSearch playground for CULLINGSTRATEGY_STANDARD
Default culling strategy : this is an exclusion test and it's the more accurate. Test order : Is the bounding sphere outside the frustum ? If not, are the bounding box vertices outside the frustum ? It not, then the cullable object is in the frustum.
Static Readonly DEFAULTSIDESearch playground for DEFAULTSIDE
Mesh side orientation : by default, FRONTSIDE
Static Readonly DOUBLESIDESearch playground for DOUBLESIDE
Mesh side orientation : both internal and external or front and back surfaces
Static Readonly FLIP_ N_ ROTATE_ ROWSearch playground for FLIP_N_ROTATE_ROW
Mesh pattern setting : rotate pattern and rotate
Static Readonly FLIP_ N_ ROTATE_ TILESearch playground for FLIP_N_ROTATE_TILE
Mesh pattern setting : flip and rotate alternate tiles on each row or column
Static Readonly FLIP_ ROWSearch playground for FLIP_ROW
Mesh pattern setting : flip (reflect in y axis) all tiles on alternate rows
Static Readonly FLIP_ TILESearch playground for FLIP_TILE
Mesh pattern setting : flip (reflect in y axis) alternate tiles on each row or column
Static Readonly FRONTSIDESearch playground for FRONTSIDE
Mesh side orientation : usually the external or front surface
Static INSTANCEDMESH_ SORT_ TRANSPARENTSearch playground for INSTANCEDMESH_SORT_TRANSPARENT
Indicates that the instanced meshes should be sorted from back to front before rendering if their material is transparent
Static Readonly LEFTSearch playground for LEFT
Mesh tile positioning : part tiles on left
Static Readonly NO_ CAPSearch playground for NO_CAP
Mesh cap setting : no cap
Static Readonly NO_ FLIPSearch playground for NO_FLIP
Mesh pattern setting : no flip or rotate
Static OCCLUSION_ ALGORITHM_ TYPE_ ACCURATESearch playground for OCCLUSION_ALGORITHM_TYPE_ACCURATE
Use an accurate occlusion algorithm
Static OCCLUSION_ ALGORITHM_ TYPE_ CONSERVATIVESearch playground for OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE
Use a conservative occlusion algorithm
Static OCCLUSION_ TYPE_ NONESearch playground for OCCLUSION_TYPE_NONE
No occlusion
Static OCCLUSION_ TYPE_ OPTIMISTICSearch playground for OCCLUSION_TYPE_OPTIMISTIC
Occlusion set to optimistic
Static OCCLUSION_ TYPE_ STRICTSearch playground for OCCLUSION_TYPE_STRICT
Occlusion set to strict
Static Readonly RIGHTSearch playground for RIGHT
Mesh tile positioning : part tiles on right
Static Readonly ROTATE_ ROWSearch playground for ROTATE_ROW
Mesh pattern setting : rotate (180degs) all tiles on alternate rows
Static Readonly ROTATE_ TILESearch playground for ROTATE_TILE
Mesh pattern setting : rotate (180degs) alternate tiles on each row or column
Static Readonly TOPSearch playground for TOP
Mesh tile positioning : part tiles on top
Accessors
absolute Position
Returns the current mesh absolute position. Returns a Vector3.
Returns Vector3
absolute Rotation Quaternion
Returns the current mesh absolute rotation. Returns a Quaternion.
Returns Quaternion
absolute Scaling
Returns the current mesh absolute scaling. Returns a Vector3.
Returns Vector3
accessibility Tag
Gets or sets the accessibility tag to describe the node for accessibility purpose.
Returns Nullable<IAccessibilityTag>
Gets or sets the accessibility tag to describe the node for accessibility purpose.
Parameters
value: Nullable<IAccessibilityTag>
Returns void
animation Properties Override
Gets or sets the animation properties override
Returns Nullable<AnimationPropertiesOverride>
Gets or sets the animation properties override
Parameters
value: Nullable<AnimationPropertiesOverride>
Returns void
apply Fog
Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default)
Returns boolean
Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default)
Parameters
value: boolean
Returns void
are Normals Frozen
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.Returns boolean
baked Vertex Animation Manager
Gets or sets the baked vertex animation manager
Returns Nullable<IBakedVertexAnimationManager>
Gets or sets the baked vertex animation manager
Parameters
value: Nullable<IBakedVertexAnimationManager>
Returns void
behaviors
billboard Mode
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 Returns number
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 Parameters
value: number
Returns void
clone Mesh Map
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
Returns Nullable<{}>
collider
Gets Collider object used to compute collisions (not physics)
Returns Nullable<Collider>
collision Group
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
Returns number
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
Parameters
mask: number
Returns void
collision Mask
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
Returns number
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
Parameters
mask: number
Returns void
collision Response
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.
Returns boolean
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.
Parameters
response: boolean
Returns void
collision Retry Count
number of collision detection tries. Change this value if not all collisions are detected and handled properly
Returns number
number of collision detection tries. Change this value if not all collisions are detected and handled properly
Parameters
retryCount: number
Returns void
compute Bones Using Shaders
Returns boolean
Parameters
value: boolean
Returns void
do Not Serialize
Gets or sets a boolean used to define if the node must be serialized
Returns boolean
Gets or sets a boolean used to define if the node must be serialized
Parameters
value: boolean
Returns void
enable Distant Picking
When enabled, decompose picking matrices for better precision with large values for mesh position and scling
Returns boolean
When enabled, decompose picking matrices for better precision with large values for mesh position and scling
Parameters
value: boolean
Returns void
facet Depth Sort From
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
Returns Vector3
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
Parameters
location: Vector3
Returns void
facet Nb
Gets the number of facets in the mesh
Returns number
force World Matrix Instanced Buffer Update
Gets or sets a boolean indicating that the update of the instance buffer of the world matrices must be performed in all cases (and notably even in frozen mode)
Returns boolean
Gets or sets a boolean indicating that the update of the instance buffer of the world matrices must be performed in all cases (and notably even in frozen mode)
Parameters
value: boolean
Returns void
forced Instance Count
Gets or sets the forced number of instances to display. If 0 (default value), the number of instances is not forced and depends on the draw type (regular / instance / thin instances mesh)
Returns number
Gets or sets the forced number of instances to display. If 0 (default value), the number of instances is not forced and depends on the draw type (regular / instance / thin instances mesh)
Parameters
count: number
Returns void
forward
The forward direction of that transform in world space.
Returns Vector3
geometry
has Bounding Info
Returns true if there is already a bounding info
Returns boolean
has Instances
Returns boolean
hasLODLevels
Gets a boolean indicating if this mesh has LOD
Returns boolean
has Thin Instances
Returns boolean
has Vertex Alpha
Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values
Returns boolean
Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values
Parameters
value: boolean
Returns void
infinite Distance
Gets or sets the distance of the object to max, often used by skybox
Returns boolean
Gets or sets the distance of the object to max, often used by skybox
Parameters
value: boolean
Returns void
is An Instance
Gets a boolean indicating if this mesh is an instance or a regular mesh
Returns boolean
is Blocked
Returns boolean
is Facet Data Enabled
gets a boolean indicating if facetData is enabled
Returns boolean
is Un Indexed
Gets or sets a boolean indicating that this mesh does not use index buffer
Returns boolean
Gets or sets a boolean indicating that this mesh does not use index buffer
Parameters
value: boolean
Returns void
is World Matrix Frozen
True if the World matrix has been frozen.
Returns boolean
layer Mask
Gets or sets the current layer mask (default is 0x0FFFFFFF)
Returns number
Gets or sets the current layer mask (default is 0x0FFFFFFF)
Parameters
value: number
Returns void
light Sources
Gets the list of lights affecting that mesh
Returns Light[]
manual Update Of Previous World Matrix Instanced Buffer
Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual
Returns boolean
Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual
Parameters
value: boolean
Returns void
manual Update Of World Matrix Instanced Buffer
Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual
Returns boolean
Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual
Parameters
value: boolean
Returns void
morph Target Manager
Gets or sets the morph target manager
Returns Nullable<MorphTargetManager>
Gets or sets the morph target manager
Parameters
value: Nullable<MorphTargetManager>
Returns void
must Depth Sort Facets
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-materialsReturns boolean
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-materialsParameters
sort: boolean
Returns void
non Uniform Scaling
True if the scaling property of this object is non uniform eg. (1,2,1)
Returns boolean
num Bone Influencers
Gets or sets the number of allowed bone influences per vertex (4 by default)
Returns number
Gets or sets the number of allowed bone influences per vertex (4 by default)
Parameters
value: number
Returns void
on After Render Observable
An event triggered after rendering the mesh
Returns Observable<Mesh>
on Before Bind Observable
An event triggered before binding the mesh
Returns Observable<Mesh>
on Before Draw
Sets a callback to call before drawing the mesh. It is recommended to use onBeforeDrawObservable instead
Parameters
callback: (() => void)
Returns void
Returns void
on Before Draw Observable
An event triggered before drawing the mesh
Returns Observable<Mesh>
on Before Render Observable
An event triggered before rendering the mesh
Returns Observable<Mesh>
on Between Pass Observable
An event triggeredbetween rendering pass when using separateCullingPass = true
Returns Observable<SubMesh>
on Cloned Observable
An event triggered when the node is cloned
Returns Observable<Node>
on Collide
Set a function to call when this mesh collides with another one
Parameters
callback: ((collidedMesh?: AbstractMesh) => void)
Parameters
Optional collidedMesh: AbstractMesh
Returns void
Returns void
on Collision Position Change
Set a function to call when the collision's position changes
Parameters
callback: (() => void)
Returns void
Returns void
on Dispose
Sets a callback that will be raised when the node will be disposed
Parameters
callback: (() => void)
Returns void
Returns void
on Enabled State Changed Observable
An event triggered when the enabled state of the node changes
Returns Observable<boolean>
override Rendering Fill Mode
overriden Instance Count
Sets a value overriding the instance count. Only applicable when custom instanced InterleavedVertexBuffer are used rather than InstancedMeshs
Parameters
count: number
Returns void
parent
partitioningBBox Ratio
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
Returns number
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
Parameters
ratio: number
Returns void
partitioning Subdivisions
Gets or set the number (integer) of subdivisions per axis in the partitioning space
Returns number
Gets or set the number (integer) of subdivisions per axis in the partitioning space
Parameters
nb: number
Returns void
pointer Over Disable Mesh Testing
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.
Returns boolean
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.
Parameters
disable: boolean
Returns void
position
preserve Parent Rotation For Billboard
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
Returns boolean
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
Parameters
value: boolean
Returns void
previous World Matrix Instanced Buffer
Gets the array buffer used to store the instanced buffer used for instances' previous world matrices
Returns Float32Array
receive Shadows
Gets or sets a boolean indicating that this mesh can receive realtime shadows
Returns boolean
Gets or sets a boolean indicating that this mesh can receive realtime shadows
Parameters
value: boolean
Returns void
rendering Group Id
Specifies the rendering group id for this mesh (0 by default)
Returns number
Specifies the rendering group id for this mesh (0 by default)
Parameters
value: number
Returns void
right
The right direction of that transform in world space.
Returns Vector3
rotation
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
Returns Vector3
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
Parameters
newRotation: Vector3
Returns void
rotation 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)
Returns Nullable<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)
Parameters
quaternion: Nullable<Quaternion>
Returns void
scaling
Gets or sets the scaling property : a Vector3 defining the node scaling along each local axis X, Y, Z (default is (1.0, 1.0, 1.0)).
Returns Vector3
Gets or sets the scaling property : a Vector3 defining the node scaling along each local axis X, Y, Z (default is (1.0, 1.0, 1.0)).
Parameters
newScaling: Vector3
Returns void
skeleton
source
surrounding Meshes
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.
Returns Nullable<AbstractMesh[]>
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.
Parameters
meshes: Nullable<AbstractMesh[]>
Returns void
up
The up direction of that transform in world space.
Returns Vector3
use Bones
Gets a boolean indicating if this mesh has skinning data and an attached skeleton
Returns boolean
useLODScreen Coverage
Determines if the LOD levels are intended to be calculated using screen coverage (surface area ratio) instead of distance.
Returns boolean
Determines if the LOD levels are intended to be calculated using screen coverage (surface area ratio) instead of distance.
Parameters
value: boolean
Returns void
use Vertex Colors
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)
Returns boolean
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)
Parameters
value: boolean
Returns void
visibility
Gets or sets mesh visibility between 0 and 1 (default is 1)
Returns number
Gets or sets mesh visibility between 0 and 1 (default is 1)
Parameters
value: number
Returns void
world Matrix From Cache
Returns directly the latest state of the mesh World matrix. A Matrix is returned.
Returns Matrix
world Matrix Instanced Buffer
Gets the array buffer used to store the instanced buffer used for instances' world matrices
Returns Float32Array
Static BILLBOARDMODE_ ALL
Billboard on all axes
Returns number
Static BILLBOARDMODE_ NONE
No billboard
Returns number
Static BILLBOARDMODE_ USE_ POSITION
Billboard on using position instead of orientation
Returns number
Static BILLBOARDMODE_ X
Billboard on X axis
Returns number
Static BILLBOARDMODE_ Y
Billboard on Y axis
Returns number
Static BILLBOARDMODE_ Z
Billboard on Z axis
Returns number
Methods
_invalidate Instance Vertex Array ObjectSearch playground for _invalidateInstanceVertexArrayObject
Invalidate VertexArrayObjects belonging to the mesh (but not to the Geometry of the mesh).
Returns void
add BehaviorSearch playground for addBehavior
add ChildSearch playground for addChild
Adds the passed mesh as a child to the current mesh
Parameters
mesh: AbstractMesh
defines the child mesh
Optional preserveScalingSign: boolean
if true, keep scaling sign of child. Otherwise, scaling sign might change.
Returns AbstractMesh
the current mesh
addLODLevelSearch playground for addLODLevel
Add a mesh as LOD level triggered at the given distance.
Parameters
distanceOrScreenCoverage: number
Either distance from the center of the object to show this level or the screen coverage if
useScreenCoverage
is set totrue
. If screen coverage, value is a fraction of the screen's total surface, between 0 and 1. Example Playground for distance https://playground.babylonjs.com/#QE7KM#197 Example Playground for screen coverage https://playground.babylonjs.com/#QE7KM#196mesh: Nullable<Mesh>
The mesh to be added as LOD level (can be null)
Returns Mesh
This mesh (for chaining)
add RotationSearch playground for addRotation
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.Parameters
x: number
Rotation to add
y: number
Rotation to add
z: number
Rotation to add
Returns TransformNode
the TransformNode.
align With NormalSearch playground for alignWithNormal
Align the mesh with a normal
Parameters
normal: Vector3
defines the normal to use
Optional upDirection: Vector3
can be used to redefined the up vector to use (will use the (0, 1, 0) by default)
Returns AbstractMesh
the current mesh
apply Displacement MapSearch playground for applyDisplacementMap
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.
Parameters
url: string
is a string, the URL from the image file is to be downloaded.
minHeight: number
is the lower limit of the displacement.
maxHeight: number
is the upper limit of the displacement.
Optional onSuccess: ((mesh: Mesh) => void)
is an optional Javascript function to be called just after the mesh is modified. It is passed the modified mesh and must return nothing.
Parameters
mesh: Mesh
Returns void
Optional uvOffset: Vector2
is an optional vector2 used to offset UV.
Optional uvScale: Vector2
is an optional vector2 used to scale UV.
Optional forceUpdate: boolean
defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
Returns Mesh
the Mesh.
apply Displacement Map From BufferSearch playground for applyDisplacementMapFromBuffer
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.
Parameters
buffer: Uint8Array
is a
Uint8Array
buffer containing series ofUint8
lower than 255, the red, green, blue and alpha values of each successive pixel.heightMapWidth: number
is the width of the buffer image.
heightMapHeight: number
is the height of the buffer image.
minHeight: number
is the lower limit of the displacement.
maxHeight: number
is the upper limit of the displacement.
Optional uvOffset: Vector2
is an optional vector2 used to offset UV.
Optional uvScale: Vector2
is an optional vector2 used to scale UV.
Optional forceUpdate: boolean
defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
Returns Mesh
the Mesh.
apply ImpulseSearch playground for applyImpulse
Apply a physic impulse to the mesh
Parameters
Returns AbstractMesh
the current mesh
apply SkeletonSearch playground for applySkeleton
attach To BoneSearch playground for attachToBone
Attach the current TransformNode to another TransformNode associated with a bone
Parameters
bone: Bone
Bone affecting the TransformNode
affectedTransformNode: TransformNode
TransformNode associated with the bone
Returns TransformNode
this object
bake Current Transform Into VerticesSearch playground for bakeCurrentTransformIntoVertices
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.
Parameters
Optional bakeIndependentlyOfChildren: boolean
indicates whether to preserve all child nodes' World Matrix during baking
Returns Mesh
the current mesh
bake Transform Into VerticesSearch playground for bakeTransformIntoVertices
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.
Parameters
transform: Matrix
defines the transform matrix to use
Returns Mesh
the current mesh
begin AnimationSearch playground for beginAnimation
Will start the animation sequence
Parameters
name: string
defines the range frames for animation sequence
Optional loop: boolean
defines if the animation should loop (false by default)
Optional speedRatio: number
defines 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)
Returns void
Returns Nullable<Animatable>
the object created for this animation. If range does not exist, it will return null
build Bounding InfoSearch playground for buildBoundingInfo
Creates a new bounding info for the mesh
Parameters
minimum: DeepImmutableObject<Vector3>
min vector of the bounding box/sphere
maximum: DeepImmutableObject<Vector3>
max vector of the bounding box/sphere
Optional worldMatrix: DeepImmutableObject<Matrix>
defines the new world matrix
Returns BoundingInfo
the new bounding info
calc MovePOVSearch playground for calcMovePOV
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 {@link definedFacingForwardSearch | See definedFacingForwardSearch }.
Parameters
amountRight: number
defines the distance on the right axis
amountUp: number
defines the distance on the up axis
amountForward: number
defines the distance on the forward axis
Returns Vector3
the new displacement vector
calc RotatePOVSearch playground for calcRotatePOV
Calculate relative rotation change from the point of view of behind the front of the mesh. Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.
Parameters
flipBack: number
defines the flip
twirlClockwise: number
defines the twirl
tiltRight: number
defines the tilt
Returns Vector3
the new rotation vector
clean Matrix WeightsSearch playground for cleanMatrixWeights
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 void
cloneSearch playground for clone
compute World MatrixSearch playground for computeWorldMatrix
Computes the world matrix of the node
Parameters
Optional force: boolean
defines 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)
Returns Matrix
the world matrix
convert To Flat Shaded MeshSearch playground for convertToFlatShadedMesh
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.
Returns Mesh
current mesh
convert To Un Indexed MeshSearch playground for convertToUnIndexedMesh
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.
Returns Mesh
current mesh
create Animation RangeSearch playground for createAnimationRange
Creates an animation range for this node
Parameters
name: string
defines the name of the range
from: number
defines the starting key
to: number
defines the end key
Returns void
create InstanceSearch playground for createInstance
Creates a new InstancedLinesMesh object from the mesh model.
Parameters
name: string
defines the name of the new instance
Returns InstancedLinesMesh
a new InstancedLinesMesh
create NormalsSearch playground for createNormals
Creates new normals data for the mesh
Parameters
updatable: boolean
defines if the normal vertex buffer must be flagged as updatable
Returns AbstractMesh
the current mesh
create Or Update Submeshes OctreeSearch playground for createOrUpdateSubmeshesOctree
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
Parameters
Optional maxCapacity: number
defines the maximum size of each block (64 by default)
Optional maxDepth: number
defines the maximum depth to use (no more than 2 levels by default)
Returns Octree<SubMesh>
the new octree
delete Animation RangeSearch playground for deleteAnimationRange
Delete a specific animation range
Parameters
name: string
defines the name of the range to delete
Optional deleteFrames: boolean
defines if animation frames from the range must be deleted as well
Returns void
detach From BoneSearch playground for detachFromBone
Detach the transform node if its associated with a bone
Parameters
Optional resetToPreviousParent: boolean
Indicates 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)
Returns TransformNode
this object
disable Edges RenderingSearch playground for disableEdgesRendering
Disables the mesh edge rendering mode
Returns AbstractMesh
the currentAbstractMesh
disable Facet DataSearch playground for disableFacetData
Disables the feature FacetData and frees the related memory
Returns AbstractMesh
the current mesh
disposeSearch playground for dispose
Disposes of the line mesh
Parameters
Optional doNotRecurse: boolean
If children should be disposed
Optional disposeMaterialAndTextures: boolean
This parameter is not used by the LineMesh class
Optional doNotDisposeMaterial: boolean
If the material should not be disposed (default: false, meaning the material is disposed)
Returns void
enable Edges RenderingSearch playground for enableEdgesRendering
Enables the edge rendering mode on the mesh. This mode makes the mesh edges visible
Parameters
Optional epsilon: number
defines the maximal distance between two angles to detect a face
Optional checkVerticesInsteadOfIndices: boolean
indicates that we should check vertex list directly instead of faces
Returns AbstractMesh
the currentAbstractMesh
flip FacesSearch playground for flipFaces
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.
Parameters
Optional flipNormals: boolean
will also inverts the normals
Returns Mesh
current mesh
force Shared VerticesSearch playground for forceSharedVertices
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.
Returns void
freeze NormalsSearch playground for freezeNormals
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.Returns Mesh
the current mesh
freeze World MatrixSearch playground for freezeWorldMatrix
Prevents the World matrix to be computed any longer
Parameters
Optional newWorldMatrix: Nullable<Matrix>
defines an optional matrix to use as world matrix
Optional decompose: boolean
defines whether to decompose the given newWorldMatrix or directly assign
Returns TransformNode
the TransformNode.
get Absolute Pivot PointSearch playground for getAbsolutePivotPoint
Returns a new Vector3 set with the mesh pivot point World coordinates.
Returns Vector3
a new Vector3 set with the mesh pivot point World coordinates.
get Absolute Pivot Point To RefSearch playground for getAbsolutePivotPointToRef
Sets the Vector3 "result" coordinates with the mesh pivot point World coordinates.
Parameters
result: Vector3
vector3 to store the result
Returns TransformNode
this TransformNode.
get Absolute PositionSearch playground for getAbsolutePosition
Returns the mesh absolute position in the World.
Returns Vector3
a Vector3.
get AnimatablesSearch playground for getAnimatables
Returns as a new array populated with the mesh material and/or skeleton, if any.
Returns IAnimatable[]
an array of IAnimatable
get Animation By NameSearch playground for getAnimationByName
get Animation RangeSearch playground for getAnimationRange
Get an animation range by name
Parameters
name: string
defines the name of the animation range to look for
Returns Nullable<AnimationRange>
null if not found else the requested animation range
get Animation RangesSearch playground for getAnimationRanges
Gets the list of all animation ranges defined on this node
Returns Nullable<AnimationRange>[]
an array
get Behavior By NameSearch playground for getBehaviorByName
get Bounding InfoSearch playground for getBoundingInfo
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, callgetHierarchyBoundingVectors
instead.Returns BoundingInfo
a BoundingInfo
get Child MeshesSearch playground for getChildMeshes
Get all child-meshes of this node
Type Parameters
T extends AbstractMesh<T>
Parameters
Optional directDescendantsOnly: boolean
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)
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
Parameters
node: Node
Returns node is T
Returns T[]
an array of AbstractMesh
Get all child-meshes of this node
Parameters
Optional directDescendantsOnly: boolean
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)
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
Parameters
node: Node
Returns boolean
Returns AbstractMesh[]
an array of AbstractMesh
get Child Transform NodesSearch playground for getChildTransformNodes
Get all child-transformNodes of this node
Parameters
Optional directDescendantsOnly: boolean
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
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
Parameters
node: Node
Returns boolean
Returns TransformNode[]
an array of TransformNode
get ChildrenSearch playground for getChildren
Get all direct children of this node
Type Parameters
T extends Node<T>
Parameters
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
Parameters
node: Node
Returns node is T
Optional directDescendantsOnly: boolean
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)
Returns T[]
an array of Node
Get all direct children of this node
Parameters
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
Parameters
node: Node
Returns boolean
Optional directDescendantsOnly: boolean
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)
Returns Node[]
an array of Node
get Class NameSearch playground for getClassName
Returns the string "LineMesh"
Returns string
get Closest Facet At CoordinatesSearch playground for getClosestFacetAtCoordinates
Returns the closest mesh facet index at (x,y,z) World coordinates, null if not found
Parameters
x: number
defines x coordinate
y: number
defines y coordinate
z: number
defines z coordinate
Optional projected: Vector3
sets as the (x,y,z) world projection on the facet
Optional checkFace: boolean
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
Optional facing: boolean
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
Returns Nullable<number>
the face index if found (or null instead)
get Closest Facet At Local CoordinatesSearch playground for getClosestFacetAtLocalCoordinates
Returns the closest mesh facet index at (x,y,z) local coordinates, null if not found
Parameters
x: number
defines x coordinate
y: number
defines y coordinate
z: number
defines z coordinate
Optional projected: Vector3
sets as the (x,y,z) local projection on the facet
Optional checkFace: boolean
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
Optional facing: boolean
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
Returns Nullable<number>
the face index if found (or null instead)
get Connected Particle SystemsSearch playground for getConnectedParticleSystems
This function returns all of the particle systems in the scene that use the mesh as an emitter.
Returns IParticleSystem[]
an array of particle systems in the scene that use the mesh as an emitter
get DescendantsSearch playground for getDescendants
Will return all nodes that have this node as ascendant
Type Parameters
T extends Node<T>
Parameters
Optional directDescendantsOnly: boolean
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
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
Parameters
node: Node
Returns node is T
Returns T[]
all children nodes of all types
Will return all nodes that have this node as ascendant
Parameters
Optional directDescendantsOnly: boolean
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
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
Parameters
node: Node
Returns boolean
Returns Node[]
all children nodes of all types
get DirectionSearch playground for getDirection
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.
Parameters
localAxis: Vector3
axis to rotate
Returns Vector3
a new Vector3 that is the localAxis, expressed in the mesh local space, rotated like the mesh.
get Direction To RefSearch playground for getDirectionToRef
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.
Parameters
Returns TransformNode
this TransformNode.
get Distance To CameraSearch playground for getDistanceToCamera
get Emitted Particle SystemsSearch playground for getEmittedParticleSystems
Returns an array populated with IParticleSystem objects whose the mesh is the emitter
Returns IParticleSystem[]
an array of IParticleSystem
get EngineSearch playground for getEngine
Gets the engine of the node
Returns Engine
a Engine
get Facet Data ParametersSearch playground for getFacetDataParameters
Returns the object "parameter" set with all the expected parameters for facetData computation by ComputeNormals()
Returns any
the parameters
get Facet Local NormalsSearch playground for getFacetLocalNormals
Returns the facetLocalNormals array. The normals are expressed in the mesh local spac
Returns Vector3[]
an array of Vector3
get Facet Local PartitioningSearch playground for getFacetLocalPartitioning
Returns the facetLocalPartitioning array
Returns number[][]
an array of array of numbers
get Facet Local PositionsSearch playground for getFacetLocalPositions
Returns the facetLocalPositions array. The facet positions are expressed in the mesh local space
Returns Vector3[]
an array of Vector3
get Facet NormalSearch playground for getFacetNormal
Returns the i-th facet normal in the world system. This method allocates a new Vector3 per call
Parameters
i: number
defines the facet index
Returns Vector3
a new Vector3
get Facet Normal To RefSearch playground for getFacetNormalToRef
get Facet PositionSearch playground for getFacetPosition
Returns the i-th facet position in the world system. This method allocates a new Vector3 per call
Parameters
i: number
defines the facet index
Returns Vector3
a new Vector3
get Facet Position To RefSearch playground for getFacetPositionToRef
Sets the reference Vector3 with the i-th facet position in the world system
Parameters
i: number
defines the facet index
ref: Vector3
defines the target vector
Returns AbstractMesh
the current mesh
get Facets At Local CoordinatesSearch playground for getFacetsAtLocalCoordinates
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)
Parameters
x: number
defines x coordinate
y: number
defines y coordinate
z: number
defines z coordinate
Returns Nullable<number[]>
the array of facet indexes
get Hierarchy Bounding VectorsSearch playground for getHierarchyBoundingVectors
Return the minimum and maximum world vectors of the entire hierarchy under current node
Parameters
Optional includeDescendants: boolean
Include 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 { max: Vector3; min: Vector3 }
the new bounding vectors
get Hierarchy Emitted Particle SystemsSearch playground for getHierarchyEmittedParticleSystems
Returns an array populated with IParticleSystem objects whose the mesh or its children are the emitter
Returns IParticleSystem[]
an array of IParticleSystem
get IndicesSearch playground for getIndices
Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.
Parameters
Optional copyWhenShared: boolean
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.
Optional forceCopy: boolean
defines a boolean indicating that the returned array must be cloned upon returning it
Returns Nullable<IndicesArray>
the indices array or an empty array if the mesh has no geometry
getLODSearch playground for getLOD
Returns the registered LOD mesh distant from the parameter
camera
position if any, else returns the current mesh.Parameters
camera: Camera
defines the camera to use to compute distance
Optional boundingSphere: BoundingSphere
defines a custom bounding sphere to use instead of the one from this mesh
Returns Nullable<AbstractMesh>
This mesh (for chaining)
getLODLevel At DistanceSearch playground for getLODLevelAtDistance
getLODLevelsSearch playground for getLODLevels
Gets the list of MeshLODLevel associated with the current mesh
Returns MeshLODLevel[]
an array of MeshLODLevel
get Material For Render PassSearch playground for getMaterialForRenderPass
Gets the material used to render the mesh in a specific render pass
Parameters
renderPassId: number
render pass id
Returns undefined | Material
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)
get Mesh Uniform BufferSearch playground for getMeshUniformBuffer
Gets the mesh uniform buffer.
Returns UniformBuffer
the uniform buffer of the mesh.
get Normals DataSearch playground for getNormalsData
Get the normals vertex data and optionally apply skeleton and morphing.
Parameters
Optional applySkeleton: boolean
defines whether to apply the skeleton
Optional applyMorph: boolean
defines whether to apply the morph target
Returns Nullable<FloatArray>
the normals data
get Physics BodySearch playground for getPhysicsBody
Returns Nullable<PhysicsBody>
get Physics ImpostorSearch playground for getPhysicsImpostor
Gets the current physics impostor
Returns Nullable<PhysicsImpostor>
a physics impostor or null
get Pivot MatrixSearch playground for getPivotMatrix
Returns the mesh pivot matrix. Default : Identity.
Returns Matrix
the matrix
get Pivot PointSearch playground for getPivotPoint
Returns a new Vector3 set with the mesh pivot point coordinates in the local space.
Returns Vector3
the pivot point
get Pivot Point To RefSearch playground for getPivotPointToRef
Sets the passed Vector3 "result" with the coordinates of the mesh pivot point in the local space.
Parameters
result: Vector3
the vector3 to store the result
Returns TransformNode
this TransformNode.
get Pose MatrixSearch playground for getPoseMatrix
Returns the mesh Pose matrix.
Returns Matrix
the pose matrix
get Position DataSearch playground for getPositionData
Get the position vertex data and optionally apply skeleton and morphing.
Parameters
Optional applySkeleton: boolean
defines whether to apply the skeleton
Optional applyMorph: boolean
defines whether to apply the morph target
Optional data: Nullable<FloatArray>
defines the position data to apply the skeleton and morph to
Returns Nullable<FloatArray>
the position data
get Position Expressed In Local SpaceSearch playground for getPositionExpressedInLocalSpace
Returns the mesh position in the local space from the current World matrix values.
Returns Vector3
a new Vector3.
get Position In Camera SpaceSearch playground for getPositionInCameraSpace
get Raw Bounding InfoSearch playground for getRawBoundingInfo
Returns the bounding info unnafected by instance data.
Returns BoundingInfo
the bounding info of the mesh unaffected by instance data.
get SceneSearch playground for getScene
Gets the scene of the node
Returns Scene
a scene
get Total IndicesSearch playground for getTotalIndices
Returns a positive integer : the total number of indices in this mesh geometry.
Returns number
the numner of indices or zero if the mesh has no geometry.
get Total VerticesSearch playground for getTotalVertices
Returns the total number of vertices within the mesh geometry or zero if the mesh has no geometry.
Returns number
the total number of vertices
get Vertex BufferSearch playground for getVertexBuffer
Returns the mesh VertexBuffer object from the requested
kind
Parameters
kind: string
defines which buffer to read from (positions, indices, normals, etc). Possible
kind
values :- VertexBuffer.PositionKind
- VertexBuffer.NormalKind
- VertexBuffer.UVKind
- VertexBuffer.UV2Kind
- VertexBuffer.UV3Kind
- VertexBuffer.UV4Kind
- VertexBuffer.UV5Kind
- VertexBuffer.UV6Kind
- VertexBuffer.ColorKind
- VertexBuffer.MatricesIndicesKind
- VertexBuffer.MatricesIndicesExtraKind
- VertexBuffer.MatricesWeightsKind
- VertexBuffer.MatricesWeightsExtraKind
Optional bypassInstanceData: boolean
defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
Returns Nullable<VertexBuffer>
a FloatArray or null if the mesh has no vertex buffer for this kind.
get Vertices DataSearch playground for getVerticesData
Returns the content of an associated vertex buffer
Parameters
kind: string
defines which buffer to read from (positions, indices, normals, etc). Possible
kind
values :- VertexBuffer.PositionKind
- VertexBuffer.UVKind
- VertexBuffer.UV2Kind
- VertexBuffer.UV3Kind
- VertexBuffer.UV4Kind
- VertexBuffer.UV5Kind
- VertexBuffer.UV6Kind
- VertexBuffer.ColorKind
- VertexBuffer.MatricesIndicesKind
- VertexBuffer.MatricesIndicesExtraKind
- VertexBuffer.MatricesWeightsKind
- VertexBuffer.MatricesWeightsExtraKind
Optional copyWhenShared: boolean
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
Optional forceCopy: boolean
defines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is
Optional bypassInstanceData: boolean
defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
Returns Nullable<FloatArray>
a FloatArray or null if the mesh has no geometry or no vertex buffer for this kind.
get Vertices Data KindsSearch playground for getVerticesDataKinds
Returns a string which contains the list of existing
kinds
of Vertex Data associated with this mesh.Parameters
Optional bypassInstanceData: boolean
defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
Returns string[]
an array of strings
get World MatrixSearch playground for getWorldMatrix
Gets the current world matrix
Returns Matrix
a Matrix
increase VerticesSearch playground for increaseVertices
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.
Parameters
Optional numberPerEdge: number
the number of new vertices to add to each edge of a facet, optional default 1
Returns void
instantiate HierarchySearch playground for instantiateHierarchy
Instantiate (when possible) or clone that node with its hierarchy
Parameters
Optional newParent: Nullable<TransformNode>
Optional options: { doNotInstantiate: boolean | ((node: TransformNode) => boolean) }
do
Not Instantiate: boolean | ((node: TransformNode) => boolean)
Optional onNewNodeCreated: ((source: TransformNode, clone: TransformNode) => void)
Parameters
source: TransformNode
clone: TransformNode
Returns void
Returns Nullable<TransformNode>
an instance (or a clone) of the current node with its hierarchy
intersectsSearch playground for intersects
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.
Parameters
ray: Ray
defines the ray to use. It should be in the mesh's LOCAL coordinate space.
Optional fastCheck: boolean
defines if fast mode (but less precise) must be used (false by default)
Optional trianglePredicate: TrianglePickingPredicate
defines an optional predicate used to select faces when a mesh intersection is detected
Optional onlyBoundingInfo: boolean
defines a boolean indicating if picking should only happen using bounding info (false by default)
Optional worldToUse: Matrix
defines the world matrix to use to get the world coordinate of the intersection point
Optional skipBoundingInfo: boolean
a boolean indicating if we should skip the bounding info check
Returns PickingInfo
the picking info
intersects MeshSearch playground for intersectsMesh
True if the mesh intersects another mesh or a SolidParticle object
Parameters
mesh: AbstractMesh | SolidParticle
defines a target mesh or SolidParticle to test
Optional precise: boolean
Unless the parameter
precise
is set totrue
the intersection is computed according to Axis Aligned Bounding Boxes (AABB), else according to OBB (Oriented BBoxes)Optional includeDescendants: boolean
Can be set to true to test if the mesh defined in parameters intersects with the current mesh or any child meshes
Returns boolean
true if there is an intersection
intersects PointSearch playground for intersectsPoint
Returns true if the passed point (Vector3) is inside the mesh bounding box
Parameters
point: Vector3
defines the point to test
Returns boolean
true if there is an intersection
is Completely In FrustumSearch playground for isCompletelyInFrustum
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.Parameters
frustumPlanes: Plane[]
defines the frustum to test
Returns boolean
true if the mesh is completely in the frustum planes
is Descendant OfSearch playground for isDescendantOf
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
Parameters
ancestor: Node
defines the parent node to inspect
Returns boolean
a boolean indicating if this node is a descendant of the given node
is DisposedSearch playground for isDisposed
Gets a boolean indicating if the node has been disposed
Returns boolean
true if the node was disposed
is EnabledSearch playground for isEnabled
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
Parameters
Optional checkAncestors: boolean
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
Returns boolean
whether this node (and its parent) is enabled
is In FrustumSearch playground for isInFrustum
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 frustumParameters
frustumPlanes: Plane[]
defines the frustum to test
Returns boolean
true if the mesh is in the frustum planes
is ReadySearch playground for isReady
Determine if the current mesh is ready to be rendered
Returns boolean
true if all associated assets are ready (material, textures, shaders)
is Using Pivot MatrixSearch playground for isUsingPivotMatrix
return true if a pivot has been set
Returns boolean
true if a pivot matrix is used
is Using Post Multiply Pivot MatrixSearch playground for isUsingPostMultiplyPivotMatrix
return true if 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.
Returns boolean
is Vertex Buffer UpdatableSearch playground for isVertexBufferUpdatable
Returns a boolean defining if the vertex data for the requested
kind
is updatable.Parameters
kind: string
defines which buffer to check (positions, indices, normals, etc). Possible
kind
values :- VertexBuffer.PositionKind
- VertexBuffer.UVKind
- VertexBuffer.UV2Kind
- VertexBuffer.UV3Kind
- VertexBuffer.UV4Kind
- VertexBuffer.UV5Kind
- VertexBuffer.UV6Kind
- VertexBuffer.ColorKind
- VertexBuffer.MatricesIndicesKind
- VertexBuffer.MatricesIndicesExtraKind
- VertexBuffer.MatricesWeightsKind
- VertexBuffer.MatricesWeightsExtraKind
Optional bypassInstanceData: boolean
defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
Returns boolean
a boolean
is Vertices Data PresentSearch playground for isVerticesDataPresent
Tests if a specific vertex buffer is associated with this mesh
Parameters
kind: string
defines which buffer to check (positions, indices, normals, etc). Possible
kind
values :- VertexBuffer.PositionKind
- VertexBuffer.NormalKind
- VertexBuffer.UVKind
- VertexBuffer.UV2Kind
- VertexBuffer.UV3Kind
- VertexBuffer.UV4Kind
- VertexBuffer.UV5Kind
- VertexBuffer.UV6Kind
- VertexBuffer.ColorKind
- VertexBuffer.MatricesIndicesKind
- VertexBuffer.MatricesIndicesExtraKind
- VertexBuffer.MatricesWeightsKind
- VertexBuffer.MatricesWeightsExtraKind
Optional bypassInstanceData: boolean
defines a boolean indicating that the function should not take into account the instance data (applies only if the mesh has instances). Default: false
Returns boolean
a boolean
is World Matrix Camera DependentSearch playground for isWorldMatrixCameraDependent
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.
Returns boolean
true if the world matrix computation needs the camera information to be computed
locally TranslateSearch playground for locallyTranslate
Translates the mesh along the passed Vector3 in its local space.
Parameters
vector3: Vector3
the distance to translate in localspace
Returns TransformNode
the TransformNode.
look AtSearch playground for lookAt
Orients a mesh towards a target point. Mesh must be drawn facing user.
Parameters
targetPoint: Vector3
the position (must be in same space as current mesh) to look at
Optional yawCor: number
optional yaw (y-axis) correction in radians
Optional pitchCor: number
optional pitch (x-axis) correction in radians
Optional rollCor: number
optional roll (z-axis) correction in radians
Optional space: Space
the chosen space of the target
Returns TransformNode
the TransformNode.
make Geometry UniqueSearch playground for makeGeometryUnique
Creates a un-shared specific occurence of the geometry for the mesh.
Returns Mesh
the current mesh
mark As DirtySearch playground for markAsDirty
Flag the AbstractMesh as dirty (Forcing it to update everything)
Parameters
Optional property: string
if set to "rotation" the objects rotationQuaternion will be set to null
Returns AbstractMesh
this AbstractMesh
mark Vertices Data As UpdatableSearch playground for markVerticesDataAsUpdatable
Flags an associated vertex buffer as updatable
Parameters
kind: string
defines which buffer to use (positions, indices, normals, etc). Possible
kind
values :- VertexBuffer.PositionKind
- VertexBuffer.UVKind
- VertexBuffer.UV2Kind
- VertexBuffer.UV3Kind
- VertexBuffer.UV4Kind
- VertexBuffer.UV5Kind
- VertexBuffer.UV6Kind
- VertexBuffer.ColorKind
- VertexBuffer.MatricesIndicesKind
- VertexBuffer.MatricesIndicesExtraKind
- VertexBuffer.MatricesWeightsKind
- VertexBuffer.MatricesWeightsExtraKind
Optional updatable: boolean
defines if the updated vertex buffer must be flagged as updatable
Returns void
movePOVSearch playground for movePOV
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 {@link definedFacingForwardSearch | See definedFacingForwardSearch }.
Parameters
amountRight: number
defines the distance on the right axis
amountUp: number
defines the distance on the up axis
amountForward: number
defines the distance on the forward axis
Returns AbstractMesh
the current mesh
move With CollisionsSearch playground for moveWithCollisions
Move the mesh using collision engine
Parameters
displacement: Vector3
defines the requested displacement vector
Returns AbstractMesh
the current mesh
normalize To Unit CubeSearch playground for normalizeToUnitCube
Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
Parameters
Optional includeDescendants: boolean
Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
Optional ignoreRotation: boolean
ignore 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
Returns AbstractMesh
the current mesh
optimize IndicesSearch playground for optimizeIndices
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.
Parameters
Optional successCallback: ((mesh?: Mesh) => void)
an optional success callback to be called after the optimization finished.
Parameters
Optional mesh: Mesh
Returns void
Returns Mesh
the current mesh
refresh Bounding InfoSearch playground for refreshBoundingInfo
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.
Parameters
Optional applySkeleton: boolean
defines whether to apply the skeleton before computing the bounding info
Optional applyMorph: boolean
defines whether to apply the morph target before computing the bounding info
Returns Mesh
the current mesh
register After RenderSearch playground for registerAfterRender
Registers for this mesh a javascript function called just after the rendering is complete
Parameters
func: ((mesh: AbstractMesh) => void)
defines the function to call after rendering this mesh
Parameters
mesh: AbstractMesh
Returns void
Returns Mesh
the current mesh
register After World Matrix UpdateSearch playground for registerAfterWorldMatrixUpdate
If you'd like to be called back after the mesh position, rotation or scaling has been updated.
Parameters
func: ((mesh: TransformNode) => void)
callback function to add
Parameters
mesh: TransformNode
Returns void
Returns TransformNode
the TransformNode.
register Before RenderSearch playground for registerBeforeRender
Registers for this mesh a javascript function called just before the rendering process
Parameters
func: ((mesh: AbstractMesh) => void)
defines the function to call before rendering this mesh
Parameters
mesh: AbstractMesh
Returns void
Returns Mesh
the current mesh
register Instanced BufferSearch playground for registerInstancedBuffer
Register a custom buffer that will be instanced
Parameters
kind: string
defines the buffer kind
stride: number
defines the stride in floats
Returns void
release Sub MeshesSearch playground for releaseSubMeshes
Disposes all the submeshes of the current meshnp
Returns AbstractMesh
the current mesh
remove BehaviorSearch playground for removeBehavior
remove ChildSearch playground for removeChild
Removes the passed mesh from the current mesh children list
Parameters
mesh: AbstractMesh
defines the child mesh
Optional preserveScalingSign: boolean
if true, keep scaling sign of child. Otherwise, scaling sign might change.
Returns AbstractMesh
the current mesh
removeLODLevelSearch playground for removeLODLevel
remove Vertices DataSearch playground for removeVerticesData
Delete a vertex buffer associated with this mesh
Parameters
kind: string
defines which buffer to delete (positions, indices, normals, etc). Possible
kind
values :- VertexBuffer.PositionKind
- VertexBuffer.UVKind
- VertexBuffer.UV2Kind
- VertexBuffer.UV3Kind
- VertexBuffer.UV4Kind
- VertexBuffer.UV5Kind
- VertexBuffer.UV6Kind
- VertexBuffer.ColorKind
- VertexBuffer.MatricesIndicesKind
- VertexBuffer.MatricesIndicesExtraKind
- VertexBuffer.MatricesWeightsKind
- VertexBuffer.MatricesWeightsExtraKind
Returns void
renderSearch playground for render
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
Parameters
subMesh: SubMesh
defines the subMesh to render
enableAlphaMode: boolean
defines if alpha mode can be changed
Optional effectiveMeshReplacement: AbstractMesh
defines an optional mesh used to provide info for the rendering
Returns Mesh
the current mesh
render With Render Pass IdSearch playground for renderWithRenderPassId
Triggers the draw call for the mesh (or a submesh), for a specific render pass id
Parameters
Optional renderPassId: number
defines the render pass id to use to draw the mesh / submesh. If not provided, use the current renderPassId of the engine.
Optional enableAlphaMode: boolean
defines if alpha mode can be changed (default: false)
Optional effectiveMeshReplacement: AbstractMesh
defines an optional mesh used to provide info for the rendering (default: undefined)
Optional subMesh: SubMesh
defines the subMesh to render. If not provided, draw all mesh submeshes (default: undefined)
Optional checkFrustumCulling: boolean
defines if frustum culling must be checked (default: true). If you know the mesh is in the frustum (or if you don't care!), you can pass false to optimize.
Returns LinesMesh
the current mesh
reset Draw CacheSearch playground for resetDrawCache
Resets the draw wrappers cache for all submeshes of this abstract mesh
Parameters
Optional passId: number
If provided, releases only the draw wrapper corresponding to this render pass id
Returns void
reset Local MatrixSearch playground for resetLocalMatrix
Resets this nodeTransform's local matrix to Matrix.Identity().
Parameters
Optional independentOfChildren: boolean
indicates if all child nodeTransform's world-space transform should be preserved.
Returns void
rotateSearch playground for rotate
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 propertyrotation
is set to (0,0,0) and no longer used. The passed axis is also normalized.Parameters
axis: Vector3
the axis to rotate around
amount: number
the amount to rotate in radians
Optional space: Space
Space to rotate in (Default: local)
Returns TransformNode
the TransformNode.
rotate AroundSearch playground for rotateAround
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 propertyrotation
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.htmParameters
point: Vector3
the point to rotate around
axis: Vector3
the axis to rotate around
amount: number
the amount to rotate in radians
Returns TransformNode
the TransformNode
rotatePOVSearch playground for rotatePOV
Perform relative rotation change from the point of view of behind the front of the mesh. Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.
Parameters
flipBack: number
defines the flip
twirlClockwise: number
defines the twirl
tiltRight: number
defines the tilt
Returns AbstractMesh
the current mesh
serializeSearch playground for serialize
Serializes this ground mesh
Parameters
serializationObject: any
object to write serialization to
Returns void
serialize Animation RangesSearch playground for serializeAnimationRanges
Serialize animation ranges into a JSON compatible object
Returns any
serialization object
set Absolute PositionSearch playground for setAbsolutePosition
Sets the mesh absolute position in the World from a Vector3 or an Array(3).
Parameters
absolutePosition: Vector3
the absolute position to set
Returns TransformNode
the TransformNode.
set Bounding InfoSearch playground for setBoundingInfo
Overwrite the current bounding info
Parameters
boundingInfo: BoundingInfo
defines the new bounding info
Returns AbstractMesh
the current mesh
set DirectionSearch playground for setDirection
Sets this transform node rotation to the given local axis.
Parameters
localAxis: Vector3
the axis in local space
Optional yawCor: number
optional yaw (y-axis) correction in radians
Optional pitchCor: number
optional pitch (x-axis) correction in radians
Optional rollCor: number
optional roll (z-axis) correction in radians
Returns TransformNode
this TransformNode
set EnabledSearch playground for setEnabled
Set the enabled state of this node
Parameters
value: boolean
defines the new enabled state
Returns void
set Index BufferSearch playground for setIndexBuffer
Sets the index buffer of this mesh.
Parameters
indexBuffer: DataBuffer
Defines the index buffer to use for this mesh
totalVertices: number
Defines the total number of vertices used by the buffer
totalIndices: number
Defines the total number of indices in the index buffer
Returns void
set IndicesSearch playground for setIndices
Set the index buffer of this mesh
Parameters
indices: IndicesArray
defines the source data
Optional totalVertices: Nullable<number>
defines the total number of vertices referenced by this index data (can be null)
Optional updatable: boolean
defines if the updated index buffer must be flagged as updatable (default is false)
Returns AbstractMesh
the current mesh
set Material ByIDSearch playground for setMaterialByID
Sets the mesh material by the material or multiMaterial
id
propertyParameters
id: string
is a string identifying the material or the multiMaterial
Returns Mesh
the current mesh
set Material By IdSearch playground for setMaterialById
Sets the mesh material by the material or multiMaterial
id
propertyParameters
id: string
is a string identifying the material or the multiMaterial
Returns Mesh
the current mesh
set Material For Render PassSearch playground for setMaterialForRenderPass
Sets the material to be used to render the mesh in a specific render pass
Parameters
renderPassId: number
render pass id
Optional material: Material
material 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)
Returns void
set Normals ForCPUSkinningSearch playground for setNormalsForCPUSkinning
Prepare internal normal array for software CPU skinning
Returns Nullable<Float32Array>
original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.
set ParentSearch playground for setParent
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
Parameters
node: Nullable<Node>
the node ot set as the parent
Optional preserveScalingSign: boolean
if true, keep scaling sign of child. Otherwise, scaling sign might change.
Optional updatePivot: boolean
if true, update the pivot matrix to keep the node in the same space as before
Returns TransformNode
this TransformNode.
set Physics Link WithSearch playground for setPhysicsLinkWith
Creates a physic joint between two meshes
Parameters
otherMesh: Mesh
defines the other mesh to use
pivot1: Vector3
defines the pivot to use on this mesh
pivot2: Vector3
defines the pivot to use on the other mesh
Optional options: any
defines additional options (can be plugin dependent)
Returns AbstractMesh
the current mesh
set Pivot MatrixSearch playground for setPivotMatrix
Sets a new pivot matrix to the current node
Parameters
matrix: DeepImmutableObject<Matrix>
defines the new pivot matrix to use
Optional postMultiplyPivotMatrix: boolean
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
Returns TransformNode
the current TransformNode
set Pivot PointSearch playground for setPivotPoint
Sets a new pivot point to the current node
Parameters
point: Vector3
defines the new pivot point to use
Optional space: Space
defines if the point is in world or local space (local by default)
Returns TransformNode
the current TransformNode
set Position With Local VectorSearch playground for setPositionWithLocalVector
Sets the mesh position in its local space.
Parameters
vector3: Vector3
the position to set in localspace
Returns TransformNode
the TransformNode.
set Positions ForCPUSkinningSearch playground for setPositionsForCPUSkinning
Prepare internal position array for software CPU skinning
Returns Nullable<Float32Array>
original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh
set Pre Transform MatrixSearch playground for setPreTransformMatrix
Sets a new matrix to apply before all other transformation
Parameters
matrix: Matrix
defines the transform matrix
Returns TransformNode
the current TransformNode
set Vertices BufferSearch playground for setVerticesBuffer
Sets the mesh global Vertex Buffer
Parameters
buffer: VertexBuffer
defines the buffer to use
Optional disposeExistingBuffer: boolean
disposes the existing buffer, if any (default: true)
Returns Mesh
the current mesh
set Vertices DataSearch playground for setVerticesData
Copy a FloatArray into a specific associated vertex buffer
Parameters
kind: string
defines which buffer to write to (positions, indices, normals, etc). Possible
kind
values :- VertexBuffer.PositionKind
- VertexBuffer.UVKind
- VertexBuffer.UV2Kind
- VertexBuffer.UV3Kind
- VertexBuffer.UV4Kind
- VertexBuffer.UV5Kind
- VertexBuffer.UV6Kind
- VertexBuffer.ColorKind
- VertexBuffer.MatricesIndicesKind
- VertexBuffer.MatricesIndicesExtraKind
- VertexBuffer.MatricesWeightsKind
- VertexBuffer.MatricesWeightsExtraKind
data: FloatArray
defines the data source
Optional updatable: boolean
defines if the updated vertex buffer must be flagged as updatable
Optional stride: number
defines the data stride size (can be null)
Returns AbstractMesh
the current mesh
simplifySearch playground for simplify
Simplify the mesh according to the given array of settings. Function will return immediately and will simplify async
Parameters
settings: ISimplificationSettings[]
a collection of simplification settings
Optional parallelProcessing: boolean
should all levels calculate parallel or one after the other
Optional simplificationType: QUADRATIC
the type of simplification to run
Optional successCallback: ((mesh?: Mesh, submeshIndex?: number) => void)
optional success callback to be called after the simplification finished processing all settings
Parameters
Optional mesh: Mesh
Optional submeshIndex: number
Returns void
Returns Mesh
the current mesh
subdivideSearch playground for subdivide
This function will subdivide the mesh into multiple submeshes
Parameters
count: number
defines the expected number of submeshes
Returns void
synchronize InstancesSearch playground for synchronizeInstances
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.
Returns Mesh
the current mesh
thin Instance AddSearch playground for thinInstanceAdd
Creates a new thin instance
Parameters
matrix: DeepImmutableObject<Matrix> | DeepImmutableObject<Matrix>[]
the matrix or array of matrices (position, rotation, scale) of the thin instance(s) to create
Optional refresh: boolean
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
Returns number
the thin instance index number. If you pass an array of matrices, other instance indexes are index+1, index+2, etc
thin Instance Add SelfSearch playground for thinInstanceAddSelf
Adds the transformation (matrix) of the current mesh as a thin instance
Parameters
Optional refresh: boolean
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
Returns number
the thin instance index number
thin Instance Buffer UpdatedSearch playground for thinInstanceBufferUpdated
Synchronize the gpu buffers with a thin instance buffer. Call this method if you update later on the buffers passed to thinInstanceSetBuffer
Parameters
kind: string
name of the attribute to update. Use "matrix" to update the buffer of matrices
Returns void
thin Instance Get World MatricesSearch playground for thinInstanceGetWorldMatrices
Gets the list of world matrices
Returns Matrix[]
an array containing all the world matrices from the thin instances
thin Instance Partial Buffer UpdateSearch playground for thinInstancePartialBufferUpdate
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
Parameters
kind: string
name of the attribute to update. Use "matrix" to update the buffer of matrices
data: Float32Array
the data to set in the GPU buffer
offset: number
the offset in the GPU buffer where to update the data
Returns void
thin Instance Refresh Bounding InfoSearch playground for thinInstanceRefreshBoundingInfo
Refreshes the bounding info, taking into account all the thin instances defined
Parameters
Optional forceRefreshParentInfo: boolean
true to force recomputing the mesh bounding info and use it to compute the aggregated bounding info
Optional applySkeleton: boolean
defines whether to apply the skeleton before computing the bounding info
Optional applyMorph: boolean
defines whether to apply the morph target before computing the bounding info
Returns void
thin Instance Register AttributeSearch playground for thinInstanceRegisterAttribute
Registers a custom attribute to be used with thin instances
Parameters
kind: string
name of the attribute
stride: number
size in floats of the attribute
Returns void
thin Instance Set Attribute AtSearch playground for thinInstanceSetAttributeAt
Sets the value of a custom attribute for a thin instance
Parameters
kind: string
name of the attribute
index: number
index of the thin instance
value: number[]
value to set
Optional refresh: boolean
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
Returns void
thin Instance Set BufferSearch playground for thinInstanceSetBuffer
Sets a buffer to be used with thin instances. This method is a faster way to setup multiple instances than calling thinInstanceAdd repeatedly
Parameters
kind: string
name of the attribute. Use "matrix" to setup the buffer of matrices
buffer: Nullable<Float32Array>
buffer to set
Optional stride: number
size in floats of each value of the buffer
Optional staticBuffer: boolean
indicates that the buffer is static, so that you won't change it after it is set (better performances - false by default)
Returns void
thin Instance Set Matrix AtSearch playground for thinInstanceSetMatrixAt
Sets the matrix of a thin instance
Parameters
index: number
index of the thin instance
matrix: DeepImmutableObject<Matrix>
matrix to set
Optional refresh: boolean
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
Returns void
to Left HandedSearch playground for toLeftHanded
Invert the geometry to move from a right handed system to a left handed one.
Returns Mesh
the current mesh
to StringSearch playground for toString
Returns a description of this mesh
Parameters
Optional fullDetails: boolean
define if full details about this mesh must be used
Returns string
a descriptive string representing this mesh
transfer To EffectSearch playground for transferToEffect
Transfer the mesh values to its UBO.
Parameters
world: Matrix
The world matrix associated with the mesh
Returns void
translateSearch playground for translate
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.
Parameters
axis: Vector3
the axis to translate in
distance: number
the distance to translate
Optional space: Space
Space to rotate in (Default: local)
Returns TransformNode
the TransformNode.
unfreeze NormalsSearch playground for unfreezeNormals
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
Returns Mesh
the current mesh
unfreeze World MatrixSearch playground for unfreezeWorldMatrix
Allows back the World matrix computation.
Returns LinesMesh
the TransformNode.
unregister After RenderSearch playground for unregisterAfterRender
Disposes a previously registered javascript function called after the rendering.
Parameters
func: ((mesh: AbstractMesh) => void)
defines the function to remove
Parameters
mesh: AbstractMesh
Returns void
Returns Mesh
the current mesh
unregister After World Matrix UpdateSearch playground for unregisterAfterWorldMatrixUpdate
Removes a registered callback function.
Parameters
func: ((mesh: TransformNode) => void)
callback function to remove
Parameters
mesh: TransformNode
Returns void
Returns TransformNode
the TransformNode.
unregister Before RenderSearch playground for unregisterBeforeRender
Disposes a previously registered javascript function called before the rendering
Parameters
func: ((mesh: AbstractMesh) => void)
defines the function to remove
Parameters
mesh: AbstractMesh
Returns void
Returns Mesh
the current mesh
update Facet DataSearch playground for updateFacetData
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
Returns AbstractMesh
the current mesh
update IndicesSearch playground for updateIndices
Update the current index buffer
Parameters
indices: IndicesArray
defines the source data
Optional offset: number
defines the offset in the index buffer where to store the new data (can be null)
Optional gpuMemoryOnly: boolean
defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)
Returns AbstractMesh
the current mesh
update Mesh PositionsSearch playground for updateMeshPositions
This method updates the vertex positions of an updatable mesh according to the
positionFunction
returned values.Parameters
positionFunction: ((data: FloatArray) => void)
is a simple JS function what is passed the mesh
positions
array. It doesn't need to return anythingParameters
data: FloatArray
Returns void
Optional computeNormals: boolean
is a boolean (default true) to enable/disable the mesh normal recomputation after the vertex position update
Returns Mesh
the current mesh
update Pose MatrixSearch playground for updatePoseMatrix
Copies the parameter passed Matrix into the mesh Pose matrix.
Parameters
matrix: Matrix
the matrix to copy the pose from
Returns TransformNode
this TransformNode.
update Vertices DataSearch playground for updateVerticesData
Update a specific associated vertex buffer
Parameters
kind: string
defines which buffer to write to (positions, indices, normals, etc). Possible
kind
values :- VertexBuffer.PositionKind
- VertexBuffer.UVKind
- VertexBuffer.UV2Kind
- VertexBuffer.UV3Kind
- VertexBuffer.UV4Kind
- VertexBuffer.UV5Kind
- VertexBuffer.UV6Kind
- VertexBuffer.ColorKind
- VertexBuffer.MatricesIndicesKind
- VertexBuffer.MatricesIndicesExtraKind
- VertexBuffer.MatricesWeightsKind
- VertexBuffer.MatricesWeightsExtraKind
data: FloatArray
defines the data source
Optional updateExtends: boolean
defines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind
Optional makeItUnique: boolean
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)
Returns AbstractMesh
the current mesh
validate SkinningSearch playground for validateSkinning
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
Returns { report: string; skinned: boolean; valid: boolean }
a validation object with skinned, valid and report string
report: string
skinned: boolean
valid: boolean
Static Add Node ConstructorSearch playground for AddNodeConstructor
Add a new node constructor
Parameters
type: string
defines the type name of the node to construct
constructorFunc: NodeConstructor
defines the constructor function
Returns void
Static CenterSearch playground for Center
Returns the center of the
{min:
Vector3, max:
Vector3}
or the center of MinMax vector3 computed from a mesh arrayParameters
meshesOrMinMaxVector: AbstractMesh[] | { max: Vector3; min: Vector3 }
could be an array of meshes or a
{min:
Vector3, max:
Vector3}
object
Returns Vector3
a vector3
Static ConstructSearch playground for Construct
Returns a node constructor based on type name
Parameters
type: string
defines the type name
name: string
defines the new node name
scene: Scene
defines the hosting scene
Optional options: any
defines optional options to transmit to constructors
Returns Nullable<(() => Node)>
the new constructor or null
Static Create BoxSearch playground for CreateBox
Creates a box mesh.
Parameters
name: string
defines the name of the mesh to create
size: number
sets the size (float) of each box side (default 1)
scene: Nullable<Scene>
defines the hosting scene
Optional updatable: boolean
defines if the mesh must be flagged as updatable
Optional sideOrientation: number
defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
Returns Mesh
a new Mesh
Static Create CapsuleSearch playground for CreateCapsule
Creates a Capsule Mesh
Parameters
name: string
defines the name of the mesh.
options: ICreateCapsuleOptions
the constructors options used to shape the mesh.
scene: Scene
defines the scene the mesh is scoped to.
Returns Mesh
the capsule mesh
Static Create CylinderSearch playground for CreateCylinder
Creates a cylinder or a cone mesh.
Parameters
name: string
defines the name of the mesh to create
height: number
sets the height size (float) of the cylinder/cone (float, default 2)
diameterTop: number
set the top cap diameter (floats, default 1)
diameterBottom: number
set the bottom cap diameter (floats, default 1). This value can't be zero
tessellation: number
sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance
subdivisions: any
sets the number of rings along the cylinder height (positive integer, default 1)
Optional scene: Scene
defines the hosting scene
Optional updatable: any
defines if the mesh must be flagged as updatable
Optional sideOrientation: number
defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
Returns Mesh
a new Mesh
Static Create Dashed LinesSearch playground for CreateDashedLines
Creates a dashed line mesh.
Parameters
name: string
defines the name of the mesh to create
points: Vector3[]
is an array successive Vector3
dashSize: number
is the size of the dashes relatively the dash number (positive float, default 3)
gapSize: number
is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)
dashNb: number
is the intended total number of dashes (positive integer, default 200)
scene: Nullable<Scene>
defines the hosting scene
Optional updatable: boolean
defines if the mesh must be flagged as updatable
Optional instance: LinesMesh
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)
Returns LinesMesh
a new Mesh
Static Create DecalSearch playground for CreateDecal
Creates a decal mesh. . A decal is a mesh usually applied as a model onto the surface of another mesh
Parameters
name: string
defines the name of the mesh
sourceMesh: AbstractMesh
defines the mesh receiving the decal
position: Vector3
sets the position of the decal in world coordinates
normal: Vector3
sets the normal of the mesh where the decal is applied onto in world coordinates
size: Vector3
sets the decal scaling
angle: number
sets the angle to rotate the decal
Returns Mesh
a new Mesh
Static Create DiscSearch playground for CreateDisc
Creates a plane polygonal mesh. By default, this is a disc.
Parameters
name: string
defines the name of the mesh to create
radius: number
sets the radius size (float) of the polygon (default 0.5)
tessellation: number
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
scene: Nullable<Scene>
defines the hosting scene
Optional updatable: boolean
defines if the mesh must be flagged as updatable
Optional sideOrientation: number
defines the mesh side orientation (https://doc.baby
Line mesh
https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param