@xeokit/xeokit-sdk 2.6.93 → 2.6.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeokit/xeokit-sdk",
3
- "version": "2.6.93",
3
+ "version": "2.6.94",
4
4
  "description": "3D BIM IFC Viewer SDK for AEC engineering applications. Open Source JavaScript Toolkit based on pure WebGL for top performance, real-world coordinates and full double precision",
5
5
  "module": "./dist/xeokit-sdk.es.js",
6
6
  "main": "./dist/xeokit-sdk.cjs.js",
@@ -111,7 +111,7 @@ class DirLight extends Light {
111
111
  * @param {Number[]} [cfg.dir=[1.0, 1.0, 1.0]] A unit vector indicating the direction that the light is shining, given in either World or View space, depending on the value of the ````space```` parameter.
112
112
  * @param {Number[]} [cfg.color=[0.7, 0.7, 0.8 ]] The color of this DirLight.
113
113
  * @param {Number} [cfg.intensity=1.0] The intensity of this DirLight, as a factor in range ````[0..1]````.
114
- * @param {String} [cfg.space="view"] The coordinate system the DirLight is defined in - ````"view"```` or ````"space"````.
114
+ * @param {String} [cfg.space="view"] The coordinate system the DirLight is defined in - ````"view"```` or ````"world"````.
115
115
  * @param {Boolean} [cfg.castsShadow=false] Flag which indicates if this DirLight casts a castsShadow.
116
116
  */
117
117
  constructor(owner, cfg = {}) {
@@ -345,7 +345,7 @@ export const DrawShaderSource = function(meshDrawHash, programVariables, geometr
345
345
  src.push("shadow /= 9.0;");
346
346
  }
347
347
  src.push(`vec3 lightColor${i} = ${light.getColor()}${light.shadowParameters ? (" * " + "shadow") : ""};`);
348
- src.push(`vec3 lightDirection${i} = ${light.isWorldSpace ? vDirectionals[i].vViewLightReverseDir : light.getDirection(null, vViewPosition)};`);
348
+ src.push(`vec3 lightDirection${i} = ${light.isViewSpace ? light.getDirection(null, vViewPosition) : vDirectionals[i].vViewLightReverseDir};`);
349
349
  const dotNL = `${saturate}(dot(viewNormal, lightDirection${i}))`;
350
350
  src.push(`vec3 irradiance${i} = ${dotNL} * lightColor${i};`);
351
351
  src.push(`reflDiff += irradiance${i};`);
@@ -2655,7 +2655,7 @@ class Scene extends Component {
2655
2655
  *
2656
2656
  * @param {String[]} ids Array of {@link Entity#id} values.
2657
2657
  * @param {Number[]} [colorize=(1,1,1)] RGB colorize factors, multiplied by the rendered pixel colors.
2658
- * @returns {Boolean} True if any {@link Entity}s changed opacity, else false if all updates were redundant and not applied.
2658
+ * @returns {Boolean} True if any {@link Entity}s were colorized, else false if all updates were redundant and not applied.
2659
2659
  */
2660
2660
  setObjectsColorized(ids, colorize) {
2661
2661
  return this.withObjects(ids, entity => {
@@ -442,7 +442,7 @@ export const createLightSetup = function(programVariables, lightsState) {
442
442
  const withViewLightDir = getDirection => {
443
443
  return {
444
444
  glslLight: {
445
- isWorldSpace: light.space === "world",
445
+ isViewSpace: light.space === "view",
446
446
  getColor: () => `${lightUniforms.color}.rgb * ${lightUniforms.color}.a`,
447
447
  getDirection: (viewMatrix, viewPosition) => `normalize(${getDirection(viewMatrix, viewPosition)})`,
448
448
  shadowParameters: light.castsShadow && {