webani - v1.0.0
    Preparing search index...

    A component that creates a 3D cube mesh using 12 triangles (2 per face).

    Extends Component and returns a WebaniMesh with hardcoded triangle geometry and normals for all six cube faces.

    Hierarchy (View Summary)

    Indexable

    • [key: string | number | symbol]: any
    Index

    Constructors

    • Creates an instance of the Component class and initializes it with a RenderedGroupNode. The component's state is constructed dynamically using a constructor function and additional variables.

      Parameters

      • ...vars: unknown[]

        The variable arguments used in the component's objectConstructor.

      Returns CubeComponent

    Properties

    animationSet: AnimationSet

    Animation set used to track and control animations applied to this group.

    Accessors

    Methods

    • Fades in all contained objects over a given duration.

      Parameters

      • duration: number = 1000

        Duration of the animation in milliseconds.

      • keepInitialOpacity: boolean = false

        If true, respects original opacity before fading in.

      • asynchronous: boolean = false

        If true, the animation is asynchronous

      Returns CubeComponent

    • Scales all objects in the group by the given factor.

      Parameters

      • factor: Vector3

        The scale factor on each axis.

      • duration: number = 1000

        Duration of the animation.

      • asynchronous: boolean = false

        If true, the animation is asynchronous.

      • backwards: boolean = false

        If true, the animation plays in reverse.

      Returns CubeComponent

    • A static method that returns a generator function for creating new instances of the Component class. Types are automatically inferred from the objectConstructor

      Type Parameters

      Parameters

      • this: new (...args: unknown[]) => T

      Returns (...vars: Parameters<T["objectConstructor"]>) => T

      A function that can be used to create instances of the Component class with specific parameters.