Преглед на файлове

Editor: More Viewport.Info fixes.

Mr.doob преди 10 години
родител
ревизия
7b7699abc0
променени са 1 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 5 5
      editor/js/Viewport.Info.js

+ 5 - 5
editor/js/Viewport.Info.js

@@ -53,15 +53,15 @@ Viewport.Info = function ( editor ) {
 
 					} else if ( geometry instanceof THREE.BufferGeometry ) {
 
-						vertices += geometry.attributes.position.array.length / 3;
+						if ( geometry.index !== null ) {
 
-						if ( geometry.index !== undefined ) {
-
-							triangles += geometry.index.array.length / 3;
+							vertices += geometry.index.count * 3;
+							triangles += geometry.index.count;
 
 						} else {
 
-							triangles += geometry.attributes.position.array.length / 9;
+							vertices += geometry.attributes.position.count;
+							triangles += geometry.attributes.position.count / 3;
 
 						}