1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453 |
- import { Observable } from "../Misc/observable";
- import type { IAnimatable } from "../Animations/animatable.interface";
- import type { Nullable, FloatArray, IndicesArray } from "../types";
- import { Camera } from "../Cameras/camera";
- import type { Scene } from "../scene";
- import type { Vector4 } from "../Maths/math.vector";
- import { Matrix, Vector3, Vector2 } from "../Maths/math.vector";
- import type { Color4 } from "../Maths/math.color";
- import { Node } from "../node";
- import { VertexBuffer, Buffer } from "../Buffers/buffer";
- import type { IGetSetVerticesData } from "./mesh.vertexData";
- import { Geometry } from "./geometry";
- import { AbstractMesh } from "./abstractMesh";
- import { SubMesh } from "./subMesh";
- import type { BoundingSphere } from "../Culling/boundingSphere";
- import type { Effect } from "../Materials/effect";
- import { Material } from "../Materials/material";
- import type { Skeleton } from "../Bones/skeleton";
- import { MeshLODLevel } from "./meshLODLevel";
- import type { Path3D } from "../Maths/math.path";
- import type { Plane } from "../Maths/math.plane";
- import type { TransformNode } from "./transformNode";
- import type { GoldbergMesh } from "./goldbergMesh";
- import type { InstancedMesh } from "./instancedMesh";
- import type { IPhysicsEnabledObject, PhysicsImpostor } from "../Physics/v1/physicsImpostor";
- import type { ICreateCapsuleOptions } from "./Builders/capsuleBuilder";
- import type { LinesMesh } from "./linesMesh";
- import type { GroundMesh } from "./groundMesh";
- import type { DataBuffer } from "../Buffers/dataBuffer.js";
- import type { AbstractEngine } from "../Engines/abstractEngine.js";
- /**
- * @internal
- **/
- export declare class _CreationDataStorage {
- closePath?: boolean;
- closeArray?: boolean;
- idx: number[];
- dashSize: number;
- gapSize: number;
- path3D: Path3D;
- pathArray: Vector3[][];
- arc: number;
- radius: number;
- cap: number;
- tessellation: number;
- }
- /**
- * @internal
- **/
- declare class _InstanceDataStorage {
- visibleInstances: any;
- batchCache: _InstancesBatch;
- batchCacheReplacementModeInFrozenMode: _InstancesBatch;
- instancesBufferSize: number;
- instancesBuffer: Nullable<Buffer>;
- instancesPreviousBuffer: Nullable<Buffer>;
- instancesData: Float32Array;
- instancesPreviousData: Float32Array;
- overridenInstanceCount: number;
- isFrozen: boolean;
- forceMatrixUpdates: boolean;
- previousBatch: Nullable<_InstancesBatch>;
- hardwareInstancedRendering: boolean;
- sideOrientation: number;
- manualUpdate: boolean;
- previousManualUpdate: boolean;
- previousRenderId: number;
- masterMeshPreviousWorldMatrix: Nullable<Matrix>;
- }
- /**
- * @internal
- **/
- export declare class _InstancesBatch {
- mustReturn: boolean;
- visibleInstances: Nullable<InstancedMesh[]>[];
- renderSelf: boolean[];
- hardwareInstancedRendering: boolean[];
- }
- /**
- * @internal
- **/
- declare class _ThinInstanceDataStorage {
- instancesCount: number;
- matrixBuffer: Nullable<Buffer>;
- previousMatrixBuffer: Nullable<Buffer>;
- matrixBufferSize: number;
- matrixData: Nullable<Float32Array>;
- previousMatrixData: Nullable<Float32Array>;
- boundingVectors: Array<Vector3>;
- worldMatrices: Nullable<Matrix[]>;
- masterMeshPreviousWorldMatrix: Nullable<Matrix>;
- }
- /**
- * Class used to represent renderable models
- */
- export declare class Mesh extends AbstractMesh implements IGetSetVerticesData {
- /**
- * Mesh side orientation : usually the external or front surface
- */
- static readonly FRONTSIDE = 0;
- /**
- * Mesh side orientation : usually the internal or back surface
- */
- static readonly BACKSIDE = 1;
- /**
- * Mesh side orientation : both internal and external or front and back surfaces
- */
- static readonly DOUBLESIDE = 2;
- /**
- * Mesh side orientation : by default, `FRONTSIDE`
- */
- static readonly DEFAULTSIDE = 0;
- /**
- * Mesh cap setting : no cap
- */
- static readonly NO_CAP = 0;
- /**
- * Mesh cap setting : one cap at the beginning of the mesh
- */
- static readonly CAP_START = 1;
- /**
- * Mesh cap setting : one cap at the end of the mesh
- */
- static readonly CAP_END = 2;
- /**
- * Mesh cap setting : two caps, one at the beginning and one at the end of the mesh
- */
- static readonly CAP_ALL = 3;
- /**
- * Mesh pattern setting : no flip or rotate
- */
- static readonly NO_FLIP = 0;
- /**
- * Mesh pattern setting : flip (reflect in y axis) alternate tiles on each row or column
- */
- static readonly FLIP_TILE = 1;
- /**
- * Mesh pattern setting : rotate (180degs) alternate tiles on each row or column
- */
- static readonly ROTATE_TILE = 2;
- /**
- * Mesh pattern setting : flip (reflect in y axis) all tiles on alternate rows
- */
- static readonly FLIP_ROW = 3;
- /**
- * Mesh pattern setting : rotate (180degs) all tiles on alternate rows
- */
- static readonly ROTATE_ROW = 4;
- /**
- * Mesh pattern setting : flip and rotate alternate tiles on each row or column
- */
- static readonly FLIP_N_ROTATE_TILE = 5;
- /**
- * Mesh pattern setting : rotate pattern and rotate
- */
- static readonly FLIP_N_ROTATE_ROW = 6;
- /**
- * Mesh tile positioning : part tiles same on left/right or top/bottom
- */
- static readonly CENTER = 0;
- /**
- * Mesh tile positioning : part tiles on left
- */
- static readonly LEFT = 1;
- /**
- * Mesh tile positioning : part tiles on right
- */
- static readonly RIGHT = 2;
- /**
- * Mesh tile positioning : part tiles on top
- */
- static readonly TOP = 3;
- /**
- * Mesh tile positioning : part tiles on bottom
- */
- static readonly BOTTOM = 4;
- /**
- * Indicates that the instanced meshes should be sorted from back to front before rendering if their material is transparent
- */
- static INSTANCEDMESH_SORT_TRANSPARENT: boolean;
- /**
- * Gets the default side orientation.
- * @param orientation the orientation to value to attempt to get
- * @returns the default orientation
- * @internal
- */
- static _GetDefaultSideOrientation(orientation?: number): number;
- private _internalMeshDataInfo;
- /**
- * Determines if the LOD levels are intended to be calculated using screen coverage (surface area ratio) instead of distance.
- */
- get useLODScreenCoverage(): boolean;
- set useLODScreenCoverage(value: boolean);
- /**
- * Will notify when the mesh is completely ready, including materials.
- * Observers added to this observable will be removed once triggered
- */
- onMeshReadyObservable: Observable<Mesh>;
- get computeBonesUsingShaders(): boolean;
- set computeBonesUsingShaders(value: boolean);
- /**
- * An event triggered before rendering the mesh
- */
- get onBeforeRenderObservable(): Observable<Mesh>;
- /**
- * An event triggered before binding the mesh
- */
- get onBeforeBindObservable(): Observable<Mesh>;
- /**
- * An event triggered after rendering the mesh
- */
- get onAfterRenderObservable(): Observable<Mesh>;
- /**
- * An event triggeredbetween rendering pass when using separateCullingPass = true
- */
- get onBetweenPassObservable(): Observable<SubMesh>;
- /**
- * An event triggered before drawing the mesh
- */
- get onBeforeDrawObservable(): Observable<Mesh>;
- private _onBeforeDrawObserver;
- /**
- * Sets a callback to call before drawing the mesh. It is recommended to use onBeforeDrawObservable instead
- */
- set onBeforeDraw(callback: () => void);
- get hasInstances(): boolean;
- get hasThinInstances(): boolean;
- /**
- * Gets the delay loading state of the mesh (when delay loading is turned on)
- * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/incrementalLoading
- */
- delayLoadState: number;
- /**
- * 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.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
- */
- instances: InstancedMesh[];
- /**
- * Gets the file containing delay loading data for this mesh
- */
- delayLoadingFile: string;
- /** @internal */
- _binaryInfo: any;
- /**
- * User defined function used to change how LOD level selection is done
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
- */
- onLODLevelSelection: (distance: number, mesh: Mesh, selectedLevel: Nullable<Mesh>) => void;
- /** @internal */
- _creationDataStorage: Nullable<_CreationDataStorage>;
- /** @internal */
- _geometry: Nullable<Geometry>;
- /** @internal */
- _delayInfo: Array<string>;
- /** @internal */
- _delayLoadingFunction: (any: any, mesh: Mesh) => void;
- /**
- * 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)
- */
- get forcedInstanceCount(): number;
- set forcedInstanceCount(count: number);
- /** @internal */
- _instanceDataStorage: _InstanceDataStorage;
- /** @internal */
- _thinInstanceDataStorage: _ThinInstanceDataStorage;
- /** @internal */
- _shouldGenerateFlatShading: boolean;
- /** @internal */
- _originalBuilderSideOrientation: number;
- /**
- * Use this property to change the original side orientation defined at construction time
- */
- overrideMaterialSideOrientation: Nullable<number>;
- /**
- * Use this property to override the Material's fillMode value
- */
- get overrideRenderingFillMode(): Nullable<number>;
- set overrideRenderingFillMode(fillMode: Nullable<number>);
- /**
- * 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.
- */
- ignoreCameraMaxZ: boolean;
- /**
- * Gets the source mesh (the one used to clone this one from)
- */
- get source(): Nullable<Mesh>;
- /**
- * 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
- */
- get cloneMeshMap(): Nullable<{
- [id: string]: Mesh | undefined;
- }>;
- /**
- * Gets or sets a boolean indicating that this mesh does not use index buffer
- */
- get isUnIndexed(): boolean;
- set isUnIndexed(value: boolean);
- /** Gets the array buffer used to store the instanced buffer used for instances' world matrices */
- get worldMatrixInstancedBuffer(): Float32Array;
- /** Gets the array buffer used to store the instanced buffer used for instances' previous world matrices */
- get previousWorldMatrixInstancedBuffer(): Float32Array;
- /** Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual */
- get manualUpdateOfWorldMatrixInstancedBuffer(): boolean;
- set manualUpdateOfWorldMatrixInstancedBuffer(value: boolean);
- /** Gets or sets a boolean indicating that the update of the instance buffer of the world matrices is manual */
- get manualUpdateOfPreviousWorldMatrixInstancedBuffer(): boolean;
- set manualUpdateOfPreviousWorldMatrixInstancedBuffer(value: 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) */
- get forceWorldMatrixInstancedBufferUpdate(): boolean;
- set forceWorldMatrixInstancedBufferUpdate(value: boolean);
- /**
- * @constructor
- * @param name The value used by scene.getMeshByName() to do a lookup.
- * @param scene The scene to add this mesh to.
- * @param parent The parent of this mesh, if it has one
- * @param source An optional Mesh from which geometry is shared, cloned.
- * @param doNotCloneChildren 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.
- * @param clonePhysicsImpostor When cloning, include cloning mesh physics impostor, default True.
- */
- constructor(name: string, scene?: Nullable<Scene>, parent?: Nullable<Node>, source?: Nullable<Mesh>, doNotCloneChildren?: boolean, clonePhysicsImpostor?: boolean);
- instantiateHierarchy(newParent?: Nullable<TransformNode>, options?: {
- doNotInstantiate: boolean | ((node: TransformNode) => boolean);
- }, onNewNodeCreated?: (source: TransformNode, clone: TransformNode) => void): Nullable<TransformNode>;
- /**
- * Gets the class name
- * @returns the string "Mesh".
- */
- getClassName(): string;
- /** @internal */
- get _isMesh(): boolean;
- /**
- * Returns a description of this mesh
- * @param fullDetails define if full details about this mesh must be used
- * @returns a descriptive string representing this mesh
- */
- toString(fullDetails?: boolean): string;
- /** @internal */
- _unBindEffect(): void;
- /**
- * Gets a boolean indicating if this mesh has LOD
- */
- get hasLODLevels(): boolean;
- /**
- * Gets the list of MeshLODLevel associated with the current mesh
- * @returns an array of MeshLODLevel
- */
- getLODLevels(): MeshLODLevel[];
- private _sortLODLevels;
- /**
- * Add a mesh as LOD level triggered at the given distance.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
- * @param distanceOrScreenCoverage Either distance from the center of the object to show this level or the screen coverage if `useScreenCoverage` is set to `true`.
- * If screen coverage, value is a fraction of the screen's total surface, between 0 and 1.
- * Example Playground for distance https://playground.babylonjs.com/#QE7KM#197
- * Example Playground for screen coverage https://playground.babylonjs.com/#QE7KM#196
- * @param mesh The mesh to be added as LOD level (can be null)
- * @returns This mesh (for chaining)
- */
- addLODLevel(distanceOrScreenCoverage: number, mesh: Nullable<Mesh>): Mesh;
- /**
- * Returns the LOD level mesh at the passed distance or null if not found.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
- * @param distance The distance from the center of the object to show this level
- * @returns a Mesh or `null`
- */
- getLODLevelAtDistance(distance: number): Nullable<Mesh>;
- /**
- * Remove a mesh from the LOD array
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
- * @param mesh defines the mesh to be removed
- * @returns This mesh (for chaining)
- */
- removeLODLevel(mesh: Nullable<Mesh>): Mesh;
- /**
- * Returns the registered LOD mesh distant from the parameter `camera` position if any, else returns the current mesh.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/LOD
- * @param camera defines the camera to use to compute distance
- * @param boundingSphere defines a custom bounding sphere to use instead of the one from this mesh
- * @returns This mesh (for chaining)
- */
- getLOD(camera: Camera, boundingSphere?: BoundingSphere): Nullable<AbstractMesh>;
- /**
- * Gets the mesh internal Geometry object
- */
- get geometry(): Nullable<Geometry>;
- /**
- * Returns the total number of vertices within the mesh geometry or zero if the mesh has no geometry.
- * @returns the total number of vertices
- */
- getTotalVertices(): number;
- /**
- * Returns the content of an associated vertex buffer
- * @param kind 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
- * @param copyWhenShared 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
- * @param forceCopy defines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is
- * @param bypassInstanceData 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 a FloatArray or null if the mesh has no geometry or no vertex buffer for this kind.
- */
- getVerticesData(kind: string, copyWhenShared?: boolean, forceCopy?: boolean, bypassInstanceData?: boolean): Nullable<FloatArray>;
- /**
- * Returns the mesh VertexBuffer object from the requested `kind`
- * @param kind 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
- * @param bypassInstanceData 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 a FloatArray or null if the mesh has no vertex buffer for this kind.
- */
- getVertexBuffer(kind: string, bypassInstanceData?: boolean): Nullable<VertexBuffer>;
- /**
- * Tests if a specific vertex buffer is associated with this mesh
- * @param kind 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
- * @param bypassInstanceData 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 a boolean
- */
- isVerticesDataPresent(kind: string, bypassInstanceData?: boolean): boolean;
- /**
- * Returns a boolean defining if the vertex data for the requested `kind` is updatable.
- * @param kind 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
- * @param bypassInstanceData 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 a boolean
- */
- isVertexBufferUpdatable(kind: string, bypassInstanceData?: boolean): boolean;
- /**
- * Returns a string which contains the list of existing `kinds` of Vertex Data associated with this mesh.
- * @param bypassInstanceData 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 an array of strings
- */
- getVerticesDataKinds(bypassInstanceData?: boolean): string[];
- /**
- * Returns a positive integer : the total number of indices in this mesh geometry.
- * @returns the numner of indices or zero if the mesh has no geometry.
- */
- getTotalIndices(): number;
- /**
- * Returns an array of integers or a typed array (Int32Array, Uint32Array, Uint16Array) populated with the mesh indices.
- * @param copyWhenShared 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.
- * @param forceCopy defines a boolean indicating that the returned array must be cloned upon returning it
- * @returns the indices array or an empty array if the mesh has no geometry
- */
- getIndices(copyWhenShared?: boolean, forceCopy?: boolean): Nullable<IndicesArray>;
- get isBlocked(): boolean;
- /**
- * Determine if the current mesh is ready to be rendered
- * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)
- * @param forceInstanceSupport will check if the mesh will be ready when used with instances (false by default)
- * @returns true if all associated assets are ready (material, textures, shaders)
- */
- isReady(completeCheck?: boolean, forceInstanceSupport?: boolean): boolean;
- /**
- * 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.
- */
- get areNormalsFrozen(): boolean;
- /**
- * 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 the current mesh
- */
- freezeNormals(): Mesh;
- /**
- * 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 the current mesh
- */
- unfreezeNormals(): Mesh;
- /**
- * Sets a value overriding the instance count. Only applicable when custom instanced InterleavedVertexBuffer are used rather than InstancedMeshs
- */
- set overridenInstanceCount(count: number);
- /** @internal */
- _preActivate(): Mesh;
- /**
- * @internal
- */
- _preActivateForIntermediateRendering(renderId: number): Mesh;
- /**
- * @internal
- */
- _registerInstanceForRenderId(instance: InstancedMesh, renderId: number): Mesh;
- protected _afterComputeWorldMatrix(): void;
- /** @internal */
- _postActivate(): void;
- /**
- * 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.
- * @param applySkeleton defines whether to apply the skeleton before computing the bounding info
- * @param applyMorph defines whether to apply the morph target before computing the bounding info
- * @returns the current mesh
- */
- refreshBoundingInfo(applySkeleton?: boolean, applyMorph?: boolean): Mesh;
- /**
- * @internal
- */
- _createGlobalSubMesh(force: boolean): Nullable<SubMesh>;
- /**
- * This function will subdivide the mesh into multiple submeshes
- * @param count defines the expected number of submeshes
- */
- subdivide(count: number): void;
- /**
- * Copy a FloatArray into a specific associated vertex buffer
- * @param kind 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
- * @param data defines the data source
- * @param updatable defines if the updated vertex buffer must be flagged as updatable
- * @param stride defines the data stride size (can be null)
- * @returns the current mesh
- */
- setVerticesData(kind: string, data: FloatArray, updatable?: boolean, stride?: number): AbstractMesh;
- /**
- * Delete a vertex buffer associated with this mesh
- * @param kind 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
- */
- removeVerticesData(kind: string): void;
- /**
- * Flags an associated vertex buffer as updatable
- * @param kind 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
- * @param updatable defines if the updated vertex buffer must be flagged as updatable
- */
- markVerticesDataAsUpdatable(kind: string, updatable?: boolean): void;
- /**
- * Sets the mesh global Vertex Buffer
- * @param buffer defines the buffer to use
- * @param disposeExistingBuffer disposes the existing buffer, if any (default: true)
- * @returns the current mesh
- */
- setVerticesBuffer(buffer: VertexBuffer, disposeExistingBuffer?: boolean): Mesh;
- /**
- * Update a specific associated vertex buffer
- * @param kind 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
- * @param data defines the data source
- * @param updateExtends defines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind
- * @param makeItUnique 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 the current mesh
- */
- updateVerticesData(kind: string, data: FloatArray, updateExtends?: boolean, makeItUnique?: boolean): AbstractMesh;
- /**
- * This method updates the vertex positions of an updatable mesh according to the `positionFunction` returned values.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#other-shapes-updatemeshpositions
- * @param positionFunction is a simple JS function what is passed the mesh `positions` array. It doesn't need to return anything
- * @param computeNormals is a boolean (default true) to enable/disable the mesh normal recomputation after the vertex position update
- * @returns the current mesh
- */
- updateMeshPositions(positionFunction: (data: FloatArray) => void, computeNormals?: boolean): Mesh;
- /**
- * Creates a un-shared specific occurence of the geometry for the mesh.
- * @returns the current mesh
- */
- makeGeometryUnique(): Mesh;
- /**
- * Sets the index buffer of this mesh.
- * @param indexBuffer Defines the index buffer to use for this mesh
- * @param totalVertices Defines the total number of vertices used by the buffer
- * @param totalIndices Defines the total number of indices in the index buffer
- */
- setIndexBuffer(indexBuffer: DataBuffer, totalVertices: number, totalIndices: number): void;
- /**
- * Set the index buffer of this mesh
- * @param indices defines the source data
- * @param totalVertices defines the total number of vertices referenced by this index data (can be null)
- * @param updatable defines if the updated index buffer must be flagged as updatable (default is false)
- * @returns the current mesh
- */
- setIndices(indices: IndicesArray, totalVertices?: Nullable<number>, updatable?: boolean): AbstractMesh;
- /**
- * Update the current index buffer
- * @param indices defines the source data
- * @param offset defines the offset in the index buffer where to store the new data (can be null)
- * @param gpuMemoryOnly defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)
- * @returns the current mesh
- */
- updateIndices(indices: IndicesArray, offset?: number, gpuMemoryOnly?: boolean): AbstractMesh;
- /**
- * Invert the geometry to move from a right handed system to a left handed one.
- * @returns the current mesh
- */
- toLeftHanded(): Mesh;
- /**
- * @internal
- */
- _bind(subMesh: SubMesh, effect: Effect, fillMode: number, allowInstancedRendering?: boolean): Mesh;
- /**
- * @internal
- */
- _draw(subMesh: SubMesh, fillMode: number, instancesCount?: number): Mesh;
- /**
- * Registers for this mesh a javascript function called just before the rendering process
- * @param func defines the function to call before rendering this mesh
- * @returns the current mesh
- */
- registerBeforeRender(func: (mesh: AbstractMesh) => void): Mesh;
- /**
- * Disposes a previously registered javascript function called before the rendering
- * @param func defines the function to remove
- * @returns the current mesh
- */
- unregisterBeforeRender(func: (mesh: AbstractMesh) => void): Mesh;
- /**
- * Registers for this mesh a javascript function called just after the rendering is complete
- * @param func defines the function to call after rendering this mesh
- * @returns the current mesh
- */
- registerAfterRender(func: (mesh: AbstractMesh) => void): Mesh;
- /**
- * Disposes a previously registered javascript function called after the rendering.
- * @param func defines the function to remove
- * @returns the current mesh
- */
- unregisterAfterRender(func: (mesh: AbstractMesh) => void): Mesh;
- /**
- * @internal
- */
- _getInstancesRenderList(subMeshId: number, isReplacementMode?: boolean): _InstancesBatch;
- /**
- * @internal
- */
- _renderWithInstances(subMesh: SubMesh, fillMode: number, batch: _InstancesBatch, effect: Effect, engine: AbstractEngine): Mesh;
- /**
- * @internal
- */
- _renderWithThinInstances(subMesh: SubMesh, fillMode: number, effect: Effect, engine: AbstractEngine): void;
- /**
- * @internal
- */
- _processInstancedBuffers(visibleInstances: Nullable<InstancedMesh[]>, renderSelf: boolean): void;
- /**
- * @internal
- */
- _processRendering(renderingMesh: AbstractMesh, subMesh: SubMesh, effect: Effect, fillMode: number, batch: _InstancesBatch, hardwareInstancedRendering: boolean, onBeforeDraw: (isInstance: boolean, world: Matrix, effectiveMaterial?: Material) => void, effectiveMaterial?: Material): Mesh;
- /**
- * @internal
- */
- _rebuild(dispose?: boolean): void;
- /** @internal */
- _freeze(): void;
- /** @internal */
- _unFreeze(): void;
- /**
- * Triggers the draw call for the mesh (or a submesh), for a specific render pass id
- * @param renderPassId defines the render pass id to use to draw the mesh / submesh. If not provided, use the current renderPassId of the engine.
- * @param enableAlphaMode defines if alpha mode can be changed (default: false)
- * @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering (default: undefined)
- * @param subMesh defines the subMesh to render. If not provided, draw all mesh submeshes (default: undefined)
- * @param checkFrustumCulling 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 the current mesh
- */
- renderWithRenderPassId(renderPassId?: number, enableAlphaMode?: boolean, effectiveMeshReplacement?: AbstractMesh, subMesh?: SubMesh, checkFrustumCulling?: boolean): this;
- /**
- * 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
- * @param subMesh defines the subMesh to render
- * @param enableAlphaMode defines if alpha mode can be changed
- * @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering
- * @returns the current mesh
- */
- render(subMesh: SubMesh, enableAlphaMode: boolean, effectiveMeshReplacement?: AbstractMesh): Mesh;
- private _onBeforeDraw;
- /**
- * 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.
- */
- cleanMatrixWeights(): void;
- private _normalizeSkinFourWeights;
- private _normalizeSkinWeightsAndExtra;
- /**
- * 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 a validation object with skinned, valid and report string
- */
- validateSkinning(): {
- skinned: boolean;
- valid: boolean;
- report: string;
- };
- /** @internal */
- _checkDelayState(): Mesh;
- private _queueLoad;
- /**
- * Returns `true` if the mesh is within the frustum defined by the passed array of planes.
- * A mesh is in the frustum if its bounding box intersects the frustum
- * @param frustumPlanes defines the frustum to test
- * @returns true if the mesh is in the frustum planes
- */
- isInFrustum(frustumPlanes: Plane[]): boolean;
- /**
- * Sets the mesh material by the material or multiMaterial `id` property
- * @param id is a string identifying the material or the multiMaterial
- * @returns the current mesh
- */
- setMaterialById(id: string): Mesh;
- /**
- * Returns as a new array populated with the mesh material and/or skeleton, if any.
- * @returns an array of IAnimatable
- */
- getAnimatables(): IAnimatable[];
- /**
- * 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.
- * @param transform defines the transform matrix to use
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/bakingTransforms
- * @returns the current mesh
- */
- bakeTransformIntoVertices(transform: Matrix): Mesh;
- /**
- * 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.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/bakingTransforms
- * @param bakeIndependentlyOfChildren indicates whether to preserve all child nodes' World Matrix during baking
- * @returns the current mesh
- */
- bakeCurrentTransformIntoVertices(bakeIndependentlyOfChildren?: boolean): Mesh;
- /** @internal */
- get _positions(): Nullable<Vector3[]>;
- /** @internal */
- _resetPointsArrayCache(): Mesh;
- /** @internal */
- _generatePointsArray(): boolean;
- /**
- * Returns a new Mesh object generated from the current mesh properties.
- * This method must not get confused with createInstance()
- * @param name is a string, the name given to the new mesh
- * @param newParent can be any Node object (default `null`)
- * @param doNotCloneChildren allows/denies the recursive cloning of the original mesh children if any (default `false`)
- * @param clonePhysicsImpostor allows/denies the cloning in the same time of the original mesh `body` used by the physics engine, if any (default `true`)
- * @returns a new mesh
- */
- clone(name?: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean, clonePhysicsImpostor?: boolean): Mesh;
- /**
- * Releases resources associated with this mesh.
- * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
- * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
- */
- dispose(doNotRecurse?: boolean, disposeMaterialAndTextures?: boolean): void;
- /** @internal */
- _disposeInstanceSpecificData(): void;
- /** @internal */
- _disposeThinInstanceSpecificData(): void;
- /**
- * 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.
- * @param url is a string, the URL from the image file is to be downloaded.
- * @param minHeight is the lower limit of the displacement.
- * @param maxHeight is the upper limit of the displacement.
- * @param onSuccess is an optional Javascript function to be called just after the mesh is modified. It is passed the modified mesh and must return nothing.
- * @param uvOffset is an optional vector2 used to offset UV.
- * @param uvScale is an optional vector2 used to scale UV.
- * @param forceUpdate defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
- * @param onError defines a callback called when an error occurs during the processing of the request.
- * @returns the Mesh.
- */
- applyDisplacementMap(url: string, minHeight: number, maxHeight: number, onSuccess?: (mesh: Mesh) => void, uvOffset?: Vector2, uvScale?: Vector2, forceUpdate?: boolean, onError?: (message?: string, exception?: any) => void): Mesh;
- /**
- * Modifies the mesh geometry according to a displacementMap buffer.
- * A displacement map is a colored image. Each pixel color value (actually a gradient computed from red, green, blue values) will give the displacement to apply to each mesh vertex.
- * The mesh must be set as updatable. Its internal geometry is directly modified, no new buffer are allocated.
- * @param buffer is a `Uint8Array` buffer containing series of `Uint8` lower than 255, the red, green, blue and alpha values of each successive pixel.
- * @param heightMapWidth is the width of the buffer image.
- * @param heightMapHeight is the height of the buffer image.
- * @param minHeight is the lower limit of the displacement.
- * @param maxHeight is the upper limit of the displacement.
- * @param uvOffset is an optional vector2 used to offset UV.
- * @param uvScale is an optional vector2 used to scale UV.
- * @param forceUpdate defines whether or not to force an update of the generated buffers. This is useful to apply on a deserialized model for instance.
- * @returns the Mesh.
- */
- applyDisplacementMapFromBuffer(buffer: Uint8Array, heightMapWidth: number, heightMapHeight: number, minHeight: number, maxHeight: number, uvOffset?: Vector2, uvScale?: Vector2, forceUpdate?: boolean): Mesh;
- private _getFlattenedNormals;
- private _convertToUnIndexedMesh;
- /**
- * 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 current mesh
- */
- convertToFlatShadedMesh(): Mesh;
- /**
- * This method removes all the mesh indices and add new vertices (duplication) in order to unfold facets into buffers.
- * In other words, more vertices, no more indices and a single bigger VBO.
- * The mesh is really modified even if not set originally as updatable. Under the hood, a new VertexBuffer is allocated.
- * @returns current mesh
- */
- convertToUnIndexedMesh(): Mesh;
- /**
- * 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.
- * @param flipNormals will also inverts the normals
- * @returns current mesh
- */
- flipFaces(flipNormals?: boolean): Mesh;
- /**
- * 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.
- * @param numberPerEdge the number of new vertices to add to each edge of a facet, optional default 1
- */
- increaseVertices(numberPerEdge?: number): void;
- /**
- * 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.
- */
- forceSharedVertices(): void;
- /**
- * @internal
- */
- static _instancedMeshFactory(name: string, mesh: Mesh): InstancedMesh;
- /**
- * @internal
- */
- static _PhysicsImpostorParser(scene: Scene, physicObject: IPhysicsEnabledObject, jsonObject: any): PhysicsImpostor;
- /**
- * Creates a new InstancedMesh object from the mesh model.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
- * @param name defines the name of the new instance
- * @returns a new InstancedMesh
- */
- createInstance(name: string): InstancedMesh;
- /**
- * 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 the current mesh
- */
- synchronizeInstances(): Mesh;
- /**
- * Optimization of the mesh's indices, in case a mesh has duplicated vertices.
- * The function will only reorder the indices and will not remove unused vertices to avoid problems with submeshes.
- * This should be used together with the simplification to avoid disappearing triangles.
- * @param successCallback an optional success callback to be called after the optimization finished.
- * @returns the current mesh
- */
- optimizeIndices(successCallback?: (mesh?: Mesh) => void): Mesh;
- /**
- * Serialize current mesh
- * @param serializationObject defines the object which will receive the serialization data
- * @returns the serialized object
- */
- serialize(serializationObject?: any): any;
- /** @internal */
- _syncGeometryWithMorphTargetManager(): void;
- /**
- * @internal
- */
- static _GroundMeshParser: (parsedMesh: any, scene: Scene) => Mesh;
- /**
- * @internal
- */
- static _GoldbergMeshParser: (parsedMesh: any, scene: Scene) => GoldbergMesh;
- /**
- * @internal
- */
- static _LinesMeshParser: (parsedMesh: any, scene: Scene) => Mesh;
- /**
- * @internal
- */
- static _GreasedLineMeshParser: (parsedMesh: any, scene: Scene) => Mesh;
- /**
- * @internal
- */
- static _GreasedLineRibbonMeshParser: (parsedMesh: any, scene: Scene) => Mesh;
- /**
- * @internal
- */
- static _TrailMeshParser: (parsedMesh: any, scene: Scene) => Mesh;
- /**
- * Returns a new Mesh object parsed from the source provided.
- * @param parsedMesh is the source
- * @param scene defines the hosting scene
- * @param rootUrl is the root URL to prefix the `delayLoadingFile` property with
- * @returns a new Mesh
- */
- static Parse(parsedMesh: any, scene: Scene, rootUrl: string): Mesh;
- /**
- * Prepare internal position array for software CPU skinning
- * @returns original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh
- */
- setPositionsForCPUSkinning(): Nullable<Float32Array>;
- /**
- * Prepare internal normal array for software CPU skinning
- * @returns original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.
- */
- setNormalsForCPUSkinning(): Nullable<Float32Array>;
- /**
- * Updates the vertex buffer by applying transformation from the bones
- * @param skeleton defines the skeleton to apply to current mesh
- * @returns the current mesh
- */
- applySkeleton(skeleton: Skeleton): Mesh;
- /**
- * Returns an object containing a min and max Vector3 which are the minimum and maximum vectors of each mesh bounding box from the passed array, in the world coordinates
- * @param meshes defines the list of meshes to scan
- * @returns an object `{min:` Vector3`, max:` Vector3`}`
- */
- static MinMax(meshes: AbstractMesh[]): {
- min: Vector3;
- max: Vector3;
- };
- /**
- * Returns the center of the `{min:` Vector3`, max:` Vector3`}` or the center of MinMax vector3 computed from a mesh array
- * @param meshesOrMinMaxVector could be an array of meshes or a `{min:` Vector3`, max:` Vector3`}` object
- * @returns a vector3
- */
- static Center(meshesOrMinMaxVector: {
- min: Vector3;
- max: Vector3;
- } | AbstractMesh[]): Vector3;
- /**
- * Merge the array of meshes into a single mesh for performance reasons.
- * @param meshes array of meshes with the vertices to merge. Entries cannot be empty meshes.
- * @param disposeSource when true (default), dispose of the vertices from the source meshes.
- * @param allow32BitsIndices when the sum of the vertices > 64k, this must be set to true.
- * @param meshSubclass (optional) can be set to a Mesh where the merged vertices will be inserted.
- * @param subdivideWithSubMeshes when true (false default), subdivide mesh into subMeshes.
- * @param multiMultiMaterials when true (false default), subdivide mesh into subMeshes with multiple materials, ignores subdivideWithSubMeshes.
- * @returns a new mesh
- */
- static MergeMeshes(meshes: Array<Mesh>, disposeSource?: boolean, allow32BitsIndices?: boolean, meshSubclass?: Mesh, subdivideWithSubMeshes?: boolean, multiMultiMaterials?: boolean): Nullable<Mesh>;
- /**
- * Merge the array of meshes into a single mesh for performance reasons.
- * @param meshes array of meshes with the vertices to merge. Entries cannot be empty meshes.
- * @param disposeSource when true (default), dispose of the vertices from the source meshes.
- * @param allow32BitsIndices when the sum of the vertices > 64k, this must be set to true.
- * @param meshSubclass (optional) can be set to a Mesh where the merged vertices will be inserted.
- * @param subdivideWithSubMeshes when true (false default), subdivide mesh into subMeshes.
- * @param multiMultiMaterials when true (false default), subdivide mesh into subMeshes with multiple materials, ignores subdivideWithSubMeshes.
- * @returns a new mesh
- */
- static MergeMeshesAsync(meshes: Array<Mesh>, disposeSource?: boolean, allow32BitsIndices?: boolean, meshSubclass?: Mesh, subdivideWithSubMeshes?: boolean, multiMultiMaterials?: boolean): Promise<any>;
- private static _MergeMeshesCoroutine;
- /**
- * @internal
- */
- addInstance(instance: InstancedMesh): void;
- /**
- * @internal
- */
- removeInstance(instance: InstancedMesh): void;
- /** @internal */
- _shouldConvertRHS(): boolean;
- /** @internal */
- _getRenderingFillMode(fillMode: number): number;
- /**
- * Sets the mesh material by the material or multiMaterial `id` property
- * @param id is a string identifying the material or the multiMaterial
- * @returns the current mesh
- * @deprecated Please use MeshBuilder instead Please use setMaterialById instead
- */
- setMaterialByID(id: string): Mesh;
- /**
- * Creates a ribbon mesh.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
- * @param name defines the name of the mesh to create
- * @param pathArray is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry.
- * @param closeArray creates a seam between the first and the last paths of the path array (default is false)
- * @param closePath creates a seam between the first and the last points of each path of the path array
- * @param offset is taken in account only if the `pathArray` is containing a single path
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @param instance defines an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#ribbon)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateRibbon(name: string, pathArray: Vector3[][], closeArray: boolean, closePath: boolean, offset: number, scene?: Scene, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh;
- /**
- * Creates a plane polygonal mesh. By default, this is a disc.
- * @param name defines the name of the mesh to create
- * @param radius sets the radius size (float) of the polygon (default 0.5)
- * @param tessellation 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
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateDisc(name: string, radius: number, tessellation: number, scene: Nullable<Scene>, updatable?: boolean, sideOrientation?: number): Mesh;
- /**
- * Creates a box mesh.
- * @param name defines the name of the mesh to create
- * @param size sets the size (float) of each box side (default 1)
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateBox(name: string, size: number, scene: Nullable<Scene>, updatable?: boolean, sideOrientation?: number): Mesh;
- /**
- * Creates a sphere mesh.
- * @param name defines the name of the mesh to create
- * @param segments sets the sphere number of horizontal stripes (positive integer, default 32)
- * @param diameter sets the diameter size (float) of the sphere (default 1)
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateSphere(name: string, segments: number, diameter: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
- /**
- * Creates a hemisphere mesh.
- * @param name defines the name of the mesh to create
- * @param segments sets the sphere number of horizontal stripes (positive integer, default 32)
- * @param diameter sets the diameter size (float) of the sphere (default 1)
- * @param scene defines the hosting scene
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateHemisphere(name: string, segments: number, diameter: number, scene?: Scene): Mesh;
- /**
- * Creates a cylinder or a cone mesh.
- * @param name defines the name of the mesh to create
- * @param height sets the height size (float) of the cylinder/cone (float, default 2)
- * @param diameterTop set the top cap diameter (floats, default 1)
- * @param diameterBottom set the bottom cap diameter (floats, default 1). This value can't be zero
- * @param tessellation sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance
- * @param subdivisions sets the number of rings along the cylinder height (positive integer, default 1)
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateCylinder(name: string, height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions: any, scene?: Scene, updatable?: any, sideOrientation?: number): Mesh;
- /**
- * Creates a torus mesh.
- * @param name defines the name of the mesh to create
- * @param diameter sets the diameter size (float) of the torus (default 1)
- * @param thickness sets the diameter size of the tube of the torus (float, default 0.5)
- * @param tessellation sets the number of torus sides (positive integer, default 16)
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateTorus(name: string, diameter: number, thickness: number, tessellation: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
- /**
- * Creates a torus knot mesh.
- * @param name defines the name of the mesh to create
- * @param radius sets the global radius size (float) of the torus knot (default 2)
- * @param tube sets the diameter size of the tube of the torus (float, default 0.5)
- * @param radialSegments sets the number of sides on each tube segments (positive integer, default 32)
- * @param tubularSegments sets the number of tubes to decompose the knot into (positive integer, default 32)
- * @param p the number of windings on X axis (positive integers, default 2)
- * @param q the number of windings on Y axis (positive integers, default 3)
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateTorusKnot(name: string, radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
- /**
- * Creates a line mesh..
- * @param name defines the name of the mesh to create
- * @param points is an array successive Vector3
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param instance 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 a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateLines(name: string, points: Vector3[], scene: Nullable<Scene>, updatable: boolean, instance?: Nullable<LinesMesh>): LinesMesh;
- /**
- * Creates a dashed line mesh.
- * @param name defines the name of the mesh to create
- * @param points is an array successive Vector3
- * @param dashSize is the size of the dashes relatively the dash number (positive float, default 3)
- * @param gapSize is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)
- * @param dashNb is the intended total number of dashes (positive integer, default 200)
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param instance 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 a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateDashedLines(name: string, points: Vector3[], dashSize: number, gapSize: number, dashNb: number, scene: Nullable<Scene>, updatable?: boolean, instance?: LinesMesh): LinesMesh;
- /**
- * Creates a polygon mesh.Please consider using the same method from the MeshBuilder class instead
- * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh.
- * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors.
- * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
- * Remember you can only change the shape positions, not their number when updating a polygon.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#non-regular-polygon
- * @param name defines the name of the mesh to create
- * @param shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors
- * @param scene defines the hosting scene
- * @param holes is a required array of arrays of successive Vector3 used to defines holes in the polygon
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @param earcutInjection can be used to inject your own earcut reference
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreatePolygon(name: string, shape: Vector3[], scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number, earcutInjection?: any): Mesh;
- /**
- * Creates an extruded polygon mesh, with depth in the Y direction..
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-non-regular-polygon
- * @param name defines the name of the mesh to create
- * @param shape is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors
- * @param depth defines the height of extrusion
- * @param scene defines the hosting scene
- * @param holes is a required array of arrays of successive Vector3 used to defines holes in the polygon
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @param earcutInjection can be used to inject your own earcut reference
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static ExtrudePolygon(name: string, shape: Vector3[], depth: number, scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number, earcutInjection?: any): Mesh;
- /**
- * Creates an extruded shape mesh.
- * The extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes
- * @param name defines the name of the mesh to create
- * @param shape is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis
- * @param path is a required array of successive Vector3. This is the axis curve the shape is extruded along
- * @param scale is the value to scale the shape
- * @param rotation is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve
- * @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @param instance is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#extruded-shape)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static ExtrudeShape(name: string, shape: Vector3[], path: Vector3[], scale: number, rotation: number, cap: number, scene: Nullable<Scene>, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh;
- /**
- * Creates an custom extruded shape mesh.
- * The custom extrusion is a parametric shape.
- * It has no predefined shape. Its final shape will depend on the input parameters.
- *
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes
- * @param name defines the name of the mesh to create
- * @param shape is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis
- * @param path is a required array of successive Vector3. This is the axis curve the shape is extruded along
- * @param scaleFunction is a custom Javascript function called on each path point
- * @param rotationFunction is a custom Javascript function called on each path point
- * @param ribbonCloseArray forces the extrusion underlying ribbon to close all the paths in its `pathArray`
- * @param ribbonClosePath forces the extrusion underlying ribbon to close its `pathArray`
- * @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @param instance is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters (https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#extruded-shape)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static ExtrudeShapeCustom(name: string, shape: Vector3[], path: Vector3[], scaleFunction: Nullable<{
- (i: number, distance: number): number;
- }>, rotationFunction: Nullable<{
- (i: number, distance: number): number;
- }>, ribbonCloseArray: boolean, ribbonClosePath: boolean, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh;
- /**
- * Creates lathe mesh.
- * The lathe is a shape with a symmetry axis : a 2D model shape is rotated around this axis to design the lathe.
- * @param name defines the name of the mesh to create
- * @param shape is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero
- * @param radius is the radius value of the lathe
- * @param tessellation is the side number of the lathe.
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateLathe(name: string, shape: Vector3[], radius: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
- /**
- * Creates a plane mesh.
- * @param name defines the name of the mesh to create
- * @param size sets the size (float) of both sides of the plane at once (default 1)
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreatePlane(name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
- /**
- * Creates a ground mesh.
- * @param name defines the name of the mesh to create
- * @param width set the width of the ground
- * @param height set the height of the ground
- * @param subdivisions sets the number of subdivisions per side
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateGround(name: string, width: number, height: number, subdivisions: number, scene?: Scene, updatable?: boolean): Mesh;
- /**
- * Creates a tiled ground mesh.
- * @param name defines the name of the mesh to create
- * @param xmin set the ground minimum X coordinate
- * @param zmin set the ground minimum Y coordinate
- * @param xmax set the ground maximum X coordinate
- * @param zmax set the ground maximum Z coordinate
- * @param subdivisions is an object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile
- * @param precision is an object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the numbers of subdivisions on the ground width and height of each tile
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateTiledGround(name: string, xmin: number, zmin: number, xmax: number, zmax: number, subdivisions: {
- w: number;
- h: number;
- }, precision: {
- w: number;
- h: number;
- }, scene: Scene, updatable?: boolean): Mesh;
- /**
- * Creates a ground mesh from a height map.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/height_map
- * @param name defines the name of the mesh to create
- * @param url sets the URL of the height map image resource
- * @param width set the ground width size
- * @param height set the ground height size
- * @param subdivisions sets the number of subdivision per side
- * @param minHeight is the minimum altitude on the ground
- * @param maxHeight is the maximum altitude on the ground
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param onReady is a callback function that will be called once the mesh is built (the height map download can last some time)
- * @param alphaFilter will filter any data where the alpha channel is below this value, defaults 0 (all data visible)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateGroundFromHeightMap(name: string, url: string, width: number, height: number, subdivisions: number, minHeight: number, maxHeight: number, scene: Scene, updatable?: boolean, onReady?: (mesh: GroundMesh) => void, alphaFilter?: number): GroundMesh;
- /**
- * Creates a tube mesh.
- * The tube is a parametric shape.
- * It has no predefined shape. Its final shape will depend on the input parameters.
- *
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
- * @param name defines the name of the mesh to create
- * @param path is a required array of successive Vector3. It is the curve used as the axis of the tube
- * @param radius sets the tube radius size
- * @param tessellation is the number of sides on the tubular surface
- * @param radiusFunction is a custom function. If it is not null, it overrides the parameter `radius`. This function is called on each point of the tube path and is passed the index `i` of the i-th point and the distance of this point from the first point of the path
- * @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
- * @param scene defines the hosting scene
- * @param updatable defines if the mesh must be flagged as updatable
- * @param sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)
- * @param instance is an instance of an existing Tube object to be updated with the passed `pathArray` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#tube)
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateTube(name: string, path: Vector3[], radius: number, tessellation: number, radiusFunction: {
- (i: number, distance: number): number;
- }, cap: number, scene: Scene, updatable?: boolean, sideOrientation?: number, instance?: Mesh): Mesh;
- /**
- * Creates a polyhedron mesh.
- *.
- * * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embedded types. Please refer to the type sheet in the tutorial to choose the wanted type
- * * The parameter `size` (positive float, default 1) sets the polygon size
- * * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value)
- * * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overwrittes the parameter `type`
- * * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron
- * * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`)
- * * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
- * * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored
- * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
- * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
- * @param name defines the name of the mesh to create
- * @param options defines the options used to create the mesh
- * @param scene defines the hosting scene
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreatePolyhedron(name: string, options: {
- type?: number;
- size?: number;
- sizeX?: number;
- sizeY?: number;
- sizeZ?: number;
- custom?: any;
- faceUV?: Vector4[];
- faceColors?: Color4[];
- updatable?: boolean;
- sideOrientation?: number;
- }, scene: Scene): Mesh;
- /**
- * Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided
- * * The parameter `radius` sets the radius size (float) of the icosphere (default 1)
- * * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value than `radius`)
- * * The parameter `subdivisions` sets the number of subdivisions (positive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size
- * * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface
- * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
- * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra#icosphere
- * @param name defines the name of the mesh
- * @param options defines the options used to create the mesh
- * @param scene defines the hosting scene
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateIcoSphere(name: string, options: {
- radius?: number;
- flat?: boolean;
- subdivisions?: number;
- sideOrientation?: number;
- updatable?: boolean;
- }, scene: Scene): Mesh;
- /**
- * Creates a decal mesh.
- *.
- * A decal is a mesh usually applied as a model onto the surface of another mesh
- * @param name defines the name of the mesh
- * @param sourceMesh defines the mesh receiving the decal
- * @param position sets the position of the decal in world coordinates
- * @param normal sets the normal of the mesh where the decal is applied onto in world coordinates
- * @param size sets the decal scaling
- * @param angle sets the angle to rotate the decal
- * @returns a new Mesh
- * @deprecated Please use MeshBuilder instead
- */
- static CreateDecal(name: string, sourceMesh: AbstractMesh, position: Vector3, normal: Vector3, size: Vector3, angle: number): Mesh;
- /** Creates a Capsule Mesh
- * @param name defines the name of the mesh.
- * @param options the constructors options used to shape the mesh.
- * @param scene defines the scene the mesh is scoped to.
- * @returns the capsule mesh
- * @see https://doc.babylonjs.com/how_to/capsule_shape
- * @deprecated Please use MeshBuilder instead
- */
- static CreateCapsule(name: string, options: ICreateCapsuleOptions, scene: Scene): Mesh;
- /**
- * Extends a mesh to a Goldberg mesh
- * Warning the mesh to convert MUST be an import of a perviously exported Goldberg mesh
- * @param mesh the mesh to convert
- * @returns the extended mesh
- * @deprecated Please use ExtendMeshToGoldberg instead
- */
- static ExtendToGoldberg(mesh: Mesh): Mesh;
- }
- export {};
|