Class InstancedLinesMesh
Hierarchy (View Summary)
- InstancedMesh
- InstancedLinesMesh
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
Parameters
- name: string
- source: LinesMesh
Returns InstancedLinesMesh
Properties
action Manager
Gets or sets the current action manager
alpha Index
Gets or sets the alpha index used to sort transparent meshes
always Select As Active Mesh
True if the mesh must be rendered in any case (this will shortcut the frustum clipping phase)
animations
Gets a list of Animations associated with the node
culling Strategy
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.
custom Mark As Dirty
Allow user to specify custom mechanism for mark as dirty
decal Map
Gets or sets the decal map for this mesh
defined Facing Forward
Gets or sets the orientation for POV movement & rotation
do Not Sync Bounding Info
Gets or sets a boolean indicating that the bounding info does not need to be kept in sync (for performance reason)
edges Color
Defines edge color used when edgesRenderer is enabled
edges Renderer
Gets the edgesRenderer associated with the mesh
edges Width
Defines edge width used when edgesRenderer is enabled
ellipsoid
Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))
ellipsoid Offset
Gets or sets the ellipsoid offset used to impersonate this mesh when using collision engine (default is (0, 0, 0))
enable Pointer Move Events
Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
force Rendering When Occluded
Flag to force rendering the mesh even if occluded
id
Gets or sets the id of the node
ignore Non Uniform Scaling
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 Properties
List of inspectable custom properties (used by the Inspector)
instanced Buffers
Object used to store instanced buffers defined by user
intersection Threshold
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. Initialized with the intersectionThreshold value of the source LinesMesh
is Blocker
Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)
is Near Grabbable
Gets or sets a boolean indicating if the mesh can be grabbed. Default is false. Setting this to true, while using the XR near interaction feature, will trigger a pointer event when the mesh is grabbed. Grabbing means that the controller is using the squeeze or main trigger button to grab the mesh. This is different from nearPickable which only triggers the event when the mesh is touched by the controller
is Near Pickable
Gets or sets a boolean indicating if the mesh can be near picked (touched by the XR controller or hands). Default is false
is Occluded
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 Progress
Flag to check the progress status of the query
is Pickable
Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default value is determined by AbstractMesh.DefaultIsPickable (true unless changed).
metadata
Gets or sets an object used to store user defined information for the node
name
Gets or sets the name of the node
occlusion For Render Pass Id
This number indicates the render pass id used to run the occlusion query. The default value is -1, which means run the occlusion query in all render passes.
occlusion Query Algorithm Type
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 Count
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 Type
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 Observable
Observable fired when an accessibility tag is changed
on After World Matrix Update Observable
An event triggered after the world matrix is updated
on Collide Observable
An event triggered when this mesh collides with another one
on Collision Position Change Observable
An event triggered when the collision's position changes
on Dispose Observable
An event triggered when the mesh is disposed
on Material Changed Observable
An event triggered when material is changed
on Ready
Callback raised when the node is ready to be used
on Rebuild Observable
An event triggered when the mesh is rebuilt.
outline Color
Defines color to use when rendering outline
outline Width
Define width to use when rendering outline
overlay Alpha
Defines alpha to use when rendering overlay
overlay Color
Defines color to use when rendering overlay
physics Body
Gets or sets the physics body associated with this node.
physics Impostor
Gets or sets impostor used for physic simulation
re Integrate Rotation Into Rotation Quaternion
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 Outline
Gets or sets a boolean indicating if the outline must be rendered as well
render Overlay
Gets or sets a boolean indicating if the overlay must be rendered as well
reserved Data Store
For internal use only. Please do not use.
scaling Determinant
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 Box
Gets or sets a boolean indicating if the bounding box must be rendered as well (false by default)
show Sub Meshes Bounding Box
Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default)
state
Gets or sets a string used to store user defined state for the node
sub Meshes
Gets or sets the list of subMeshes
unique Id
Gets or sets the unique id of the node
use Octree For Collisions
Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default)
use Octree For Picking
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 Selection
Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default)
StaticBillboard Use Parent Orientation
Child transform with Billboard flags should or should not apply parent rotation (default if off)
Static ReadonlyCULLINGSTRATEGY_ 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 ReadonlyCULLINGSTRATEGY_ 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 ReadonlyCULLINGSTRATEGY_ 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 ReadonlyCULLINGSTRATEGY_ 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.
StaticDefault Is Pickable
Gets or sets the default value for isPickable for newly created meshes. When set to false, all meshes created after the change will not be pickable by default. Individual meshes can still override this by setting their own isPickable property.
StaticOCCLUSION_ ALGORITHM_ TYPE_ ACCURATE
Use an accurate occlusion algorithm
StaticOCCLUSION_ ALGORITHM_ TYPE_ CONSERVATIVE
Use a conservative occlusion algorithm
StaticOCCLUSION_ TYPE_ NONE
No occlusion
StaticOCCLUSION_ TYPE_ OPTIMISTIC
Occlusion set to optimistic
StaticOCCLUSION_ TYPE_ STRICT
Occlusion set to strict
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
animation Properties Override
-
Gets or sets the animation properties override
Returns Nullable<AnimationPropertiesOverride>
-
Parameters
- value: Nullable<AnimationPropertiesOverride>
Returns void
apply Fog
-
get applyFog(): boolean
Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default)
Returns boolean
-
set applyFog(value: boolean): void
Parameters
- value: boolean
Returns void
baked Vertex Animation Manager
-
Gets or sets the baked vertex animation manager
Returns Nullable<IBakedVertexAnimationManager>
-
Parameters
- value: Nullable<IBakedVertexAnimationManager>
Returns void
behaviors
billboard Mode
-
get billboardMode(): 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 Returns number
-
set billboardMode(value: number): void
Parameters
- value: number
Returns void
check Collisions
-
get checkCollisions(): boolean
Gets or sets a boolean indicating that this mesh can be used in the collision engine
Returns boolean
-
set checkCollisions(collisionEnabled: boolean): void
Parameters
- collisionEnabled: boolean
Returns void
collider
-
Gets Collider object used to compute collisions (not physics)
Returns Nullable<Collider>
collision Group
-
get collisionGroup(): 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
Returns number
-
set collisionGroup(mask: number): void
Parameters
- mask: number
Returns void
collision Mask
-
get collisionMask(): 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
Returns number
-
set collisionMask(mask: number): void
Parameters
- mask: number
Returns void
collision Response
-
get collisionResponse(): 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.
Returns boolean
-
set collisionResponse(response: boolean): void
Parameters
- response: boolean
Returns void
collision Retry Count
-
get collisionRetryCount(): number
number of collision detection tries. Change this value if not all collisions are detected and handled properly
Returns number
-
set collisionRetryCount(retryCount: number): void
Parameters
- retryCount: number
Returns void
compute Bones Using Shaders
-
get computeBonesUsingShaders(): boolean
Gets or sets a boolean indicating that bone animations must be computed by the GPU (true by default)
Returns boolean
-
set computeBonesUsingShaders(value: boolean): void
Parameters
- value: boolean
Returns void
do Not Serialize
-
get doNotSerialize(): boolean
Gets or sets a boolean used to define if the node must be serialized
Returns boolean
-
set doNotSerialize(value: boolean): void
Parameters
- value: boolean
Returns void
enable Distant Picking
-
get enableDistantPicking(): boolean
When enabled, decompose picking matrices for better precision with large values for mesh position and scling
Returns boolean
-
set enableDistantPicking(value: boolean): void
Parameters
- value: boolean
Returns void
facet Depth Sort From
facet Nb
-
get facetNb(): number
Gets the number of facets in the mesh
Returns number
forward
-
The forward direction of that transform in world space.
Returns Vector3
geometry
has Bounding Info
-
get hasBoundingInfo(): boolean
Returns true if there is already a bounding info
Returns boolean
has Instances
-
get hasInstances(): boolean
Gets a boolean indicating if this mesh has instances
Returns boolean
has Thin Instances
-
get hasThinInstances(): boolean
Gets a boolean indicating if this mesh has thin instances
Returns boolean
has Vertex Alpha
-
get hasVertexAlpha(): boolean
Gets or sets a boolean indicating that this mesh needs to use vertex alpha data to render. This property is misnamed and should be
useVertexAlpha. Note that the mesh will be rendered with alpha blending when this flag is set even if vertex alpha data is missing from the geometry.Returns boolean
-
set hasVertexAlpha(value: boolean): void
Parameters
- value: boolean
Returns void
infinite Distance
-
get infiniteDistance(): boolean
Gets or sets the distance of the object to max, often used by skybox
Returns boolean
-
set infiniteDistance(value: boolean): void
Parameters
- value: boolean
Returns void
inherit Visibility
-
get inheritVisibility(): boolean
-
set inheritVisibility(value: boolean): void
Parameters
- value: boolean
Returns void
is Blocked
-
get isBlocked(): boolean
Returns true if the mesh is blocked. Implemented by child classes
Returns boolean
is Facet Data Enabled
-
get isFacetDataEnabled(): boolean
gets a boolean indicating if facetData is enabled
Returns boolean
is Visible
-
get isVisible(): boolean
-
set isVisible(value: boolean): void
Parameters
- value: boolean
Returns void
is World Matrix Frozen
-
get isWorldMatrixFrozen(): boolean
True if the World matrix has been frozen.
Returns boolean
layer Mask
-
get layerMask(): number
Gets or sets the current layer mask (default is 0x0FFFFFFF)
Returns number
-
set layerMask(value: number): void
Parameters
- value: number
Returns void
light Sources
-
Gets the list of lights affecting that mesh
Returns Light[]
material
mesh Blending Tag
-
get meshBlendingTag(): number
The packed mesh-blending tag of the source mesh.
Returns number
-
set meshBlendingTag(value: number): void
Gets or sets the packed mesh-blending tag for this mesh.
Group ID occupies bits 0..5 and radius class occupies bits 6..7. Use PackMeshBlendingTag to construct the value. Group 0 disables blending; valid participating groups are 1..63. Meshes in the same nonzero group are treated as one logical surface and do not blend together. This visual-only property does not alter geometry, collision queries, depth, normals, or shadows.
Parameters
- value: number
Returns void
morph Target Manager
-
Gets or sets the morph target manager
Returns Nullable<MorphTargetManager>
-
Parameters
- value: Nullable<MorphTargetManager>
Returns void
must Depth Sort Facets
-
get mustDepthSortFacets(): 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-materialsReturns boolean
-
set mustDepthSortFacets(sort: boolean): void
Parameters
- sort: boolean
Returns void
non Uniform Scaling
-
get nonUniformScaling(): boolean
True if the scaling property of this object is non uniform eg. (1,2,1)
Returns boolean
num Bone Influencers
-
get numBoneInfluencers(): number
Gets or sets the number of allowed bone influences per vertex (4 by default)
Returns number
-
set numBoneInfluencers(value: number): void
Parameters
- value: number
Returns void
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
Returns void
on Collision Position Change
-
set onCollisionPositionChange(callback: () => void): void
Set a function to call when the collision's position changes
Parameters
- callback: () => void
Returns void
on Dispose
-
set onDispose(callback: () => void): void
Sets a callback that will be raised when the node will be disposed
Parameters
- callback: () => void
Returns void
on Effective Enabled State Changed Observable
-
An event triggered when the effective enabled state of the node changes, i.e. whenever the value returned by isEnabled changes. Unlike onEnabledStateChangedObservable, this fires for changes caused by an ancestor's enabled state as well as this node's own state. The observable is created on first access, so no cost is incurred for nodes that never observe it.
Returns Observable<boolean>
on Enabled State Changed Observable
-
An event triggered when the enabled state of the node changes. This only reflects changes to the node's own enabled flag (as set via setEnabled), not changes inherited from an ancestor. Use onEffectiveEnabledStateChangedObservable to also be notified when an ancestor's enabled state changes the effective enabled state.
Returns Observable<boolean>
parent
-
Gets or sets the parent of the node (without keeping the current position in the scene)
Returns void
partitioning B Box Ratio
-
get partitioningBBoxRatio(): 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
Returns number
-
set partitioningBBoxRatio(ratio: number): void
Parameters
- ratio: number
Returns void
partitioning Subdivisions
-
get partitioningSubdivisions(): number
Gets or set the number (integer) of subdivisions per axis in the partitioning space
Returns number
-
set partitioningSubdivisions(nb: number): void
Parameters
- nb: number
Returns void
pointer Over Disable Mesh Testing
-
get pointerOverDisableMeshTesting(): 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.
Returns boolean
-
set pointerOverDisableMeshTesting(disable: boolean): void
Parameters
- disable: boolean
Returns void
position
raw Bounding Info
-
Parameters
- boundingInfo: Nullable<BoundingInfo>
Returns void
receive Shadows
-
get receiveShadows(): boolean
If the source mesh receives shadows
Returns boolean
-
set receiveShadows(_value: boolean): void
Gets or sets a boolean indicating that this mesh can receive realtime shadows
Parameters
- _value: boolean
Returns void
rendering Group Id
-
get renderingGroupId(): number
Rendering ground id of the source mesh
Returns number
-
set renderingGroupId(value: number): void
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
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>
-
Parameters
- quaternion: Nullable<Quaternion>
Returns void
scaling
skeleton
-
Gets or sets a skeleton to apply skinning transformations
Returns void
source Mesh
-
The source mesh of the instance
Returns Mesh
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[]>
-
Parameters
- meshes: Nullable<AbstractMesh[]>
Returns void
up
-
The up direction of that transform in world space.
Returns Vector3
use Bones
-
get useBones(): boolean
Gets a boolean indicating if this mesh has skinning data and an attached skeleton
Returns boolean
use Vertex Colors
-
get useVertexColors(): 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)
Returns boolean
-
set useVertexColors(value: boolean): void
Parameters
- value: boolean
Returns void
visibility
-
get visibility(): number
Visibility of the source mesh
Returns number
-
set visibility(_value: number): void
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
StaticBILLBOARDMODE_ ALL
-
get BILLBOARDMODE_ALL(): number
Billboard on all axes
Returns number
StaticBILLBOARDMODE_ NONE
-
get BILLBOARDMODE_NONE(): number
No billboard
Returns number
StaticBILLBOARDMODE_ USE_ POSITION
-
get BILLBOARDMODE_USE_POSITION(): number
Billboard on using position instead of orientation
Returns number
StaticBILLBOARDMODE_ X
-
get BILLBOARDMODE_X(): number
Billboard on X axis
Returns number
StaticBILLBOARDMODE_ Y
-
get BILLBOARDMODE_Y(): number
Billboard on Y axis
Returns number
StaticBILLBOARDMODE_ Z
-
get BILLBOARDMODE_Z(): number
Billboard on Z axis
Returns number
Methods
add Behavior
add Child
-
Adds the passed mesh as a child to the current mesh. The node will remain exactly where it is and its position / rotation will be updated accordingly. This method is equivalent to calling setParent().
Parameters
- mesh: TransformNode
defines the child mesh
- preserveScalingSign: boolean = false
if true, keep scaling sign of child. Otherwise, scaling sign might change.
Returns this
the current mesh
- mesh: TransformNode
add Rotation
-
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.
- x: number
align With Normal
apply Angular Impulse
-
Apply a physic angular impulse to the mesh
Parameters
- angularImpulse: Vector3
defines the torque to apply
Returns TransformNode
the current mesh
- angularImpulse: Vector3
apply Impulse
apply Torque
-
Apply a physic torque to the mesh
Parameters
- torque: Vector3
defines the torque to apply
Returns TransformNode
the current mesh
- torque: Vector3
attach To Bone
-
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
- bone: Bone
begin Animation
-
beginAnimation(
name: string,
loop?: boolean,
speedRatio?: number,
onAnimationEnd?: () => void,
): Nullable<Animatable>Will start the animation sequence
Parameters
- name: string
defines the range frames for animation sequence
Optionalloop: booleandefines if the animation should loop (false by default)
OptionalspeedRatio: numberdefines the speed factor in which to run the animation (1 by default)
OptionalonAnimationEnd: () => voiddefines a function to be executed when the animation ended (undefined by default)
Returns Nullable<Animatable>
the object created for this animation. If range does not exist, it will return null
- name: string
build Bounding Info
-
buildBoundingInfo(
minimum: DeepImmutable<Vector3>,
maximum: DeepImmutable<Vector3>,
worldMatrix?: DeepImmutableObject<Matrix>,
): BoundingInfoCreates a new bounding info for the mesh
Parameters
- minimum: DeepImmutable<Vector3>
min vector of the bounding box/sphere
- maximum: DeepImmutable<Vector3>
max vector of the bounding box/sphere
OptionalworldMatrix: DeepImmutableObject<Matrix>defines the new world matrix
Returns BoundingInfo
the new bounding info
- minimum: DeepImmutable<Vector3>
calc Move POV
-
Calculate relative position change from the point of view of behind the front of the mesh. This is performed taking into account the meshes current rotation, so you do not have to care. Supports definition of mesh facing forward or backward definedFacingForwardSearch | See definedFacingForwardSearch.
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
- amountRight: number
calc Rotate POV
-
Calculate relative rotation change from the point of view of behind the front of the mesh. Supports definition of mesh facing forward or backward definedFacingForwardSearch | See definedFacingForwardSearch.
Parameters
- flipBack: number
defines the flip
- twirlClockwise: number
defines the twirl
- tiltRight: number
defines the tilt
Returns Vector3
the new rotation vector
- flipBack: number
clone
-
clone(
name: string,
newParent?: Nullable<Node>,
doNotCloneChildren?: boolean,
newSourceMesh?: Mesh,
): InstancedMeshCreates a new InstancedMesh from the current mesh.
Returns the clone.
Parameters
Returns InstancedMesh
the clone
compute World Matrix
create Animation Range
-
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
- name: string
create Instance
-
Creates a new InstancedMesh object from the mesh model.
Parameters
- name: string
defines the name of the new instance
Returns InstancedMesh
a new InstancedMesh
- name: string
create Normals
-
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
- updatable: boolean
create Or Update Submeshes Octree
-
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
OptionalmaxCapacity: numberdefines the maximum size of each block (64 by default)
OptionalmaxDepth: numberdefines the maximum depth to use (no more than 2 levels by default)
Returns Octree<SubMesh>
the new octree
delete Animation Range
-
Delete a specific animation range
Parameters
- name: string
defines the name of the range to delete
- deleteFrames: boolean = true
defines if animation frames from the range must be deleted as well
Returns void
- name: string
detach From Bone
-
Detach the transform node if its associated with a bone
Parameters
- resetToPreviousParent: boolean = false
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
- resetToPreviousParent: boolean = false
disable Edges Rendering
disable Facet Data
dispose
-
Disposes the InstancedMesh. Returns nothing.
Parameters
OptionaldoNotRecurse: booleanSet to true to not recurse into each children (recurse into each children by default)
- disposeMaterialAndTextures: boolean = false
Set to true to also dispose referenced materials and textures (false by default)
Returns void
enable Edges Rendering
-
enableEdgesRendering(
epsilon?: number,
checkVerticesInsteadOfIndices?: boolean,
): InstancedLinesMeshEnables the edge rendering mode on the mesh. This mode makes the mesh edges visible
Parameters
Optionalepsilon: numberdefines the maximal distance between two angles to detect a face
OptionalcheckVerticesInsteadOfIndices: booleanindicates that we should check vertex list directly instead of faces
Returns InstancedLinesMesh
the current InstancedLinesMesh
freeze World Matrix
-
Prevents the World matrix to be computed any longer. Please note that the "moral" contract is that the world matrix is not going to be updated anymore. It is up to the developer to force updates. You trade flexibility for performance. If you want to update it, you have to unfreeze it first.
Parameters
Returns TransformNode
the TransformNode.
get Absolute Pivot Point
-
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 Ref
-
Sets the Vector3 "result" coordinates with the mesh pivot point World coordinates.
Parameters
- result: Vector3
vector3 to store the result
Returns TransformNode
this TransformNode.
- result: Vector3
get Absolute Position
get Animation By Name
get Animation Range
-
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
- name: string
get Animation Ranges
-
Gets the list of all animation ranges defined on this node
Returns Nullable<AnimationRange>[]
an array
get Behavior By Name
get Bounding Info
-
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, callgetHierarchyBoundingVectorsinstead.Returns BoundingInfo
a BoundingInfo
get Child Meshes
-
getChildMeshes<T extends AbstractMesh>(
directDescendantsOnly?: boolean,
predicate?: (node: Node) => node is T,
): T[]Get all child-meshes of this node
Type Parameters
- T extends AbstractMesh
Parameters
OptionaldirectDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)
Optionalpredicate: (node: Node) => node is Tdefines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Returns T[]
an array of AbstractMesh
-
getChildMeshes(
directDescendantsOnly?: boolean,
predicate?: (node: Node) => boolean,
): AbstractMesh[]Get all child-meshes of this node
Parameters
OptionaldirectDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)
Optionalpredicate: (node: Node) => booleandefines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Returns AbstractMesh[]
an array of AbstractMesh
get Children
-
getChildren<T extends Node>(
predicate?: (node: Node) => node is T,
directDescendantsOnly?: boolean,
): T[]Get all direct children of this node
Type Parameters
- T extends Node
Parameters
Optionalpredicate: (node: Node) => node is Tdefines 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
OptionaldirectDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)
Returns T[]
an array of Node
-
Get all direct children of this node
Parameters
Optionalpredicate: (node: Node) => booleandefines 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
OptionaldirectDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)
Returns Node[]
an array of Node
get Child Transform Nodes
-
getChildTransformNodes(
directDescendantsOnly?: boolean,
predicate?: (node: Node) => boolean,
): TransformNode[]Get all child-transformNodes of this node
Parameters
OptionaldirectDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
Optionalpredicate: (node: Node) => booleandefines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Returns TransformNode[]
an array of TransformNode
get Class Name
-
Returns string
the string "InstancedLinesMesh".
get Closest Facet At Coordinates
-
getClosestFacetAtCoordinates(
x: number,
y: number,
z: number,
projected?: Vector3,
checkFace?: boolean,
facing?: boolean,
): Nullable<number>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
Optionalprojected: Vector3sets as the (x,y,z) world projection on the facet
- checkFace: boolean = false
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
- facing: boolean = true
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)
- x: number
get Closest Facet At Local Coordinates
-
getClosestFacetAtLocalCoordinates(
x: number,
y: number,
z: number,
projected?: Vector3,
checkFace?: boolean,
facing?: boolean,
): Nullable<number>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
Optionalprojected: Vector3sets as the (x,y,z) local projection on the facet
- checkFace: boolean = false
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
- facing: boolean = true
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)
- x: number
get Connected Particle Systems
-
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 Descendants
-
getDescendants<T extends Node>(
directDescendantsOnly?: boolean,
predicate?: (node: Node) => node is T,
): T[]Will return all nodes that have this node as ascendant
Type Parameters
- T extends Node
Parameters
OptionaldirectDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
Optionalpredicate: (node: Node) => node is Tdefines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Returns T[]
all children nodes of all types
-
Will return all nodes that have this node as ascendant
Parameters
OptionaldirectDescendantsOnly: booleandefines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
Optionalpredicate: (node: Node) => booleandefines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
Returns Node[]
all children nodes of all types
get Direction
-
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.
- localAxis: Vector3
get Direction To Ref
-
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.
Returns TransformNode
this TransformNode.
get Distance To Camera
get Engine
get Facet Data Parameters
-
Returns the object "parameter" set with all the expected parameters for facetData computation by ComputeNormals()
Returns any
the parameters
get Facet Local Normals
-
Returns the facetLocalNormals array. The normals are expressed in the mesh local spac
Returns Vector3[]
an array of Vector3
get Facet Local Partitioning
-
Returns the facetLocalPartitioning array
Returns number[][]
an array of array of numbers
get Facet Local Positions
-
Returns the facetLocalPositions array. The facet positions are expressed in the mesh local space
Returns Vector3[]
an array of Vector3
get Facet Normal
-
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
- i: number
get Facet Normal To Ref
-
Sets the reference Vector3 with the i-th facet normal in the world system
Parameters
- i: number
defines the facet index
- ref: Vector3
defines the target vector
Returns InstancedLinesMesh
the current mesh
- i: number
get Facet Position
-
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
- i: number
get Facet Position To Ref
-
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
- i: number
get Facets At Local Coordinates
-
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
- x: number
get Hierarchy Bounding Vectors
-
getHierarchyBoundingVectors(
includeDescendants?: boolean,
predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>,
): { max: Vector3; min: Vector3 }Return the minimum and maximum world vectors of the entire hierarchy under current node
Parameters
- includeDescendants: boolean = true
Include bounding info from descendants as well (true by default)
- predicate: Nullable<(abstractMesh: AbstractMesh) => boolean> = null
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
- includeDescendants: boolean = true
get Indices
-
Returns Nullable<IndicesArray>
an array of indices (IndicesArray).
get LOD
-
Returns the current associated LOD AbstractMesh.
Parameters
- camera: Camera
defines the camera to use to pick the LOD level
Returns AbstractMesh
a Mesh or
nullif no LOD is associated with the AbstractMesh - camera: Camera
get Material For Render Pass
-
Gets the material used to render the mesh in a specific render pass
Parameters
- renderPassId: number
render pass id
Returns Material | undefined
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)
- renderPassId: number
get Mesh Uniform Buffer
get Normals Data
-
Get the normals vertex data and optionally apply skeleton and morphing.
Parameters
- applySkeleton: boolean = false
defines whether to apply the skeleton
- applyMorph: boolean = false
defines whether to apply the morph target
Returns Nullable<FloatArray>
the normals data
- applySkeleton: boolean = false
get Physics Body
-
Returns Nullable<PhysicsBody>
get Physics Impostor
get Pivot Matrix
get Pivot Point
-
Returns a new Vector3 set with the mesh pivot point coordinates in the local space.
Returns Vector3
the pivot point
get Pivot Point To Ref
-
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.
- result: Vector3
get Pose Matrix
get Position Data
-
getPositionData(
applySkeleton?: boolean,
applyMorph?: boolean,
data?: Nullable<FloatArray>,
): Nullable<FloatArray>Get the position vertex data and optionally apply skeleton and morphing.
Parameters
- applySkeleton: boolean = false
defines whether to apply the skeleton
- applyMorph: boolean = false
defines whether to apply the morph target
- data: Nullable<FloatArray> = null
defines the position data to apply the skeleton and morph to
Returns Nullable<FloatArray>
the position data
- applySkeleton: boolean = false
get Position Expressed In Local Space
-
Returns the mesh position in the local space from the current World matrix values.
Returns Vector3
a new Vector3.
get Position In Camera Space
get Raw Bounding Info
-
Returns the bounding info unnafected by instance data.
Returns BoundingInfo
the bounding info of the mesh unaffected by instance data.
get Scene
get Total Indices
-
Returns a positive integer : the total number of indices in this mesh geometry.
Returns number
the number of indices or zero if the mesh has no geometry.
get Total Vertices
-
Returns number
the total number of vertices (integer).
get Vertices Data
-
getVerticesData(
kind: string,
copyWhenShared?: boolean,
forceCopy?: boolean,
): Nullable<FloatArray>Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.
Parameters
- kind: string
kind of verticies to retrieve (eg. positions, normals, uvs, etc.)
OptionalcopyWhenShared: booleanIf true (default false) and and if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one.
OptionalforceCopy: booleandefines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is
Returns Nullable<FloatArray>
a float array or a Float32Array of the requested kind of data : positions, normals, uvs, etc.
- kind: string
instantiate Hierarchy
-
instantiateHierarchy(
newParent?: Nullable<TransformNode>,
options?: {
doNotInstantiate: boolean | ((node: TransformNode) => boolean);
newSourcedMesh?: Mesh;
},
onNewNodeCreated?: (source: TransformNode, clone: TransformNode) => void,
): Nullable<TransformNode>Instantiate (when possible) or clone that node with its hierarchy
Parameters
- newParent: Nullable<TransformNode> = null
defines the new parent to use for the instance (or clone)
Optionaloptions: {
doNotInstantiate: boolean | ((node: TransformNode) => boolean);
newSourcedMesh?: Mesh;
}defines options to configure how copy is done
OptionalonNewNodeCreated: (source: TransformNode, clone: TransformNode) => voiddefines an option callback to call when a clone or an instance is created
Returns Nullable<TransformNode>
an instance (or a clone) of the current node with its hierarchy
- newParent: Nullable<TransformNode> = null
intersects
-
intersects(
ray: Ray,
fastCheck?: boolean,
trianglePredicate?: TrianglePickingPredicate,
onlyBoundingInfo?: boolean,
worldToUse?: Matrix,
skipBoundingInfo?: boolean,
): PickingInfoChecks 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.
OptionalfastCheck: booleandefines if fast mode (but less precise) must be used (false by default)
OptionaltrianglePredicate: TrianglePickingPredicatedefines an optional predicate used to select faces when a mesh intersection is detected
- onlyBoundingInfo: boolean = false
defines a boolean indicating if picking should only happen using bounding info (false by default)
OptionalworldToUse: Matrixdefines the world matrix to use to get the world coordinate of the intersection point
- skipBoundingInfo: boolean = false
a boolean indicating if we should skip the bounding info check
Returns PickingInfo
the picking info
- ray: Ray
intersects Mesh
-
intersectsMesh(
mesh: AbstractMesh | SolidParticle,
precise?: boolean,
includeDescendants?: boolean,
): booleanTrue if the mesh intersects another mesh or a SolidParticle object
Parameters
- mesh: AbstractMesh | SolidParticle
defines a target mesh or SolidParticle to test
- precise: boolean = false
Unless the parameter
preciseis set totruethe intersection is computed according to Axis Aligned Bounding Boxes (AABB), else according to OBB (Oriented BBoxes) OptionalincludeDescendants: booleanCan 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
- mesh: AbstractMesh | SolidParticle
intersects Point
-
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
- point: Vector3
is Completely In Frustum
-
Returns
trueif 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
- frustumPlanes: Plane[]
is Descendant Of
-
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
- ancestor: Node
is Disposed
-
Gets a boolean indicating if the node has been disposed
Returns boolean
true if the node was disposed
is Enabled
-
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
- checkAncestors: boolean = true
indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors
Returns boolean
whether this node (and its parent) is enabled
Remarks
To observe changes to the value returned when calling this with
checkAncestorsset to true (the default, i.e. the effective enabled state), subscribe to onEffectiveEnabledStateChangedObservable. To observe changes to the value returned when calling this withcheckAncestorsset to false (i.e. this node's own enabled state only), subscribe to onEnabledStateChangedObservable. - checkAncestors: boolean = true
is In Frustum
-
Returns
trueif 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
- frustumPlanes: Plane[]
is Ready
-
Is this node ready to be used/rendered
Parameters
- completeCheck: boolean = false
defines if a complete check (including materials and lights) has to be done (false by default)
Returns boolean
is it ready
- completeCheck: boolean = false
is Using Pivot Matrix
-
return true if a pivot has been set
Returns boolean
true if a pivot matrix is used
is Using Post Multiply Pivot Matrix
-
Returns boolean
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.
is Vertices Data Present
-
Boolean : True if the mesh owns the requested kind of data.
Parameters
- kind: string
defines which buffer to check (positions, indices, normals, etc). Possible
kindvalues :- 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 boolean
true if data kind is present
- kind: string
is World Matrix Camera Dependent
-
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 Translate
-
Translates the mesh along the passed Vector3 in its local space.
Parameters
- vector3: Vector3
the distance to translate in localspace
Returns TransformNode
the TransformNode.
- vector3: Vector3
look At
-
lookAt(
targetPoint: Vector3,
yawCor?: number,
pitchCor?: number,
rollCor?: number,
space?: Space,
): TransformNodeOrients 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
- yawCor: number = 0
optional yaw (y-axis) correction in radians
- pitchCor: number = 0
optional pitch (x-axis) correction in radians
- rollCor: number = 0
optional roll (z-axis) correction in radians
- space: Space = Space.LOCAL
the chosen space of the target
Returns TransformNode
the TransformNode.
- targetPoint: Vector3
mark As Dirty
-
Flag the AbstractMesh as dirty (Forcing it to update everything)
Parameters
Optionalproperty: stringif set to "rotation" the objects rotationQuaternion will be set to null
Returns AbstractMesh
this AbstractMesh
move POV
-
Perform relative position change from the point of view of behind the front of the mesh. This is performed taking into account the meshes current rotation, so you do not have to care. Supports definition of mesh facing forward or backward definedFacingForwardSearch | See definedFacingForwardSearch.
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
- amountRight: number
move With Collisions
-
Move the mesh using collision engine
Parameters
- displacement: Vector3
defines the requested displacement vector
- slideOnCollide: boolean = true
If true, the mesh will slide along a collider's surface. If false, it will stop moving at the first collision. (true by default)
Returns AbstractMesh
the current mesh
- displacement: Vector3
normalize To Unit Cube
-
normalizeToUnitCube(
includeDescendants?: boolean,
ignoreRotation?: boolean,
predicate?: Nullable<(node: AbstractMesh) => boolean>,
): AbstractMeshUniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)
Parameters
- includeDescendants: boolean = true
Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false
- ignoreRotation: boolean = false
ignore rotation when computing the scale (ie. object will be axis aligned). Default is false
Optionalpredicate: 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
- includeDescendants: boolean = true
optimize Indices Async
-
Optimize the indices order so that we keep the faces with similar indices together
Returns Promise<AbstractMesh>
the current mesh
register After World Matrix Update
-
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
Returns TransformNode
the TransformNode.
- func: (mesh: TransformNode) => void
release Sub Meshes
-
Disposes all the submeshes of the current mesh
Parameters
- immediate: boolean = false
should dispose the effects immediately or not
Returns AbstractMesh
the current mesh
- immediate: boolean = false
remove Behavior
remove Child
-
Removes the passed mesh from the current mesh children list
Parameters
- mesh: TransformNode
defines the child mesh
- preserveScalingSign: boolean = false
if true, keep scaling sign of child. Otherwise, scaling sign might change.
Returns this
the current mesh
- mesh: TransformNode
reset Draw Cache
-
Resets the draw wrappers cache for all submeshes of this abstract mesh
Parameters
OptionalpassId: numberIf provided, releases only the draw wrapper corresponding to this render pass id
- immediate: boolean = false
If true, the effect will be released immediately, otherwise it will be released at the next frame
Returns void
reset Local Matrix
-
Resets this nodeTransform's local matrix to Matrix.Identity().
Parameters
- independentOfChildren: boolean = true
indicates if all child nodeTransform's world-space transform should be preserved.
Returns void
- independentOfChildren: boolean = true
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
rotationQuaternionis then automatically updated and the propertyrotationis set to (0,0,0) and no longer used. The passed axis is also normalized.Parameters
Returns TransformNode
the TransformNode.
rotate Around
-
Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in world space. Note that the property
rotationQuaternionis then automatically updated and the propertyrotationis 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
Returns TransformNode
the TransformNode
rotate POV
-
Perform relative rotation change from the point of view of behind the front of the mesh. Supports definition of mesh facing forward or backward definedFacingForwardSearch | See definedFacingForwardSearch.
Parameters
- flipBack: number
defines the flip
- twirlClockwise: number
defines the twirl
- tiltRight: number
defines the tilt
Returns AbstractMesh
the current mesh
- flipBack: number
serialize
-
Serializes the objects information.
Parameters
OptionalcurrentSerializationObject: anydefines the object to serialize in
Returns any
the serialized object
serialize Animation Ranges
-
Serialize animation ranges into a JSON compatible object
Returns any
serialization object
set Absolute Position
-
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.
- absolutePosition: Vector3
set Bounding Info
-
Overwrite the current bounding info
Parameters
- boundingInfo: BoundingInfo
defines the new bounding info
Returns AbstractMesh
the current mesh
- boundingInfo: BoundingInfo
set Direction
-
setDirection(
localAxis: Vector3,
yawCor?: number,
pitchCor?: number,
rollCor?: number,
): TransformNodeSets this transform node rotation to the given local axis.
Parameters
- localAxis: Vector3
the axis in local space
- yawCor: number = 0
optional yaw (y-axis) correction in radians
- pitchCor: number = 0
optional pitch (x-axis) correction in radians
- rollCor: number = 0
optional roll (z-axis) correction in radians
Returns TransformNode
this TransformNode
- localAxis: Vector3
set Enabled
-
Set the enabled state of this node
Parameters
- value: boolean
defines the new enabled state
Returns void
- value: boolean
set Indices
-
Sets the mesh indices. Expects an array populated with integers or a typed array (Int32Array, Uint32Array, Uint16Array). If the mesh has no geometry, a new Geometry object is created and set to the mesh. This method creates a new index buffer each call. Returns the Mesh.
Parameters
- indices: IndicesArray
the source data
- totalVertices: Nullable<number> = null
defines the total number of vertices referenced by indices (could be null)
Returns Mesh
source mesh
- indices: IndicesArray
set Material For Render Pass
-
Sets the material to be used to render the mesh in a specific render pass
Parameters
- renderPassId: number
render pass id
Optionalmaterial: Materialmaterial to use for this render pass. If undefined is passed, no specific material will be used for this render pass but the regular material will be used instead (mesh.material)
Returns void
- renderPassId: number
set Parent
-
setParent(
node: Nullable<Node>,
preserveScalingSign?: boolean,
updatePivot?: boolean,
): TransformNodeDefines 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. If you don't want to preserve the current rotation / position, assign the parent through parent accessor. 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
Returns TransformNode
this TransformNode.
set Physics Link With
-
setPhysicsLinkWith(
otherMesh: Mesh,
pivot1: Vector3,
pivot2: Vector3,
options?: any,
): AbstractMesh
set Pivot Matrix
-
Sets a new pivot matrix to the current node
Parameters
- matrix: DeepImmutable<Matrix>
defines the new pivot matrix to use
- postMultiplyPivotMatrix: boolean = true
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
- matrix: DeepImmutable<Matrix>
set Pivot Point
-
Sets a new pivot point to the current node
Parameters
Returns TransformNode
the current TransformNode
set Position With Local Vector
-
Sets the mesh position in its local space.
Parameters
- vector3: Vector3
the position to set in localspace
Returns TransformNode
the TransformNode.
- vector3: Vector3
set Pre Transform Matrix
-
Sets a new matrix to apply before all other transformation
Parameters
- matrix: Matrix
defines the transform matrix
Returns TransformNode
the current TransformNode
- matrix: Matrix
set Vertices Data
-
setVerticesData(
kind: string,
data: FloatArray,
updatable?: boolean,
stride?: number,
): AbstractMeshSets the vertex data of the mesh geometry for the requested
kind. If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data. Thedataare either a numeric array either a Float32Array. The parameterupdatableis passed as is to the underlying Geometry object constructor (if initially none) or updater. The parameterstrideis an optional positive integer, it is usually automatically deducted from thekind(3 for positions or normals, 2 for UV, etc). Note that a new underlying VertexBuffer object is created each call. If thekindis thePositionKind, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.Possible
kindvalues :- 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 the Mesh.
Parameters
- kind: string
defines vertex data kind
- data: FloatArray
defines the data source
Optionalupdatable: booleandefines if the data must be flagged as updatable (false as default)
Optionalstride: numberdefines the vertex stride (optional)
Returns AbstractMesh
the current mesh
to String
-
Gets a string representation of the current mesh
Parameters
OptionalfullDetails: booleandefines a boolean indicating if full details must be included
Returns string
a string representation of the current mesh
transfer To Effect
-
Transfer the mesh values to its UBO.
Parameters
- world: Matrix
The world matrix associated with the mesh
Returns void
- world: Matrix
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
Returns TransformNode
the TransformNode.
unfreeze World Matrix
unregister After World Matrix Update
-
Removes a registered callback function.
Parameters
- func: (mesh: TransformNode) => void
callback function to remove
Returns TransformNode
the TransformNode.
- func: (mesh: TransformNode) => void
update Facet Data
-
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 Indices
-
Updates the AbstractMesh indices array
Parameters
- indices: IndicesArray
defines the data source
Optionaloffset: numberdefines the offset in the index buffer where to store the new data (can be null)
- gpuMemoryOnly: boolean = false
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
- indices: IndicesArray
update Pose Matrix
-
Copies the parameter passed Matrix into the mesh Pose matrix.
Parameters
- matrix: Matrix
the matrix to copy the pose from
Returns TransformNode
this TransformNode.
- matrix: Matrix
update Vertices Data
-
updateVerticesData(
kind: string,
data: FloatArray,
updateExtends?: boolean,
makeItUnique?: boolean,
): MeshUpdates the existing vertex data of the mesh geometry for the requested
kind. If the mesh has no geometry, it is simply returned as it is. Thedataare either a numeric array either a Float32Array. No new underlying VertexBuffer object is created. If thekindis thePositionKindand ifupdateExtendsis true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed. If the parametermakeItUniqueis true, a new global geometry is created from this positions and is set to the mesh.Possible
kindvalues :- 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 the Mesh.
Parameters
- kind: string
defines vertex data kind
- data: FloatArray
defines the data source
OptionalupdateExtends: booleandefines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind
OptionalmakeItUnique: booleandefines it the updated vertex buffer must be flagged as unique (false by default)
Returns Mesh
the source mesh
StaticAdd Node Constructor
-
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
- type: string
Creates an instance based on a source LinesMesh