@babylonjs/core 7.13.0 → 7.13.1
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/Buffers/bufferUtils.d.ts +13 -0
- package/Buffers/bufferUtils.js +42 -0
- package/Buffers/bufferUtils.js.map +1 -0
- package/Buffers/index.d.ts +1 -0
- package/Buffers/index.js +1 -0
- package/Buffers/index.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Maths/math.vector.js +32 -6
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +49 -17
- package/Meshes/abstractMesh.js +126 -130
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +8 -0
- package/Meshes/geometry.js +17 -0
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/instancedMesh.d.ts +5 -8
- package/Meshes/instancedMesh.js +15 -9
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +7 -3
- package/Meshes/mesh.js +20 -11
- package/Meshes/mesh.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DataArray } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Copies the given data array to the given float array.
|
|
4
|
+
* @param input the input data array
|
|
5
|
+
* @param size the number of components
|
|
6
|
+
* @param type the component type
|
|
7
|
+
* @param byteOffset the byte offset of the data
|
|
8
|
+
* @param byteStride the byte stride of the data
|
|
9
|
+
* @param normalized whether the data is normalized
|
|
10
|
+
* @param totalVertices number of vertices in the buffer to take into account
|
|
11
|
+
* @param output the output float array
|
|
12
|
+
*/
|
|
13
|
+
export declare function CopyFloatData(input: DataArray, size: number, type: number, byteOffset: number, byteStride: number, normalized: boolean, totalVertices: number, output: Float32Array): void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { VertexBuffer } from "./buffer.js";
|
|
2
|
+
/**
|
|
3
|
+
* Copies the given data array to the given float array.
|
|
4
|
+
* @param input the input data array
|
|
5
|
+
* @param size the number of components
|
|
6
|
+
* @param type the component type
|
|
7
|
+
* @param byteOffset the byte offset of the data
|
|
8
|
+
* @param byteStride the byte stride of the data
|
|
9
|
+
* @param normalized whether the data is normalized
|
|
10
|
+
* @param totalVertices number of vertices in the buffer to take into account
|
|
11
|
+
* @param output the output float array
|
|
12
|
+
*/
|
|
13
|
+
export function CopyFloatData(input, size, type, byteOffset, byteStride, normalized, totalVertices, output) {
|
|
14
|
+
const tightlyPackedByteStride = size * VertexBuffer.GetTypeByteLength(type);
|
|
15
|
+
const count = totalVertices * size;
|
|
16
|
+
if (output.length !== count) {
|
|
17
|
+
throw new Error("Output length is not valid");
|
|
18
|
+
}
|
|
19
|
+
if (type !== VertexBuffer.FLOAT || byteStride !== tightlyPackedByteStride) {
|
|
20
|
+
VertexBuffer.ForEach(input, byteOffset, byteStride, size, type, count, normalized, (value, index) => (output[index] = value));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (input instanceof Array) {
|
|
24
|
+
const offset = byteOffset / 4;
|
|
25
|
+
output.set(input, offset);
|
|
26
|
+
}
|
|
27
|
+
else if (input instanceof ArrayBuffer) {
|
|
28
|
+
const floatData = new Float32Array(input, byteOffset, count);
|
|
29
|
+
output.set(floatData);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
let offset = input.byteOffset + byteOffset;
|
|
33
|
+
// Protect against bad data
|
|
34
|
+
const remainder = offset % 4;
|
|
35
|
+
if (remainder) {
|
|
36
|
+
offset = Math.max(0, offset - remainder);
|
|
37
|
+
}
|
|
38
|
+
const floatData = new Float32Array(input.buffer, offset, count);
|
|
39
|
+
output.set(floatData);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=bufferUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bufferUtils.js","sourceRoot":"","sources":["../../../../dev/core/src/Buffers/bufferUtils.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SAAS,EAAE;YACX,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;SAC5C;QAED,MAAM,SAAS,GAAG,IAAI,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAChE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;KACzB;AACL,CAAC","sourcesContent":["import type { DataArray } from \"../types\";\r\nimport { VertexBuffer } from \"./buffer\";\r\n\r\n/**\r\n * Copies the given data array to the given float array.\r\n * @param input the input data array\r\n * @param size the number of components\r\n * @param type the component type\r\n * @param byteOffset the byte offset of the data\r\n * @param byteStride the byte stride of the data\r\n * @param normalized whether the data is normalized\r\n * @param totalVertices number of vertices in the buffer to take into account\r\n * @param output the output float array\r\n */\r\nexport function CopyFloatData(\r\n input: DataArray,\r\n size: number,\r\n type: number,\r\n byteOffset: number,\r\n byteStride: number,\r\n normalized: boolean,\r\n totalVertices: number,\r\n output: Float32Array\r\n): void {\r\n const tightlyPackedByteStride = size * VertexBuffer.GetTypeByteLength(type);\r\n const count = totalVertices * size;\r\n\r\n if (output.length !== count) {\r\n throw new Error(\"Output length is not valid\");\r\n }\r\n\r\n if (type !== VertexBuffer.FLOAT || byteStride !== tightlyPackedByteStride) {\r\n VertexBuffer.ForEach(input, byteOffset, byteStride, size, type, count, normalized, (value, index) => (output[index] = value));\r\n return;\r\n }\r\n\r\n if (input instanceof Array) {\r\n const offset = byteOffset / 4;\r\n output.set(input, offset);\r\n } else if (input instanceof ArrayBuffer) {\r\n const floatData = new Float32Array(input, byteOffset, count);\r\n output.set(floatData);\r\n } else {\r\n let offset = input.byteOffset + byteOffset;\r\n\r\n // Protect against bad data\r\n const remainder = offset % 4;\r\n if (remainder) {\r\n offset = Math.max(0, offset - remainder);\r\n }\r\n\r\n const floatData = new Float32Array(input.buffer, offset, count);\r\n output.set(floatData);\r\n }\r\n}\r\n"]}
|
package/Buffers/index.d.ts
CHANGED
package/Buffers/index.js
CHANGED
package/Buffers/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Buffers/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,OAAO,gBAAgB,CAAC","sourcesContent":["export * from \"./buffer\";\r\nexport * from \"./dataBuffer\";\r\nexport * from \"./storageBuffer\";\r\nimport \"./buffer.align\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Buffers/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,OAAO,gBAAgB,CAAC","sourcesContent":["export * from \"./buffer\";\r\nexport * from \"./bufferUtils\";\r\nexport * from \"./dataBuffer\";\r\nexport * from \"./storageBuffer\";\r\nimport \"./buffer.align\";\r\n"]}
|
|
@@ -745,13 +745,13 @@ export class AbstractEngine {
|
|
|
745
745
|
*/
|
|
746
746
|
// Not mixed with Version for tooling purpose.
|
|
747
747
|
static get NpmPackage() {
|
|
748
|
-
return "babylonjs@7.13.
|
|
748
|
+
return "babylonjs@7.13.1";
|
|
749
749
|
}
|
|
750
750
|
/**
|
|
751
751
|
* Returns the current version of the framework
|
|
752
752
|
*/
|
|
753
753
|
static get Version() {
|
|
754
|
-
return "7.13.
|
|
754
|
+
return "7.13.1";
|
|
755
755
|
}
|
|
756
756
|
/**
|
|
757
757
|
* Gets the HTML canvas attached with the current webGL context
|