Skip to content

Commit 0a2d5bb

Browse files
committed
Set light local and world matrices to identity to ensure there aren't any empty matrices during the rest of the light construction (can lead to non-affine matrix errors)
1 parent b3b0a47 commit 0a2d5bb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/renderer/renderer/scene/renderlight.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var NODE_TYPE = Constants.NODE_TYPE;
66
var EVENT_TYPE = Constants.EVENT_TYPE;
77

88
var tmp_worldMatrix = XML3D.math.mat4.create();
9+
var identity_mat4 = XML3D.math.mat4.create();
910

1011
/** @const */
1112
var WORLD_MATRIX_OFFSET = 0;
@@ -42,6 +43,9 @@ var RenderLight = function (scene, pageEntry, opt) {
4243
RenderNode.call(this, NODE_TYPE.LIGHT, scene, pageEntry, opt);
4344
opt = opt || {};
4445
var configuration = opt.configuration || {};
46+
// Matrices need to be set to identity to avoid non-affine matrices during the rest of the light construction
47+
this.setLocalMatrix(identity_mat4);
48+
this.setWorldMatrix(identity_mat4);
4549
this.setLightType(configuration.model, configuration.dataNode);
4650
};
4751
RenderLight.ENTRY_SIZE = ENTRY_SIZE;

0 commit comments

Comments
 (0)