@kognifai/cogsengine
    Preparing search index...

    Class SeaCurrentsComponent

    Component for displaying surface currents based on the IHO S111 standard. The extension api has functions for reading S111 HDF5 data from file or memory. The values can also be set directly on the component using the component properties if S111 files are unavailable or impractical. As the S111 standard is made for 2D map clients and is assuming a top down orthographic projection, there have been compromises. A fixed screen size for the arrows does not work when perspective projection is used, so this component is using a fixed world size instead. What a reasonable world size for the arrows should be is left to the applications, but for gridded datasets, setting the scale equal to the grid resolution is a reasonable starting point

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    angles: Float32Array

    Compass direction of the current at each position. Assumed to be in degrees, clockwise and with 0=north

    ignorePriorities: boolean

    Ignore priorities and draw all arrows.

    isTyped: boolean

    Internal flag set if component is a Cogs Core component.

    positions: Float32Array

    (Contents: vec2[]) Position of each arrow in this component in world coordinates.

    priorities: Int32Array

    Priority of each arrow. Used to hide arrows to prevent overcrowding.

    priorityLevel: number

    Hide arrows with priority greater than this.

    scale: number

    Fixed scale applied to every arrow, in addition to any scaling for speed. For gridded data setting this equal to the grid resolution should give a reasonable result

    scalingMode: ArrowScalingMode

    How the arrows scale with the speed of the currents.

    speeds: Float32Array

    Speed in knots of the current at each position. (This will define the colour and the size of each arrow.)

    Accessors

    • get entity(): Entity

      Gets the optional owning entity

      Returns Entity

    • set entity(entity: Entity): void

      Internal: set owning entity.

      Parameters

      Returns void

    • get name(): string

      Component name == type. For compatibility

      Returns string

    • get type(): string

      Gets the type of the component. Ex. "TransformComponent", "SceneComponent" etc.

      Returns string

    Methods

    • Internal: Creates a new component of the given type (name). Component is wrapped when adding to an entity.

      Parameters

      • type: string

        Type of the component. Ex. "TransformComponent"

      Returns Component

      Created Cogs.js component.

    • Internal: Creates a new component being wrapped as an existing member of the entity

      Parameters

      • type: string

        Type of the component. Ex. "TransformComponent"

      • entity: Entity

        The owning entity

      Returns Component

      Created Cogs.js component.