Socket
Socket
Sign inDemoInstall

@shapediver/viewer.rendering-engine.light-engine

Package Overview
Dependencies
Maintainers
5
Versions
203
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shapediver/viewer.rendering-engine.light-engine - npm Package Compare versions

Comparing version 2.6.5 to 2.7.0

7

dist/implementation/AbstractLight.d.ts
import { UuidGenerator } from '@shapediver/viewer.shared.services';
import { AbstractTreeNodeData } from '@shapediver/viewer.shared.node-tree';
import { ILight, LIGHT_TYPE } from '../interface/ILight';
import { Color } from '@shapediver/viewer.shared.types';
export declare abstract class AbstractLight extends AbstractTreeNodeData implements ILight {

@@ -8,3 +9,3 @@ #private;

constructor(properties: {
color: string;
color: Color;
intensity: number;

@@ -16,4 +17,4 @@ type: LIGHT_TYPE;

});
get color(): string;
set color(value: string);
get color(): Color;
set color(value: Color);
get intensity(): number;

@@ -20,0 +21,0 @@ set intensity(value: number);

@@ -58,3 +58,3 @@ "use strict";

l = new DirectionalLight_1.DirectionalLight({
color: this._converter.toColor(light.properties.color),
color: this._converter.toHexColor(light.properties.color),
intensity: light.properties.intensity,

@@ -70,5 +70,5 @@ direction: this._converter.toVec3(light.properties.direction),

l = new HemisphereLight_1.HemisphereLight({
color: this._converter.toColor(light.properties.skyColor),
color: this._converter.toHexColor(light.properties.skyColor),
intensity: light.properties.intensity,
groundColor: this._converter.toColor(light.properties.groundColor),
groundColor: this._converter.toHexColor(light.properties.groundColor),
name: light.name ? light.name : lightId,

@@ -81,3 +81,3 @@ order: light.order,

l = new PointLight_1.PointLight({
color: this._converter.toColor(light.properties.color),
color: this._converter.toHexColor(light.properties.color),
intensity: light.properties.intensity,

@@ -94,3 +94,3 @@ position: this._converter.toVec3(light.properties.position),

l = new SpotLight_1.SpotLight({
color: this._converter.toColor(light.properties.color),
color: this._converter.toHexColor(light.properties.color),
intensity: light.properties.intensity,

@@ -111,3 +111,3 @@ position: this._converter.toVec3(light.properties.position),

l = new AmbientLight_1.AmbientLight({
color: this._converter.toColor(light.properties.color),
color: this._converter.toHexColor(light.properties.color),
intensity: light.properties.intensity,

@@ -225,3 +225,3 @@ name: light.name ? light.name : lightId,

properties = {
color: light.color,
color: this._converter.toHexColor(light.color),
intensity: light.intensity,

@@ -236,5 +236,5 @@ direction: { x: light.direction[0], y: light.direction[1], z: light.direction[2] },

properties = {
skyColor: light.color,
skyColor: this._converter.toHexColor(light.color),
intensity: light.intensity,
groundColor: light.groundColor
groundColor: this._converter.toHexColor(light.groundColor)
};

@@ -244,3 +244,3 @@ break;

properties = {
color: light.color,
color: this._converter.toHexColor(light.color),
intensity: light.intensity,

@@ -254,3 +254,3 @@ position: { x: light.position[0], y: light.position[1], z: light.position[2] },

properties = {
color: light.color,
color: this._converter.toHexColor(light.color),
intensity: light.intensity,

@@ -268,3 +268,3 @@ position: { x: light.position[0], y: light.position[1], z: light.position[2] },

properties = {
color: light.color,
color: this._converter.toHexColor(light.color),
intensity: light.intensity

@@ -271,0 +271,0 @@ };

import { IRenderingEngine } from '@shapediver/viewer.rendering-engine.rendering-engine';
import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
import { vec3 } from 'gl-matrix';
import { Color } from '@shapediver/viewer.shared.types';
import { ILightScene } from '../interface/ILightScene';

@@ -32,3 +33,3 @@ import { AbstractLight } from './AbstractLight';

addAmbientLight(properties: {
color?: string;
color?: Color;
intensity?: number;

@@ -38,3 +39,3 @@ name?: string;

addDirectionalLight(properties: {
color?: string;
color?: Color;
intensity?: number;

@@ -48,5 +49,5 @@ direction?: vec3;

addHemisphereLight(properties: {
color?: string;
color?: Color;
intensity?: number;
groundColor?: string;
groundColor?: Color;
name?: string;

@@ -56,3 +57,3 @@ }): HemisphereLight;

addPointLight(properties: {
color?: string;
color?: Color;
intensity?: number;

@@ -65,3 +66,3 @@ position?: vec3;

addSpotLight(properties: {
color?: string;
color?: Color;
intensity?: number;

@@ -68,0 +69,0 @@ position?: vec3;

@@ -0,1 +1,2 @@

import { Color } from '@shapediver/viewer.shared.types';
import { IAmbientLight } from '../../interface/types/IAmbientLight';

@@ -6,3 +7,3 @@ import { AbstractLight } from '../AbstractLight';

constructor(properties: {
color?: string;
color?: Color;
intensity?: number;

@@ -9,0 +10,0 @@ name?: string;

import { vec3 } from 'gl-matrix';
import { Color } from '@shapediver/viewer.shared.types';
import { IDirectionalLight } from '../../interface/types/IDirectionalLight';

@@ -7,3 +8,3 @@ import { AbstractLight } from '../AbstractLight';

constructor(properties: {
color?: string;
color?: Color;
intensity?: number;

@@ -10,0 +11,0 @@ direction?: vec3;

@@ -0,1 +1,2 @@

import { Color } from '@shapediver/viewer.shared.types';
import { IHemisphereLight } from '../../interface/types/IHemisphereLight';

@@ -6,4 +7,4 @@ import { AbstractLight } from '../AbstractLight';

constructor(properties: {
color?: string;
groundColor?: string;
color?: Color;
groundColor?: Color;
intensity?: number;

@@ -14,4 +15,4 @@ name?: string;

});
get groundColor(): string;
set groundColor(value: string);
get groundColor(): Color;
set groundColor(value: Color);
get threeJsObject(): {

@@ -18,0 +19,0 @@ [key: string]: THREE.HemisphereLight;

import { vec3 } from 'gl-matrix';
import { Color } from '@shapediver/viewer.shared.types';
import { IPointLight } from '../../interface/types/IPointLight';

@@ -7,3 +8,3 @@ import { AbstractLight } from '../AbstractLight';

constructor(properties: {
color?: string;
color?: Color;
intensity?: number;

@@ -10,0 +11,0 @@ position?: vec3;

import { vec3 } from 'gl-matrix';
import { Color } from '@shapediver/viewer.shared.types';
import { ISpotLight } from '../../interface/types/ISpotLight';

@@ -7,3 +8,3 @@ import { AbstractLight } from '../AbstractLight';

constructor(properties: {
color?: string;
color?: Color;
intensity?: number;

@@ -10,0 +11,0 @@ position?: vec3;

import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
import { vec3 } from 'gl-matrix';
import { Color } from '@shapediver/viewer.shared.types';
export declare enum LIGHT_TYPE {

@@ -13,3 +13,3 @@ AMBIENT = "ambient",

id: string;
color: string | number | vec3;
color: Color;
intensity: number;

@@ -16,0 +16,0 @@ name?: string;

import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
import { vec3 } from 'gl-matrix';
import { Color } from '@shapediver/viewer.shared.types';
import { ILight } from './ILight';

@@ -13,3 +14,3 @@ export interface ILightScene {

addAmbientLight(properties: {
color?: string | number | vec3;
color?: Color;
intensity?: number;

@@ -20,3 +21,3 @@ id?: string;

addDirectionalLight(properties: {
color?: string | number | vec3;
color?: Color;
intensity?: number;

@@ -31,5 +32,5 @@ direction?: vec3;

addHemisphereLight(properties: {
color?: string | number | vec3;
color?: Color;
intensity?: number;
groundColor?: string | number | vec3;
groundColor?: Color;
id?: string;

@@ -39,3 +40,3 @@ name?: string;

addPointLight(properties: {
color?: string | number | vec3;
color?: Color;
intensity?: number;

@@ -49,3 +50,3 @@ position?: vec3;

addSpotLight(properties: {
color?: string | number | vec3;
color?: Color;
intensity?: number;

@@ -52,0 +53,0 @@ position?: vec3;

@@ -1,7 +0,7 @@

import { vec3 } from 'gl-matrix';
import { Color } from '@shapediver/viewer.shared.types';
import { ILight } from '../ILight';
export interface IHemisphereLight extends ILight {
groundColor: string | number | vec3;
groundColor: Color;
clone(): IHemisphereLight;
}
//# sourceMappingURL=IHemisphereLight.d.ts.map
{
"name": "@shapediver/viewer.rendering-engine.light-engine",
"version": "2.6.5",
"version": "2.7.0",
"description": "",

@@ -42,11 +42,11 @@ "keywords": [],

"dependencies": {
"@shapediver/viewer.rendering-engine.rendering-engine": "2.6.5",
"@shapediver/viewer.settings": "0.1.39",
"@shapediver/viewer.shared.node-tree": "2.6.5",
"@shapediver/viewer.shared.services": "2.6.5",
"@shapediver/viewer.shared.types": "2.6.5",
"@shapediver/viewer.rendering-engine.rendering-engine": "2.7.0",
"@shapediver/viewer.settings": "0.2.0",
"@shapediver/viewer.shared.node-tree": "2.7.0",
"@shapediver/viewer.shared.services": "2.7.0",
"@shapediver/viewer.shared.types": "2.7.0",
"gl-matrix": "3.3.0",
"tsyringe": "^4.5.0"
},
"gitHead": "7de51352cf63478851346dc8f886ad996b14c3c2"
"gitHead": "3fcd319e1a6c41609a0e50d871d17811d36bffe8"
}

@@ -7,2 +7,3 @@ import { vec3 } from 'gl-matrix'

import { ILight, LIGHT_TYPE } from '../interface/ILight'
import { Color } from '@shapediver/viewer.shared.types'

@@ -14,3 +15,3 @@ export abstract class AbstractLight extends AbstractTreeNodeData implements ILight {

#color: string;
#color: Color;
#intensity: number;

@@ -28,3 +29,3 @@ #name?: string;

constructor(properties: {
color: string,
color: Color,
intensity: number,

@@ -48,7 +49,7 @@ type: LIGHT_TYPE,

public get color(): string {
public get color(): Color {
return this.#color;
}
public set color(value: string) {
public set color(value: Color) {
this.#color = value;

@@ -55,0 +56,0 @@ this.updateVersion();

@@ -80,3 +80,3 @@ import { container, singleton } from 'tsyringe'

l = new DirectionalLight({
color: this._converter.toColor((<IDirectionalLightPropertiesV3>light.properties).color),
color: this._converter.toHexColor((<IDirectionalLightPropertiesV3>light.properties).color),
intensity: (<IDirectionalLightPropertiesV3>light.properties).intensity,

@@ -92,5 +92,5 @@ direction: this._converter.toVec3((<IDirectionalLightPropertiesV3>light.properties).direction),

l = new HemisphereLight({
color: this._converter.toColor((<IHemisphereLightPropertiesV3>light.properties).skyColor),
color: this._converter.toHexColor((<IHemisphereLightPropertiesV3>light.properties).skyColor),
intensity: (<IHemisphereLightPropertiesV3>light.properties).intensity,
groundColor: this._converter.toColor((<IHemisphereLightPropertiesV3>light.properties).groundColor),
groundColor: this._converter.toHexColor((<IHemisphereLightPropertiesV3>light.properties).groundColor),
name: light.name ? light.name : lightId,

@@ -103,3 +103,3 @@ order: light.order,

l = new PointLight({
color: this._converter.toColor((<IPointLightPropertiesV3>light.properties).color),
color: this._converter.toHexColor((<IPointLightPropertiesV3>light.properties).color),
intensity: (<IPointLightPropertiesV3>light.properties).intensity,

@@ -116,3 +116,3 @@ position: this._converter.toVec3((<IPointLightPropertiesV3>light.properties).position),

l = new SpotLight({
color: this._converter.toColor((<ISpotLightPropertiesV3>light.properties).color),
color: this._converter.toHexColor((<ISpotLightPropertiesV3>light.properties).color),
intensity: (<ISpotLightPropertiesV3>light.properties).intensity,

@@ -133,3 +133,3 @@ position: this._converter.toVec3((<ISpotLightPropertiesV3>light.properties).position),

l = new AmbientLight({
color: this._converter.toColor((<IAmbientLightPropertiesV3>light.properties).color),
color: this._converter.toHexColor((<IAmbientLightPropertiesV3>light.properties).color),
intensity: (<IAmbientLightPropertiesV3>light.properties).intensity,

@@ -258,3 +258,3 @@ name: light.name ? light.name : lightId,

properties = {
color: light.color,
color: this._converter.toHexColor(light.color),
intensity: light.intensity,

@@ -269,5 +269,5 @@ direction: { x: (<DirectionalLight>light).direction[0], y: (<DirectionalLight>light).direction[1], z: (<DirectionalLight>light).direction[2] },

properties = {
skyColor: light.color,
skyColor: this._converter.toHexColor(light.color),
intensity: light.intensity,
groundColor: (<HemisphereLight>light).groundColor
groundColor: this._converter.toHexColor((<HemisphereLight>light).groundColor)
}

@@ -277,3 +277,3 @@ break;

properties = {
color: light.color,
color: this._converter.toHexColor(light.color),
intensity: light.intensity,

@@ -287,3 +287,3 @@ position: { x: (<PointLight>light).position[0], y: (<PointLight>light).position[1], z: (<PointLight>light).position[2] },

properties = {
color: light.color,
color: this._converter.toHexColor(light.color),
intensity: light.intensity,

@@ -301,3 +301,3 @@ position: { x: (<SpotLight>light).position[0], y: (<SpotLight>light).position[1], z: (<SpotLight>light).position[2] },

properties = {
color: light.color,
color: this._converter.toHexColor(light.color),
intensity: light.intensity

@@ -304,0 +304,0 @@ }

import { IRenderingEngine } from '@shapediver/viewer.rendering-engine.rendering-engine';
import { ITreeNode, TreeNode } from '@shapediver/viewer.shared.node-tree'
import { vec3 } from 'gl-matrix';
import { Color } from '@shapediver/viewer.shared.types';

@@ -70,3 +71,3 @@ import { ILight } from '../interface/ILight'

public addAmbientLight(properties: {color?: string, intensity?: number, name?: string}): AmbientLight {
public addAmbientLight(properties: {color?: Color, intensity?: number, name?: string}): AmbientLight {
const light = new AmbientLight(properties);

@@ -77,3 +78,3 @@ this.addLight(light);

public addDirectionalLight(properties: {color?: string, intensity?: number, direction?: vec3, castShadow?: boolean, shadowMapResolution?: number, shadowMapBias?: number, name?: string}): DirectionalLight {
public addDirectionalLight(properties: {color?: Color, intensity?: number, direction?: vec3, castShadow?: boolean, shadowMapResolution?: number, shadowMapBias?: number, name?: string}): DirectionalLight {
const light = new DirectionalLight(properties);

@@ -84,3 +85,3 @@ this.addLight(light);

public addHemisphereLight(properties: {color?: string, intensity?: number, groundColor?: string, name?: string}): HemisphereLight {
public addHemisphereLight(properties: {color?: Color, intensity?: number, groundColor?: Color, name?: string}): HemisphereLight {
const light = new HemisphereLight(properties);

@@ -101,3 +102,3 @@ this.addLight(light);

public addPointLight(properties: {color?: string, intensity?: number, position?: vec3, distance?: number, decay?: number, name?: string}): PointLight {
public addPointLight(properties: {color?: Color, intensity?: number, position?: vec3, distance?: number, decay?: number, name?: string}): PointLight {
const light = new PointLight(properties);

@@ -108,3 +109,3 @@ this.addLight(light);

public addSpotLight(properties: {color?: string, intensity?: number, position?: vec3, target?: vec3, distance?: number, decay?: number, angle?: number, penumbra?: number, name?: string}): SpotLight {
public addSpotLight(properties: {color?: Color, intensity?: number, position?: vec3, target?: vec3, distance?: number, decay?: number, angle?: number, penumbra?: number, name?: string}): SpotLight {
const light = new SpotLight(properties);

@@ -111,0 +112,0 @@ this.addLight(light);

import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
import { Color } from '@shapediver/viewer.shared.types';

@@ -17,3 +18,3 @@ import { LIGHT_TYPE } from '../../interface/ILight'

constructor(properties: {
color?: string,
color?: Color,
intensity?: number,

@@ -20,0 +21,0 @@ name?: string,

import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
import { vec3 } from 'gl-matrix'
import { Color } from '@shapediver/viewer.shared.types';

@@ -22,3 +23,3 @@ import { LIGHT_TYPE } from '../../interface/ILight'

constructor(properties: {
color?: string,
color?: Color,
intensity?: number,

@@ -25,0 +26,0 @@ direction?: vec3,

import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
import { vec3 } from 'gl-matrix'
import { Color } from '@shapediver/viewer.shared.types';

@@ -11,3 +12,3 @@ import { LIGHT_TYPE } from '../../interface/ILight'

#groundColor: string = '#000000';
#groundColor: Color = '#000000';
#threeJsObject: { [key: string]: THREE.HemisphereLight } = {};

@@ -20,4 +21,4 @@

constructor(properties: {
color?: string,
groundColor?: string,
color?: Color,
groundColor?: Color,
intensity?: number,

@@ -44,7 +45,7 @@ name?: string,

public get groundColor(): string {
public get groundColor(): Color {
return this.#groundColor;
}
public set groundColor(value: string) {
public set groundColor(value: Color) {
this.#groundColor = value;

@@ -51,0 +52,0 @@ this.updateVersion();

import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
import { vec3 } from 'gl-matrix'
import { Color } from '@shapediver/viewer.shared.types';

@@ -21,3 +22,3 @@ import { LIGHT_TYPE } from '../../interface/ILight'

constructor(properties: {
color?: string,
color?: Color,
intensity?: number,

@@ -24,0 +25,0 @@ position?: vec3,

import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
import { vec3 } from 'gl-matrix'
import { Color } from '@shapediver/viewer.shared.types';

@@ -24,3 +25,3 @@ import { LIGHT_TYPE } from '../../interface/ILight'

constructor(properties: {
color?: string,
color?: Color,
intensity?: number,

@@ -27,0 +28,0 @@ position?: vec3,

import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
import { vec3 } from 'gl-matrix'
import { Color } from '@shapediver/viewer.shared.types'

@@ -17,3 +17,3 @@ export enum LIGHT_TYPE {

id: string;
color: string | number | vec3,
color: Color,
intensity: number,

@@ -20,0 +20,0 @@ name?: string

import { ITreeNode, TreeNode } from '@shapediver/viewer.shared.node-tree'
import { vec3 } from 'gl-matrix'
import { Color } from '@shapediver/viewer.shared.types'

@@ -19,7 +20,7 @@ import { ILight } from './ILight'

addAmbientLight(properties: {color?: string | number | vec3, intensity?: number, id?: string, name?: string}): ILight;
addDirectionalLight(properties: {color?: string | number | vec3, intensity?: number, direction?: vec3, castShadow?: boolean, shadowMapResolution?: number, shadowMapBias?: number, id?: string, name?: string}): ILight;
addHemisphereLight(properties: {color?: string | number | vec3, intensity?: number, groundColor?: string | number | vec3, id?: string, name?: string}): ILight;
addPointLight(properties: {color?: string | number | vec3, intensity?: number, position?: vec3, distance?: number, decay?: number, id?: string, name?: string}): ILight;
addSpotLight(properties: {color?: string | number | vec3, intensity?: number, position?: vec3, target?: vec3, distance?: number, decay?: number, angle?: number, penumbra?: number, id?: string, name?: string}): ILight;
addAmbientLight(properties: {color?: Color, intensity?: number, id?: string, name?: string}): ILight;
addDirectionalLight(properties: {color?: Color, intensity?: number, direction?: vec3, castShadow?: boolean, shadowMapResolution?: number, shadowMapBias?: number, id?: string, name?: string}): ILight;
addHemisphereLight(properties: {color?: Color, intensity?: number, groundColor?: Color, id?: string, name?: string}): ILight;
addPointLight(properties: {color?: Color, intensity?: number, position?: vec3, distance?: number, decay?: number, id?: string, name?: string}): ILight;
addSpotLight(properties: {color?: Color, intensity?: number, position?: vec3, target?: vec3, distance?: number, decay?: number, angle?: number, penumbra?: number, id?: string, name?: string}): ILight;
removeLight(id: string): boolean;

@@ -26,0 +27,0 @@

@@ -1,2 +0,2 @@

import { vec3 } from 'gl-matrix'
import { Color } from '@shapediver/viewer.shared.types'

@@ -6,5 +6,5 @@ import { ILight } from '../ILight'

export interface IHemisphereLight extends ILight {
groundColor: string | number | vec3;
groundColor: Color;
clone(): IHemisphereLight;
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc