Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NgxCameraComponent

The Camera component.

See the ngx3js docs page for details. See the ngx camera page for a live demo.

Three Type Type Key Acceptable Input
OrthographicCamera OrthographicCamera, Orthographic left, right, top, bottom, near, far
PerspectiveCamera PerspectiveCamera, Perspective fov, aspect , near, far
NgxPingPongCamera PingPong, CubePingPong, CubePingPongCamera, PingPongCamera near, far
ArrayCamera ArrayCamera, Array
StereoCamera StereoCamera, Stereo
CubeCamera CubeCamera, Cube near, far
<ngx3js-camera
[type]="'perspective'" [fov]="45" [near]="0.1" [far]="200"
></ngx3js-camera>
<ngx3js-camera
[type]="'OrthographicCamera'" [orthoSize]="500" [fov]="45 "
[near]="1" [far]="1000"
></ngx3js-camera>
<ngx3js-camera
[type]="'cube'" [fov]="40" [near]="1" [far]="1000"
></ngx3js-camera>
<ngx3js-camera
[type]="'CubePingPong'" [near]="1" [far]="1000"
></ngx3js-camera>
<ngx3js-camera
[type]="'Cinematic'" [fov]="60" [near]="1" [far]="1000"
></ngx3js-camera>
see

THREE.Camera

Hierarchy

Implements

  • OnInit

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Protected OBJECT3D_ATTR

OBJECT3D_ATTR: string[] = ...

Object3 d attr of abstract object3d component

Protected OBJECT_ATTR

OBJECT_ATTR: string[] = ...

Object attr of abstract subscribe component

Protected _changeList

_changeList: string[] = null

Change list of abstract subscribe component

Protected _needUpdate

_needUpdate: boolean = true

Need update of abstract subscribe component

active

active: boolean = true

The camera is active.

aspect

aspect: number = 1

Camera frustum aspect ratio, usually the canvas width / canvas height. Default is 1 (square canvas).

autoClear

autoClear: boolean = null

Defines whether the renderer should automatically clear its output before rendering a frame.

autoRotate

autoRotate: boolean = null

The autoRotate of camera component

bottom

bottom: number = null

Camera frustum bottom plane.

Protected cachedGeometryList

cachedGeometryList: NgxAbstractGeometryComponent[] = []

Protected cachedLookatList

cachedLookatList: NgxLookatComponent[] = []

Protected cachedMaterialList

cachedMaterialList: NgxAbstractMaterialComponent[] = []

Protected cachedPositionList

cachedPositionList: NgxPositionComponent[] = []

Protected cachedRotationList

cachedRotationList: NgxRotationComponent[] = []

Protected cachedScaleList

cachedScaleList: NgxScaleComponent[] = []

castShadow

castShadow: boolean = null

Whether the object gets rendered into shadow map. Default is false.

clear

clear: boolean = null

Tells the renderer to clear its color, depth or stencil drawing buffer(s). This method initializes the color buffer to the current clear color value. Arguments default to true.

clearAlpha

clearAlpha: number = null

The clearAlpha of camera component

clearColor

clearColor: INgxColor = null

Clear the color buffer. Equivalent to calling .clear( true, false, false ).

clearDepth

clearDepth: boolean = null

Clear the depth buffer. Equivalent to calling .clear( false, true, false ).

controlType

controlType: string = 'none'

The controlType of camera component

Notice - case insensitive.

Protected controllerList

controllerList: QueryList<NgxAbstractControllerComponent>

Content children of abstract object3d component

debug

debug: boolean = false

Debug this Object

enabled

enabled: boolean = true

Enabled or Not

far

far: string | number = null

Camera frustum far plane. Default is 2000. Must be greater than the current value of Camera.near plane.

focalLength

focalLength: number = null

Sets the FOV by focal length in respect to the current .filmGauge. By default, the focal length is specified for a 35mm (full frame) camera.

fov

fov: string | number = 50

Camera frustum vertical field of view, from bottom to top of view, in degrees. Default is 50.

frustumCulled

frustumCulled: boolean = null

When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to false the object gets rendered every frame even if it is not in the frustum of the camera. Default is true.

geometry

geometry: any = null

The geometry of mesh

Protected geometryList

geometryList: QueryList<NgxAbstractGeometryComponent>

Content children of mesh component

height

height: string | number = '100%'

The size of height

  • type number fixed size
  • type string with include % relative size from renderer size for example in case renderer = 1024 '100%' = 1024, '50%' = 512, '50%-10' = 502, '50%+30' = 542
  • type string const refer width,height,x,y,

Protected id

id: string = ''

The Id of abstract subscribe component

left

left: number = null

Camera frustum left plane.

material

The material of mesh

materialIsArray

materialIsArray: boolean = null

The material of mesh is array

Protected materialList

materialList: QueryList<NgxAbstractMaterialComponent>

Content children of abstract object3d component

matrixAutoUpdate

matrixAutoUpdate: boolean = null

When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. Default is Object3D.DefaultMatrixAutoUpdate (true).

name

name: string = ''

The name of the object (doesn't need to be unique). Default is an empty string.

near

near: string | number = null

Camera frustum near plane. Default is 0.1. The valid range is between 0 and the current value of the Camera.far plane. Note that, unlike for the PerspectiveCamera, 0 is a valid value for an OrthographicCamera's near plane.

Protected object3d

object3d: I3JS.Object3D<Event> = null

The Object3d of abstract object3d component

Protected object3dList

object3dList: QueryList<NgxAbstractObject3dComponent>

Content children of abstract object3d component

onDestory

onDestory: EventEmitter<NgxCameraComponent> = ...

Will be called when before destory. The argument will be the loaded self

onLoad

onLoad: EventEmitter<NgxCameraComponent> = ...

Will be called when load completes. The argument will be the loaded self

orthoSize

orthoSize: number = 400

The orthoSize of camera component

overrideParams

overrideParams: {} = null

The override params

Type declaration

  • [key: string]: any

Protected parent

parent: any = null

The Parent of abstract subscribe component

Protected parentObject3d

parentObject3d: I3JS.Object3D<Event> = null

Parent object3d of abstract object3d component

receiveShadow

receiveShadow: boolean = null

Whether the material receives shadows. Default is false.

referObject3d

The referObject3d of camera component

right

right: number = null

Camera frustum right plane.

scene

scene: any = null

The given scene

scenes

scenes: any[] = null

The given scene

scissorHeight

scissorHeight: string | number = '100%'

A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded. Vector4.height

scissorTest

scissorTest: boolean = false

Indicates whether the scissor test is active or not.

scissorWidth

scissorWidth: string | number = '100%'

A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded. Vector4.width

scissorX

scissorX: string | number = 0

A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded. Vector4.x

scissorY

scissorY: string | number = 0

A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded. Vector4.y

Protected selfAny

selfAny: any = ...

storageName

storageName: string = null

The storageName of camera

Protected subscribeType

subscribeType: string = null

Subscribe type of abstract subscribe component

top

top: number = null

Camera frustum top plane.

tween

tween: {} = null

Tween animation params

Type declaration

  • [key: string]: any

type

type: string = 'perspective'

The type of camera

PingPong - When use "PingPongCamera", the camera muse be located in scene

Three Type Value String(case insensitive)
THREE.PerspectiveCamera PerspectiveCamera, Perspective
THREE.ArrayCamera ArrayCamera, Array
THREE.CubeCamera CubeCamera, Cube, CubePingPong
NgxPingPongCamera PingPong, CubePingPong, CubePingPongCamera, PingPongCamera
THREE.OrthographicCamera OrthographicCamera, Orthographic
THREE.StereoCamera StereoCamera, Stereo

userData

userData: any = null

An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.

viewport

viewport: boolean = false

The viewport of this render target.

viewportType

viewportType: string = 'renderer'

The viewport of this render target.

Three Type Value String(case insensitive)
THREE.WebGLRenderer#setViewport renderer
THREE.PerspectiveCamera#setViewOffset viewoffset, offset
THREE.OrthographicCamera#setViewOffset viewoffset, offset
THREE.PerspectiveCamera #viewport - camera

visible

visible: boolean = true

Object gets rendered if true. Default is true.

width

width: string | number = '100%'

The size of width

  • type number fixed size
  • type string with include % relative size from renderer size for example in case renderer = 1024 '100%' = 1024, '50%' = 512, '50%-10' = 502, '50%+30' = 542
  • type string const refer width,height,x,y,

windowExport

windowExport: string = null

Export this Object to window global variables

x

x: string | number = 0

The viewport of this render target. Vector4.x

y

y: string | number = 0

The viewport of this render target. Vector4.y

zoom

zoom: string | number = null

Gets or sets the zoom factor of the camera. Default is 1.

Accessors

needUpdate

  • set needUpdate(value: boolean): void
  • Sets need update

    Parameters

    • value: boolean

    Returns void

Methods

addChanges

  • addChanges(key: string | string[] | SimpleChanges): void

addChildObject3d

addDebugLine

  • addDebugLine(objs: I3JS.Object3D<Event>[], lines: string[], prefix: string): string[]

addParentObject3d

addPosition

addRotation

Protected applyChanges

  • applyChanges(changes: string[]): void

applyChanges3d

  • applyChanges3d(changes: string[]): void

Protected callOnLoad

  • callOnLoad(): void

Protected checkChanges

  • checkChanges(changes: SimpleChanges): SimpleChanges

Protected clearChanges

  • clearChanges(): void

Protected consoleLog

  • consoleLog(key: string, object: any, level?: string): void

Protected consoleLogTime

  • consoleLogTime(key: string, object: any, repeat?: number): void

Protected destroyLocalComponent

  • destroyLocalComponent(key: string): void

dispose

  • dispose(): void

getCamera

  • getCamera<T>(): T

Protected getChanges

  • getChanges(): string[]

getCubeRenderTarget

getGeometry

getId

  • getId(): string

getIntersection

getIntersections

Protected getMaterialOne

Protected getMaterials

Protected getMaterialsMulti

Protected getName

  • getName(def?: string): string

getObject

  • getObject<T>(): T

getObject3d

  • getObject3d<T>(): T

getObjectById

getObjectByName

getObjectByProperty

getObjectTop

getPosition

getRaycaster

getRenderer

getRotation

getScale

getScene

getSize

getSubscribe

  • getSubscribe(): Observable<string[]>

getTagAttributeObject3d

getTexture

Protected getTimeout

  • getTimeout(timeDelay?: number): Promise<void>

getUserData

  • getUserData(): {}

Protected getVisible

  • getVisible(def?: boolean): boolean

Protected initLocalComponent

  • initLocalComponent<T>(key: string, component: T): T

Protected isIdEuals

  • isIdEuals(id: string): boolean

ngAfterContentInit

  • ngAfterContentInit(): void

ngOnChanges

  • ngOnChanges(changes: SimpleChanges): void
  • A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated. default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked.

    Parameters

    • changes: SimpleChanges

      The changed properties.

    Returns void

ngOnDestroy

  • ngOnDestroy(): void

ngOnInit

  • ngOnInit(): void
  • A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.

    Returns void

removeObject3d

render

resetTween

  • resetTween(): void

runSubscribeNext

  • runSubscribeNext(key: string | string[]): void

setLookat

Protected setObject

  • setObject(obj: any): void

Protected setObject3d

setParent

setParentObject3d

setPosition

setRenderer

setRendererSize

  • setRendererSize(width: number, height: number, fullWidth: number, fullHeight: number, pixelRatio?: number): void
  • Sets camera size

    Parameters

    • width: number
    • height: number
    • fullWidth: number
    • fullHeight: number
    • pixelRatio: number = 1

    Returns void

setRotation

setScale

setScaleScalar

setSubscribeNext

  • setSubscribeNext(key: string | string[]): void

setSubscribeType

  • setSubscribeType(subscribeType: string): void

setTween

  • setTween(tweenData: {}): void

setTweenTarget

  • setTweenTarget(tweenTarget: any): void

setUserData

  • setUserData(key: string, value: any): void

setVisible

  • setVisible(visible: boolean, _?: boolean): void

showDebug

Protected subscribeListQuery

  • subscribeListQuery(queryList: QueryList<any>, subscribeKey: string, changeKey: string): void

Protected subscribeListQueryChange

  • subscribeListQueryChange(queryList: QueryList<any>, subscribeKey: string, changeKey: string): void

Protected subscribeRefer

  • subscribeRefer(key: string, subscription: Subscription): void

Protected subscribeReferList

  • subscribeReferList(key: string, subscription: Subscription): void

Protected unSubscribeRefer

  • unSubscribeRefer(key: string): void

Protected unSubscribeReferList

  • unSubscribeReferList(key: string): void

Protected unSubscription

  • unSubscription(subscriptions: Subscription[]): Subscription[]

updateInputParams

  • updateInputParams(params: {}, firstChange?: boolean, changes?: SimpleChanges, type?: string): void

Generated using TypeDoc