class com.babylonhx.mesh.Mesh extends AbstractMesh implements IAnimatable implements IGetSetVerticesData

Available on all platforms

... @author Krtolica Vujadin

Class Fields

static var BACKSIDE:Int

static var CAP_ALL:Int

static var CAP_END:Int

static var CAP_START:Int

static var DEFAULTSIDE:Int

static var DOUBLESIDE:Int

static var FRONTSIDE:Int

static var NO_CAP:Int

static function Center(meshesOrMinMaxVector:Dynamic):Vector3

static function CreateBox(name:String, size:Float, scene:Scene, ?updatable:Bool, ?sideOrientation:Int):Mesh

static function CreateCylinder(name:String, height:Float, diameterTop:Float, diameterBottom:Float, tessellation:Int, subdivisions:Int, scene:Scene, ?updatable:Bool, ?sideOrientation:Int):Mesh

static function CreateDashedLines(name:String, points:Array<Vector3>, dashSize:Float, gapSize:Float, dashNb:Float, scene:Scene, ?updatable:Bool, ?instance:LinesMesh):LinesMesh

static function CreateDecal(name:String, sourceMesh:AbstractMesh, position:Vector3, normal:Vector3, size:Vector3, ?angle:Float):Mesh

static function CreateDisc(name:String, radius:Float, tessellation:Int, scene:Scene, ?updatable:Bool, ?sideOrientation:Int):Mesh

static function CreateGround(name:String, width:Float, height:Float, subdivisions:Int, scene:Scene, ?updatable:Bool):Mesh

static function CreateGroundFromHeightMap(name:String, url:String, width:Float, height:Float, subdivisions:Int, minHeight:Float, maxHeight:Float, scene:Scene, ?updatable:Bool, ?onReady:GroundMesh ->Void):GroundMesh

static function CreateIcoSphere(name:String, options:IcoSphereOptions, scene:Scene):Mesh

static function CreateLathe(name:String, shape:Array<Vector3>, ?radius:Float, ?tessellation:Int, scene:Scene, ?updatable:Bool, ?sideOrientation:Int):Mesh

static function CreateLines(name:String, points:Array<Vector3>, scene:Scene, ?updatable:Bool, ?instance:LinesMesh):LinesMesh

static function CreatePlane(name:String, size:Float, scene:Scene, ?updatable:Bool, ?sideOrientation:Int):Mesh

static function CreatePolyhedron(name:String, options:PolyhedronOptions, scene:Scene):Mesh

static function CreateRibbon(name:String, pathArray:Array<Array<Vector3>>, ?closeArray:Bool, ?closePath:Bool, ?offset:Int, ?scene:Scene, ?updatable:Bool, ?sideOrientation:Int, ?instance:Mesh):Mesh

static function CreateSphere(name:String, segments:Int, diameter:Float, scene:Scene, ?updatable:Bool, ?sideOrientation:Int):Mesh

static function CreateTiledGround(name:String, xmin:Float, zmin:Float, xmax:Float, zmax:Float, subdivisions:Int, precision:Int, scene:Scene, ?updatable:Bool):Mesh

static function CreateTorus(name:String, diameter:Float, thickness:Float, tessellation:Int, scene:Scene, ?updatable:Bool, ?sideOrientation:Int):Mesh

static function CreateTorusKnot(name:String, radius:Float, tube:Float, radialSegments:Int, tubularSegments:Int, p:Int, q:Int, scene:Scene, ?updatable:Bool, ?sideOrientation:Int):Mesh

static function CreateTube(name:String, path:Array<Vector3>, radius:Float, tessellation:Int, radiusFunction:Int ->Float ->Floatcap:Int, scene:Scene, ?updatable:Bool, ?sideOrientation:Int, ?instance:Mesh):Mesh

static function ExtrudeShape(name:String, shape:Array<Vector3>, path:Array<Vector3>, ?scale:Float, ?rotation:Float, ?cap:Int, scene:Scene, ?updatable:Bool, ?sideOrientation:Int, ?extrudedInstance:Mesh):Mesh

static function ExtrudeShapeCustom(name:String, shape:Array<Vector3>, path:Array<Vector3>, scaleFunction:Float ->Float ->FloatrotationFunction:Float ->Float ->Float?ribbonCloseArray:Bool, ?ribbonClosePath:Bool, ?cap:Int, scene:Scene, ?updatable:Bool, ?sideOrientation:Int, ?extrudedInstance:Mesh):Mesh

static function MergeMeshes(meshes:Array<Mesh>, ?disposeSource:Bool, ?allow32BitsIndices:Bool, ?meshSubclass:Mesh):Mesh

Merge the array of meshes into a single mesh for performance reasons.

{Array}

meshes - The vertices source. They should all be of the same material. Entries can empty

{boolean}

disposeSource - When true (default), dispose of the vertices from the source meshes

{boolean}

allow32BitsIndices - When the sum of the vertices > 64k, this must be set to true.

{Mesh}

meshSubclass - When set, vertices inserted into this Mesh. Meshes can then be merged into a Mesh sub-class.

static function MinMax(meshes:Array<AbstractMesh>):BabylonMinMax

Instance Fields

var cap:Int

function new(name:String, scene:Scene, ?parent:Node, ?source:Mesh, ?doNotCloneChildren:Bool):Void

@constructor * @param {string} name - The value used by scene.getMeshByName() to do a lookup. * @param {Scene} scene - The scene to add this mesh to. * @param {Node} parent - The parent of this mesh, if it has one * @param {Mesh} source - An optional Mesh from which geometry is shared, cloned. * @param {boolean} 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.

function _bind(subMesh:SubMesh, effect:Effect, fillMode:Int):Void

function _draw(subMesh:SubMesh, fillMode:Int, ?instancesCount:Int):Void

function _preActivate():Void

function _processRendering(subMesh:SubMesh, effect:Effect, fillMode:Int, batch:_InstancesBatch, hardwareInstancedRendering:Bool, onBeforeDraw:Bool ->Matrix ->Void):Void

function _registerInstanceForRenderId(instance:InstancedMesh, renderId:Int):Void

function _renderWithInstances(subMesh:SubMesh, fillMode:Int, batch:_InstancesBatch, effect:Effect, engine:Engine):Void

function addLODLevel(distance:Float, ?mesh:Mesh):Mesh

Add a mesh as LOD level triggered at the given distance.

{number}

distance - the distance from the center of the object to show this level

{BABYLON.Mesh}

mesh - the mesh to be added as LOD level

returns

{BABYLON.Mesh} this mesh (for chaining)

function applyDisplacementMap(url:String, minHeight:Float, maxHeight:Float, ?onSuccess:Mesh ->Void?invert:Bool):Void

function applyDisplacementMapFromBuffer(buffer:UInt8Array, heightMapWidth:Float, heightMapHeight:Float, minHeight:Float, maxHeight:Float, ?invert:Bool):Void

function applySkeleton(skeleton:Skeleton):Mesh

Update the vertex buffers by applying transformation from the bones

{skeleton}

skeleton to apply

function clone(name:String, ?newParent:Node, ?doNotCloneChildren:Bool):Mesh

function dispose(?doNotRecurse:Bool):Void

function flipFaces(?flipNormals:Bool):Void

function freezeNormals():Void

This function affects parametric shapes on update only: ribbons, tubes, etc. It has no effect at all on other shapes

function getChildren():Array<Node>

function getIndices(?copyWhenShared:Bool):Array<Int>

function getLOD(camera:Camera, ?boundingSphere:BoundingSphere):AbstractMesh

function getLODLevelAtDistance(distance:Float):Mesh

function getTotalIndices():Int

function getVerticesData(kind:String, ?copyWhenShared:Bool):Array<Float>

function isDisposed():Bool

function isInFrustum(frustumPlanes:Array<Plane>):Bool

function isReady():Bool

function optimizeIndices(?successCallback:Mesh ->Void):Void

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.

successCallback

an optional success callback to be called after the optimization finished.

function removeLODLevel(mesh:Mesh):Mesh

Remove a mesh from the LOD array

{BABYLON.Mesh}

mesh - the mesh to be removed.

returns

{BABYLON.Mesh} this mesh (for chaining)

function render(subMesh:SubMesh, enableAlphaMode:Bool):Void

function setIndices(indices:Array<Int>, ?totalVertices:Int):Void

function setNormalsForCPUSkinning():Array<Float>

returns

original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.

function setPositionsForCPUSkinning():Array<Float>

returns

original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.

function setVerticesData(kind:String, data:Array<Float>, ?updatable:Bool, ?stride:Int):Void

function simplify(settings:Array<ISimplificationSettings>, ?parallelProcessing:Bool, ?simplificationType:Int, ?successCallback:Void ->Void):Void

Simplify the mesh according to the given array of settings. Function will return immediately and will simplify async.

settings

a collection of simplification settings.

parallelProcessing

should all levels calculate parallel or one after the other.

type

the type of simplification to run.

successCallback

optional success callback to be called after the simplification finished processing all settings.

function subdivide(count:Int):Void

function unfreezeNormals():Void

This function affects parametric shapes on update only: ribbons, tubes, etc. It has no effect at all on other shapes

function updateMeshPositions(positionFunction:Dynamic, ?computeNormals:Bool):Void

function updateVerticesData(kind:String, data:Array<Float>, ?updateExtends:Bool, ?makeItUnique:Bool):Void

function updateVerticesDataDirectly(kind:String, data:Float32Array, ?offset:Int, ?makeItUnique:Bool):Void