ソースを参照

Removed unnecessary count variable.

Justin Murray 6 年 前
コミット
8f43fec5a7
2 ファイル変更1 行追加8 行削除
  1. 1 1
      src/Engine/babylon.nativeEngine.ts
  2. 0 7
      src/Mesh/babylon.vertexBuffer.ts

+ 1 - 1
src/Engine/babylon.nativeEngine.ts

@@ -293,7 +293,7 @@
                                 // Convert to float as WebGL auto converts types but DirectX native implementations do not.
                                 let nativeBuffer = vertexBuffer._nativeBuffer;
                                 if (!nativeBuffer) {
-                                    const floatData = new Float32Array(vertexBuffer.count * vertexBuffer.getSize());
+                                    const floatData = new Float32Array(vertexBuffer.byteLength / Float32Array.BYTES_PER_ELEMENT);
                                     vertexBuffer.forEach(floatData.length, (value, index) => floatData[index] = value);
                                     nativeBuffer = this._native.createVertexBuffer(floatData);
                                     vertexBuffer._nativeBuffer = nativeBuffer;

+ 0 - 7
src/Mesh/babylon.vertexBuffer.ts

@@ -87,11 +87,6 @@
         public readonly type: number;
 
         /**
-         * Gets the number of attributes.
-         */
-        public readonly count: number;
-
-        /**
          * Constructor
          * @param engine the engine
          * @param data the data to use for this vertex buffer
@@ -149,8 +144,6 @@
 
             this._instanced = instanced !== undefined ? instanced : false;
             this._instanceDivisor = instanced ? 1 : 0;
-
-            this.count = count || (this.byteLength / this.byteStride);
         }
 
         /** @hidden */