Skip to content

Commit

Permalink
Fix node transform mul order on scene lighs (#39)
Browse files Browse the repository at this point in the history
Co-authored-by: Mate Vago <mate.vago.it@gmail.com>
  • Loading branch information
m8vago and m8vago authored Mar 29, 2021
1 parent 98077ea commit d6bccd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gltf/src/net/mgsx/gltf/scene3d/scene/Scene.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private void syncLights(){
for(Entry<Node, BaseLight> e : lights){
Node node = e.key;
BaseLight light = e.value;
transform.set(node.globalTransform).mul(modelInstance.transform);
transform.set(modelInstance.transform).mul(node.globalTransform);
if(light instanceof DirectionalLight){
((DirectionalLight)light).direction.set(0,0,-1).rot(transform);
}else if(light instanceof PointLight){
Expand Down

0 comments on commit d6bccd2

Please sign in to comment.