@kognifai/cogsengine
    Preparing search index...

    Class OrbitingCameraController

    Component that calculates position and orientation of the entity TransformComponent. Normally added to a Camera entity to handle camera rotate and zoom. Will handle input events moving the (camera) transformation based on the input events (mouse & touch). When using this controller, avoid changing TransformComponent fields as changed values will be replaced next time this component is modified. Insted calculate new rotations, distance and target field values of this component.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cameraLook: vec3

    camera looking direction. Updated when navigating the camers.

    cameraTarget: dvec3

    Camera target. Define centre of camera rotation.

    distance: number

    Distance from camera target to camera.

    enabled: boolean

    Navigation is only active when this flag is set.

    horizontalAngle: number

    Current camera angle in horizontal direction [-TwoPI,+TwoPI] (glm::roll(transformComponent->rotation))

    isTyped: boolean

    Internal flag set if component is a Cogs Core component.

    maxDistance: number

    Maximal distance from camera position to camera target (zoom).

    maxFOV: number

    Maximal field of view.

    maxVerticalAngle: number

    Maximum camera angle in vertical direction [-PI,+PI].

    minDistance: number

    Minimal distance from camera position to camera target (zoom).

    minFOV: number

    Minimal field of view.

    minVerticalAngle: number

    Minimum camera angle in vertical direction [-PI,+PI].

    moveCamera: boolean

    Set to false to disable controller moving the camera and only apply rotate and zoom. Useful for viewing 360 images.

    seek: boolean

    Deprecated Seeking flag - not used.

    verticalAngle: number

    Current camera angle in vertical direction [-PI,+PI] (glm::pitch(transformComponent->rotation))

    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.