bp-cloner
    Preparing search index...

    Class RadialCloner

    The RadialCloner distributes given meshes in a radial manner. If more than one meshes are provided, then the clones will be placed alternatively. Several parameters controls the position, angle, type and orientation of the clones.

    mesh to clone

    all optional: count, offset, radius, startangle, endangle, useInstances, plane

    The number of instances/clones. Default 3.

    The radius in world units. Default 3.

    Flag if clones are aligned against the middle position of the cloner. Default true

    The angle in degrees. Default 0.

    The angle in degrees. Default 360.

    The angle in degrees.

    Flag if clones should be technical "clones" or "instances". Default true = instances.

    The object {x,y,z} describing the cloners orientation. Default { x: 1, y: 0, z: 1 }.

    Flag true if Cloner meshes should be pickable. Default false.

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • mesh: Mesh[]
      • scene: Scene
      • __namedParameters: {
            align?: boolean;
            count?: number;
            endangle?: number;
            isPickable?: boolean;
            offset?: number;
            plane?: { x: number; y: number; z: number };
            radius?: number;
            startangle?: number;
            useInstances?: boolean;
        } = {}

      Returns RadialCloner

    Properties

    _clones: CMesh[]
    _count: undefined | number
    _effectors: IEffector[] = []
    _frame: number
    _index: number
    _mesh: Mesh[] = []
    _rootNode: null | Mesh = null
    _scene: Scene
    instance_nr: number
    vOne: Vector3 = ...
    vZero: Vector3 = ...

    Accessors

    • get root(): null | Mesh

      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.

      Returns null | Mesh

    Methods

    • set the cloner's root node to the state of the flag (true=enabled)

      Parameters

      • enabled: boolean

      Returns void

    • Returns an array of matrices (scaling, rotation, position) of the Cloner meshes.

      Returns Matrix[]

    • Converts 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.

      Parameters

      • OptionaladdSelf: boolean

        If true, adds the source mesh to the matrix. Default false.

      • OptionalrootName: string

        Allow 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.

      Returns Mesh[]

    • 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.

      Parameters

      • OptionaladdSelf: boolean

        If true, adds the source mesh to the matrix. Default false.

      Returns Mesh[]

      The array of original meshes: Mesh[]