Private
_iPrivate
_instance_Private
_mcountPrivate
_sizePrivate
_usePrivate
isStatic
instance_Static
vStatic
vSets the number of instances / clones in x, y and z directions.
Gets Cloner's root - an invisible mesh, the anchor and parent of all generated instances/clones. Transforming this root affects all underlying clones (childs) at once.
Adds an effector to this Cloner and sets the sensitivity (1=full sensitivity, 0=no sensitivity ==ignore effector)
Private
calcPrivate
calcPrivate
calcPrivate
createConverts the Cloner to thin instances, then deletes this Cloner and returns an array of Cloner meshes. The source meshes are cloned, their clones set enabled. To display them use addSelf = true. All cloned source meshes get the new parent with the rootName. Be aware that the original Cloner will be disposed, so Cloner methods will not work anymore. Use the root node and its individual child meshes for further processing.
Optional
addSelf: booleanIf true, adds the source mesh to the matrix. Default false.
Optional
rootName: stringAllow to define the name of the root mesh which will be the parent of cloned source meshes and all thin instances. If empty, Cloner class name will be used for the name.
Converts all Cloner meshes to thin instances from the original meshes, then deletes this Cloner and returns an array of Cloner meshes. Be aware that instances of all those original meshes become disabled as well, so if they are used in other Cloners one may want to use toThin() method instead. If you don't need animations and so on you may convert Cloner to thin instances. It greatly reduces the number of objects iterating in the render loop.
Optional
addSelf: booleanIf true, adds the source mesh to the matrix. Default false.
The array of original meshes: Mesh[]
The MatrixCloner clones and distributes given meshes in 3D space. If more than one mesh is provided, then the corresponding clones will be placed subsequently one after another starting in the x direction followed by y and z direction. The MatrixCloner returns an object with an important property: root. It is an invisible mesh, it's the anchor and parent of all generated clones, its position is the middle position of all generated clones. Transforming this root affects all underlying clones (childs) at once. The given input meshes will be made inactive during construction.
Param: mesh
The array of meshes/cloners to be cloned, meshes will be made inactive after construction.
Param: scene
Babylon scene.
Param: mcount
The number of clones in x,y and z direction. Default { x: 3, y: 3, z: 3 }.
Param: size
The distance from one clon to another in x,y and z direction. Default { x: 2, y: 2, z: 2 }.
Param: useInstances
Flag if clones should be technical "clones" or "instances". Default true.
Param: isPickable
Flag true if Cloner meshes should be pickable. Default false.