3D-City Model
    Preparing search index...

    ModelWrapper – Encapsulates a 3D glTF model (Cesium.Model) for placement, animation, and property management in a Cesium scene.

    Provides API for positioning, rotation, scaling, model property/appearance settings, live updates, and animation control. Connects a model's lifecycle to a parent Cesium app/viewer and fully supports pooled reuse and property-driven UI.

    Application or Cesium Viewer reference.

    Unique identifier for this model.

    glTF or model URL.

    Model world position.

    3D model rotation (as Matrix3).

    Uniform or per-axis scaling.

    Auto-resize threshold (optional).

    Visibility range (optional).

    Arbitrary user or model metadata.

    computeModelMatrix() - Build the internal model transformation (Matrix4) from position/rotation/scale.

    loadModel() - Loads or reloads the underlying Cesium.Model, adds to scene, and sets properties.

    playAnimation(index, [loop], [multiplier], [exclusive]) - Play a model animation by index.

    prepareDescription() - Prepares a Cesium infoBox table description from .properties.

    const wrapper = new ModelWrapper(app, { url: 'model.gltf', position: Cesium.Cartesian3.fromDegrees(8, 50, 10) });
    wrapper.scale = new Cesium.Cartesian3(2, 2, 2);
    await wrapper.loadModel();
    wrapper.playAnimation(0, Cesium.ModelAnimationLoop.REPEAT);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _id: any
    animations: any
    app: any
    loaded: boolean

    True once model and animations are available.

    model: undefined | Model

    Accessors

    Methods

    • Computes the 4x4 Cesium model matrix from position, rotation (as Matrix3), and scale. Used for initializing or updating the Cesium Model.

      Returns Matrix4

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

    • Prepares the infoBox HTML description for the Cesium Model based on this.properties.

      Returns void