@kognifai/cogsengine
    Preparing search index...

    Class TeleportNavigationComponent

    Base class for components implementing dynamic behavior.

    Consider using Cogs Control Event "preRender" instead. Any updates to Cogs called from custom Dynamic Component will cause a second rendering. If called from Event "preRender" callback the update is in place Before the frame is rendered.

    Inherit this class to create JavaScript custom components that are added to a Cogs Entity. The dynamic component acts as a non-virtual base for components not designed to be managed by a component system, but implementing behavior in member functions callable by the DynamicComponentSystem that owns all dynamic component instances. Member names assumed to handle Cogs messages: "initialize", "update", "postUpdate", "cleanup", "gpuPicking(number,vec3)".

    See documentation for Dynamic components methods details.

    class MyDynamicComponent extends Cogs.DynamicComponent {
    constructor() {
    // Pass name, of component to DynamicComponent constructor.
    super('MyDynamicComponent');
    }

    // Called by Cogs for component initialization when added to entity
    public initialize = () => console.log('Called: initialize');

    // Called by Cogs on each render pass
    public update = () => console.log('Called: update');
    }

    // Use component:
    const cube = runtime.Cube.create();
    cube.components.add(new MyDynamicComponent());

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    actionTeleport: string
    aimEntity: Entity
    beamOffset: vec3
    beamRotation: quat
    isTyped: boolean

    Internal flag set if component is a Cogs Core component.

    teleportOffset: vec3
    useCoordinate: boolean

    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.