@kognifai/cogsengine
    Preparing search index...

    Class AdaptivePlanarGridComponent

    class defining a Cogs component. Defines basic properties of the component - readonly for clients 'type' and 'entity'. All component shares same class definition. The properties for accessing the fields of the component type will be filled in at runtime, e.g. for TransformComponent: getter+setter for: coordinates, position, rotation etc.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cameras: Entity[]

    List of cameras for which frustums will be used to deduce visible geometry, defaults to main camera.

    debugGeometry: boolean

    Enable creation of miscellaneous debug geometry, like the intersected frustum and so on.

    displaceMax: vec3

    Maximum corner of vertex displacement. Forwarded to misc bounding boxes.

    displaceMin: vec3

    Minimum corner of vertex displacement. Forwarded to misc bounding boxes.

    extentMax: dvec2

    Maximum corner of extent to cover.

    extentMin: dvec2

    Minimum corner of extent to cover.

    isTyped: boolean

    Internal flag set if component is a Cogs Core component.

    Layer used to render tiles.

    lodReference: Entity

    Entity to use as center reference to level of detail calculations, defaults to main camera.

    tileResolutionLog2: number

    Internal resolution of each tile in the grid.

    updateLoD: boolean

    Enable/disable updates of level-of-detail hierarchy.

    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.