Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NgxLightComponent

The Light component.

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

Three Type Type Key Acceptable Input
DirectionalLight DirectionalLight, Directional color, intensity
HemisphereLight HemisphereLight, Hemisphere skyColor, groundColor, intensity
LightProbe LightProbe, Probe sh, intensity, texture
PointLight PointLight, Point color, intensity, distance, decay
RectAreaLight RectAreaLight, RectArea color, intensity, width, height
SpotLight SpotLight, Spot color, intensity, distance, angle, penumbra, decay, shadowFocus
AmbientLight AmbientLight, Ambient color, intensity
<ngx3js-light
[type]="'Hemisphere'" [skyColor]="'0xffffff'"
[groundColor]="'0x444444'"
>
<ngx3js-position [x]="0" [y]="20" [z]="0"></ngx3js-position>
</ngx3js-light>
<ngx3js-light
[type]="'directional'" [color]="'0xffffff'" [intensity]="1"
>
<ngx3js-position [x]="-3" [y]="10" [z]="-10"></ngx3js-position>
</ngx3js-light>
<ngx3js-light
[type]="'AmbientLight'" [color]="'0x6688cc'"
></ngx3js-light>
<ngx3js-light
[type]="'SpotLight'"
[color]="'0xffffff'" [intensity]="1.5 "
[angle]="180/9" [castShadow]="true" [shadowCameraTop]="2 "
[shadowCameraBottom]="-2" [shadowCameraLeft]="-2 "
[shadowCameraRight]="2" [shadowCameraNear]="1000 "
[shadowCameraFar]="4000" [shadowMapSize]="1024"
>
<ngx3js-position [x]="0" [y]="500" [z]="2000"></ngx3js-position>
</ngx3js-light>
<ngx3js-light
[type]="'SpotLight'"
[color]="'0xffffff'" [intensity]="1.5 "
[angle]="20" [castShadow]="true" [shadowCameraNear]="1000 "
[shadowCameraFar]="4000" [shadowMapSize]="1024"
>
<ngx3js-position [x]="0" [y]="500" [z]="2000"></ngx3js-position>
</ngx3js-light>
see

THREE.Light

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

angle

angle: number = null

Maximum angle of light dispersion from its direction whose upper bound is Math.PI/2(360).

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.

color

color: INgxColor = null

Numeric value of the RGB component of the color. Default is 0xffffff.

Protected controllerList

controllerList: QueryList<NgxAbstractControllerComponent>

Content children of abstract object3d component

debug

debug: boolean = false

Debug this Object

decay

decay: number = null

The amount the light dims along the distance of the light. Default is 1.

distance

distance: number = null

Maximum range of the light. Default is 0 (no limit).

enabled

enabled: boolean = true

Enabled or Not

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

groundColor

groundColor: INgxColor = null

hexadecimal color of the ground. Default is 0xffffff.

height

height: number = null

height of the light. Default is 10.

Protected id

id: string = ''

The Id of abstract subscribe component

intensity

intensity: number = null

Numeric value of the light's strength/intensity. Default is 1.

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.

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<NgxLightComponent> = ...

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

onLoad

onLoad: EventEmitter<NgxLightComponent> = ...

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

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

penumbra

penumbra: number = null

Percent of the spotlight cone that is attenuated due to penumbra. Takes values between zero and 1. Default is zero.

receiveShadow

receiveShadow: boolean = null

Whether the material receives shadows. Default is false.

renderTarget

renderTarget: any = null

The renderTarget of light component

renderer

renderer: any = null

The renderer of light component

Protected selfAny

selfAny: any = ...

sh

sh: string = null

An instance of SphericalHarmonics3.

shadowBias

shadowBias: number = null

Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow. The default is 0. Very tiny adjustments here (in the order of 0.0001) may help reduce artefacts in shadows

shadowCameraBottom

shadowCameraBottom: number = null

Camera frustum bottom plane.

shadowCameraFar

shadowCameraFar: number = null

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

shadowCameraFov

shadowCameraFov: number = null

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

shadowCameraLeft

shadowCameraLeft: number = null

Camera frustum left plane.

shadowCameraNear

shadowCameraNear: number = null

The shadowCameraNear of light component

shadowCameraRight

shadowCameraRight: number = null

Camera frustum right plane.

shadowCameraTop

shadowCameraTop: number = null

Camera frustum top plane.

shadowCameraZoom

shadowCameraZoom: number = null

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

shadowFocus

shadowFocus: number = null

Used to focus the shadow camera. The camera's field of view is set as a percentage of the spotlight's field-of-view. Range is [0, 1]. Default is 1.0.

shadowMapSize

shadowMapSize: number = null

A Vector2 defining the width and height of the shadow map.

shadowMapSizeHeight

shadowMapSizeHeight: number = null

A Vector2 defining the width and height of the shadow map. vector2.height

shadowMapSizeWidth

shadowMapSizeWidth: number = null

A Vector2 defining the width and height of the shadow map. vector2.width

shadowRadius

shadowRadius: number = null

Setting this to values greater than 1 will blur the edges of the shadow. High values will cause unwanted banding effects in the shadows - a greater LightShadow.mapSize will allow for a higher value to be used here before these effects become visible. If WebGLRenderer.shadowMap.type is set to PCFSoftShadowMap, radius has no effect and it is recommended to increase softness by decreasing LightShadow.mapSize instead. Note that this has no effect if the WebGLRenderer.shadowMap.type is set to BasicShadowMap.

skyColor

skyColor: INgxColor = null

hexadecimal color of the sky. Default is 0xffffff.

Protected subscribeType

subscribeType: string = null

Subscribe type of abstract subscribe component

target

target: any = null

The target of light component

targetX

targetX: number = null

The targetX of light component

targetY

targetY: number = null

The targetY of light component

targetZ

targetZ: number = null

The targetZ of light component

texture

The texture of light component

tween

tween: {} = null

Tween animation params

Type declaration

  • [key: string]: any

type

type: string = 'spot'

The type of light

Three Type Value String(case insensitive)
THREE.PointLight PointLight, Point
THREE.RectAreaLight RectAreaLight, RectArea
THREE.SpotLight SpotLight, Spot
THREE.DirectionalLight DirectionalLight, Directional
THREE.HemisphereLight HemisphereLight, Hemisphere
THREE.LightProbe LightProbe, Probe
THREE.AmbientLight AmbientLight, Ambient

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.

visible

visible: boolean = true

Object gets rendered if true. Default is true.

width

width: number = null

width of the light. Default is 10.

windowExport

windowExport: string = null

Export this Object to window global variables

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

Protected getChanges

  • getChanges(): string[]

getGeometry

getId

  • getId(): string

getLight

  • getLight<T>(): T

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

getRotation

getScale

getSubscribe

  • getSubscribe(): Observable<string[]>

getTagAttribute

getTagAttributeObject3d

getThreeRenderer

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

resetTween

  • resetTween(): void

runSubscribeNext

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

setLookat

Protected setObject

  • setObject(obj: any): void

Protected setObject3d

setParent

setParentObject3d

setPosition

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