window.kaolin
    Preparing search index...

    Class TrackballCameraController

    Base for class-based camera controllers: tracks viewport dimensions and binds to the event canvas. Subclasses own the native camera and its conversion.

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Writes a single option value and notifies the subclass of the change.

      The value is stored on this.options, then updateForOptions(name, value) is called so the subclass can react. this.options is lazily initialized to an empty object on first write.

      When a z.ZodObject static schema is declared and the key is part of it, the value is checked against that field's schema. Validation is currently soft: an invalid value logs a warning but is still written through (this may be tightened in a future release). Keys absent from the schema, and behaviors without a Zod schema, are written through unchanged.

      Parameters

      • name: string

        Option key to write.

      • value: any

        Value to store under name.

      Returns void

    • Resets internal behavior state. Default is a no-op for subclasses with no transient state to clear.

      Parameters

      • Optionaloptions: any

        Optional options snapshot to reset against.

      Returns void

    • Hook invoked after every setOption write, receiving the option name that changed and its new value. Default is a no-op; override in subclasses that need to react to option changes (re-render, recompute derived state, etc.). The arguments are advisory — many subclasses simply re-read this.options and ignore them.

      Parameters

      • Optional_name: string
      • Optional_value: any

      Returns void

    Properties

    description: string

    Optional human-readable description, surfaced in generated docs/UI.

    element: HTMLElement
    width: number = 0
    height: number = 0
    schema: ZodObject<
        {
            up: ZodDefault<ZodArray<ZodNumber>>;
            enableRotate: ZodDefault<ZodBoolean>;
            enablePan: ZodDefault<ZodBoolean>;
            enableZoom: ZodDefault<ZodBoolean>;
            rotateSpeed: ZodDefault<ZodNumber>;
            zoomSpeed: ZodDefault<ZodNumber>;
            panSpeed: ZodDefault<ZodNumber>;
        },
        $strip,
    > = TrackballCameraControllerOptionsSchema

    Optional schema describing this behavior's option surface. Declared on the subclass as static schema = {...} as const. When present, it drives the build-time manifest dumper that surfaces the option set (with defaults and types) to Python for automatic UI generation. A z.ZodObject schema is additionally consulted by setOption to warn about invalid writes.

    options: {
        up: number[];
        enableRotate: boolean;
        enablePan: boolean;
        enableZoom: boolean;
        rotateSpeed: number;
        zoomSpeed: number;
        panSpeed: number;
    }

    Subclass option dictionary ({ optionName: value }). Typed as any here so the base class can read/write generically; subclasses narrow it.

    camera: Camera
    controls: TrackballControls