@kognifai/cogsengine
    Preparing search index...

    Class LodComponent

    Contains data describing level of detail behavior for the entity the component belongs to. Depending on the policy set, the LodSystem does not necessarily perform any actions on other components of the entity. Some level of detail policies might be implemented in different systems, using the LodComponent instance as control data.

    Hierarchy (View Summary)

    Index

    Constructors

    • Internal: Component constructor

      Parameters

      • type: string

        type of the component. Ex. "TransformComponent"

      • entity: Entity

        Owning entity. Entity only passed when wrapping existing entity.

      Returns LodComponent

    Properties

    geometricTolerance: number

    Geometric tolerance value applied when the lodPolicy field is set to LodPolicy::GeometricTolerance.

    isTyped: boolean

    Internal flag set if component is a Cogs Core component.

    policy: LodPolicy

    The policy used for determining the level of detail for this entity.

    separateHierarchies: boolean

    Enable old-style lod'ing with a completely separate hierarchy for each lod-level.

    thresholds: Float32Array

    Threshold values to switch levels of detail at when the policy in use is distance based (for example LodPolicy::CenterDistance). The thresholds tells the LodSystem at which distances it may switch the visibility of child entities on and off. The number of threshold values should typically equal the number of children - 1. This results in the first child being shown when the distance is less than the first threshold value, then stepping through the children, one per threshold value, finally showing the last child if the distance is greater than the last threshold value.

    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.