3D-City Model
    Preparing search index...

    Class Windsock

    A 3D windsock visualization class, extending ModelWrapper, for displaying animated wind direction and speed in the Cesium scene. Dynamically updates its orientation and animation state in response to custom wind events tied to its ID.

    • On instantiation, creates a unique custom event listener (with name ${id}-wind).
    • When wind event is received, updates windsock properties ("Windrichtung (in °)", "Windgeschwindigkeit (in km/h)"), sets physical orientation according to wind direction, and changes animation to match wind speed. Wind direction is visually represented by rotation about the Z axis (compensating for model's axis). Animation is selected based on speed thresholds (animation 0 for low wind, 3 for highest).

    Windsock

    The main Cesium app context.

    Windsock configuration options.

    Unique windsock identifier.

    URL/path to the windsock model (e.g., .glb).

    Position of the windsock.

    Initial rotation matrix for the windsock.

    Model scale vector.

    Minimum pixel size for rendering.

    Cesium DistanceDisplayCondition.

    Additional key-value properties for display/inspection.

    const sock = new Windsock(app, {
    url: 'assets/windsock.glb',
    position: Cartesian3.fromDegrees(8.5, 51.2, 20),
    });

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • app: any
      • __namedParameters: {
            distanceDisplayCondition: any;
            id?: string;
            minimumPixelSize: any;
            position?: Cartesian3;
            properties?: {};
            rotation?: Matrix3;
            scale?: Cartesian3;
            url: any;
        }

      Returns Windsock

    Properties

    _id: any
    animations: any
    app: any
    eventName: string

    The custom event name to listen for wind updates.

    loaded: boolean

    True once model and animations are available.

    model: undefined | Model
    properties: object

    Dictionary of model attributes.

    rotation: Matrix3

    Model rotation matrix (settable with HPR or Matrix3).

    Accessors

    • get distanceDisplayCondition(): any

      Returns any

    • set distanceDisplayCondition(value: any): void

      DistanceDisplayCondition for this model (controls when it is shown).

      Parameters

      • value: any

      Returns void

    • get minimumPixelSize(): any

      Returns any

    • set minimumPixelSize(value: any): void

      Minimum pixel size setting for the Cesium model.

      Parameters

      • value: any

      Returns void

    • get modelMatrix(): undefined | Matrix4

      Returns undefined | Matrix4

    • set modelMatrix(value: undefined | Matrix4): void

      ModelMatrix for model pose (Matrix4).

      Parameters

      • value: undefined | Matrix4

      Returns void

    • get position(): Cartesian3

      3D translation (Cartesian3) of model.

      Returns Cartesian3

    • set position(value: Cartesian3): void

      Parameters

      • value: Cartesian3

      Returns void

    • get scale(): Cartesian3

      Per-axis scaling vector.

      Returns Cartesian3

    • set scale(value: Cartesian3): void

      Parameters

      • value: Cartesian3

      Returns void

    • get url(): string

      Returns string

    • set url(value: string): void

      Update the model's glTF URL, reloading the model if needed.

      Parameters

      • value: string

      Returns void

    Methods

    • Loads (or reloads) the underlying Cesium Model (gltf). Handles removal of any existing instance, assigns properties/animation, and adds to scene. Sets loaded to true once the model and animations are available.

      Returns Promise<void>

    • Plays a model animation, optionally exclusive (removes previous), with loop and multiplier.

      Parameters

      • index: number

        Animation index (0-based).

      • Optionalloop: ModelAnimationLoop = ModelAnimationLoop.REPEAT

        Animation loop mode.

      • Optionalmultiplier: number = 1

        Speed multiplier.

      • Optionalexclusive: boolean = true

        Remove all other animations first.

      Returns void

      If model not loaded or index out of range.