@babylonjs/core 6.23.0 → 6.24.0
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/Animations/animationGroup.d.ts +1 -1
- package/Animations/animationGroup.js.map +1 -1
- package/Behaviors/Cameras/framingBehavior.d.ts +0 -5
- package/Behaviors/Cameras/framingBehavior.js +2 -34
- package/Behaviors/Cameras/framingBehavior.js.map +1 -1
- package/Buffers/buffer.d.ts +64 -1
- package/Buffers/buffer.js +30 -23
- package/Buffers/buffer.js.map +1 -1
- package/Buffers/storageBuffer.d.ts +3 -1
- package/Buffers/storageBuffer.js +4 -2
- package/Buffers/storageBuffer.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js +1 -1
- package/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/Stereoscopic/anaglyphArcRotateCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/anaglyphArcRotateCamera.js +1 -1
- package/Cameras/Stereoscopic/anaglyphArcRotateCamera.js.map +1 -1
- package/Cameras/Stereoscopic/anaglyphFreeCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/anaglyphFreeCamera.js +1 -1
- package/Cameras/Stereoscopic/anaglyphFreeCamera.js.map +1 -1
- package/Cameras/Stereoscopic/anaglyphGamepadCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/anaglyphGamepadCamera.js +1 -1
- package/Cameras/Stereoscopic/anaglyphGamepadCamera.js.map +1 -1
- package/Cameras/Stereoscopic/anaglyphUniversalCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/anaglyphUniversalCamera.js +1 -1
- package/Cameras/Stereoscopic/anaglyphUniversalCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js +1 -1
- package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicFreeCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/stereoscopicFreeCamera.js +1 -1
- package/Cameras/Stereoscopic/stereoscopicFreeCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicGamepadCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/stereoscopicGamepadCamera.js +1 -1
- package/Cameras/Stereoscopic/stereoscopicGamepadCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicUniversalCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/stereoscopicUniversalCamera.js +1 -1
- package/Cameras/Stereoscopic/stereoscopicUniversalCamera.js.map +1 -1
- package/Cameras/VR/vrDeviceOrientationArcRotateCamera.d.ts +1 -1
- package/Cameras/VR/vrDeviceOrientationArcRotateCamera.js +1 -1
- package/Cameras/VR/vrDeviceOrientationArcRotateCamera.js.map +1 -1
- package/Cameras/VR/vrDeviceOrientationFreeCamera.d.ts +1 -1
- package/Cameras/VR/vrDeviceOrientationFreeCamera.js +1 -1
- package/Cameras/VR/vrDeviceOrientationFreeCamera.js.map +1 -1
- package/Cameras/VR/vrDeviceOrientationGamepadCamera.d.ts +1 -1
- package/Cameras/VR/vrDeviceOrientationGamepadCamera.js +1 -1
- package/Cameras/VR/vrDeviceOrientationGamepadCamera.js.map +1 -1
- package/Cameras/arcRotateCamera.d.ts +4 -0
- package/Cameras/arcRotateCamera.js +22 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Culling/Octrees/octreeSceneComponent.js +4 -4
- package/Culling/Octrees/octreeSceneComponent.js.map +1 -1
- package/Debug/physicsViewer.js +4 -4
- package/Debug/physicsViewer.js.map +1 -1
- package/Debug/rayHelper.js +1 -1
- package/Debug/rayHelper.js.map +1 -1
- package/Engines/Extensions/engine.storageBuffer.d.ts +2 -1
- package/Engines/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/Extensions/engine.uniformBuffer.d.ts +4 -2
- package/Engines/Extensions/engine.uniformBuffer.js +2 -2
- package/Engines/Extensions/engine.uniformBuffer.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.d.ts +2 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js +3 -3
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.uniformBuffer.js +5 -5
- package/Engines/WebGPU/Extensions/engine.uniformBuffer.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.d.ts +3 -2
- package/Engines/WebGPU/webgpuBufferManager.js +16 -3
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.d.ts +2 -0
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +61 -0
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuDrawContext.js +1 -1
- package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
- package/Engines/WebGPU/webgpuPipelineContext.d.ts +3 -0
- package/Engines/WebGPU/webgpuPipelineContext.js +1 -0
- package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js +3 -3
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.d.ts +3 -0
- package/Engines/WebGPU/webgpuShaderProcessor.js +5 -0
- package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +11 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +3 -0
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +32 -4
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +5 -3
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTintWASM.js +1 -1
- package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
- package/Engines/engine.d.ts +1 -1
- package/Engines/nativeEngine.d.ts +2 -2
- package/Engines/nativeEngine.js +5 -2
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +7 -3
- package/Engines/thinEngine.js +11 -7
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +9 -4
- package/Engines/webgpuEngine.js +16 -11
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/flowGraph.js +1 -1
- package/FlowGraph/flowGraph.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +1 -1
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.d.ts +4 -0
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.js +21 -0
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.js.map +1 -1
- package/Materials/Textures/equiRectangularCubeTexture.js +1 -1
- package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +2 -0
- package/Materials/Textures/texture.js +8 -0
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/videoTexture.d.ts +4 -0
- package/Materials/Textures/videoTexture.js +21 -0
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/effect.d.ts +8 -3
- package/Materials/effect.js +25 -19
- package/Materials/effect.js.map +1 -1
- package/Materials/material.js +8 -6
- package/Materials/material.js.map +1 -1
- package/Materials/meshDebugPluginMaterial.js +1 -1
- package/Materials/meshDebugPluginMaterial.js.map +1 -1
- package/Materials/uniformBuffer.d.ts +1 -0
- package/Materials/uniformBuffer.js +9 -2
- package/Materials/uniformBuffer.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.d.ts +66 -0
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +100 -0
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -0
- package/Meshes/Node/Blocks/Instances/instantiateBlock.d.ts +5 -30
- package/Meshes/Node/Blocks/Instances/instantiateBlock.js +2 -52
- package/Meshes/Node/Blocks/Instances/instantiateBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateLinearBlock.d.ts +31 -0
- package/Meshes/Node/Blocks/Instances/instantiateLinearBlock.js +101 -0
- package/Meshes/Node/Blocks/Instances/instantiateLinearBlock.js.map +1 -0
- package/Meshes/Node/Blocks/Instances/instantiateRadialBlock.d.ts +43 -0
- package/Meshes/Node/Blocks/Instances/instantiateRadialBlock.js +139 -0
- package/Meshes/Node/Blocks/Instances/instantiateRadialBlock.js.map +1 -0
- package/Meshes/Node/index.d.ts +2 -0
- package/Meshes/Node/index.js +2 -0
- package/Meshes/Node/index.js.map +1 -1
- package/Meshes/geometry.js +8 -2
- package/Meshes/geometry.js.map +1 -1
- package/Misc/videoRecorder.js +3 -3
- package/Misc/videoRecorder.js.map +1 -1
- package/Physics/physicsHelper.js +3 -3
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.js +64 -56
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js +4 -4
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/shadowsFragmentFunctions.js +1 -0
- package/Shaders/ShadersInclude/shadowsFragmentFunctions.js.map +1 -1
- package/XR/features/WebXRSpaceWarp.d.ts +2 -0
- package/XR/features/WebXRSpaceWarp.js +6 -1
- package/XR/features/WebXRSpaceWarp.js.map +1 -1
- package/XR/webXRSessionManager.js +1 -1
- package/XR/webXRSessionManager.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +4 -4
- package/scene.js.map +1 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
2
|
+
import { NodeGeometryBlockConnectionPointTypes } from "../../Enums/nodeGeometryConnectionPointTypes.js";
|
|
3
|
+
import { Matrix, Quaternion, Vector3 } from "../../../../Maths/math.vector.js";
|
|
4
|
+
import { InstantiateBaseBlock } from "./instantiateBaseBlock.js";
|
|
5
|
+
/**
|
|
6
|
+
* Block used to clone geometry in a radial shape
|
|
7
|
+
*/
|
|
8
|
+
export class InstantiateRadialBlock extends InstantiateBaseBlock {
|
|
9
|
+
/**
|
|
10
|
+
* Create a new InstantiateRadialBlock
|
|
11
|
+
* @param name defines the block name
|
|
12
|
+
*/
|
|
13
|
+
constructor(name) {
|
|
14
|
+
super(name);
|
|
15
|
+
this.registerInput("radius", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);
|
|
16
|
+
// Angle start and end
|
|
17
|
+
this.registerInput("angleStart", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
|
|
18
|
+
this.registerInput("angleEnd", NodeGeometryBlockConnectionPointTypes.Float, true, Math.PI * 2);
|
|
19
|
+
// Transform offset
|
|
20
|
+
this.registerInput("transform", NodeGeometryBlockConnectionPointTypes.Vector3, true, new Vector3(0, 0, 0));
|
|
21
|
+
// Rotation is magnitude per step
|
|
22
|
+
this.registerInput("rotation", NodeGeometryBlockConnectionPointTypes.Vector3, true, new Vector3(0, 0, 0));
|
|
23
|
+
// Scale is magnitude per step
|
|
24
|
+
this.registerInput("scaling", NodeGeometryBlockConnectionPointTypes.Vector3, true, new Vector3(0, 0, 0));
|
|
25
|
+
this.scaling.acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Gets the current class name
|
|
29
|
+
* @returns the class name
|
|
30
|
+
*/
|
|
31
|
+
getClassName() {
|
|
32
|
+
return "InstantiateRadialBlock";
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Gets the direction input component
|
|
36
|
+
*/
|
|
37
|
+
get radius() {
|
|
38
|
+
return this._inputs[2];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Gets the direction input component
|
|
42
|
+
*/
|
|
43
|
+
get angleStart() {
|
|
44
|
+
return this._inputs[3];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Gets the direction input component
|
|
48
|
+
*/
|
|
49
|
+
get angleEnd() {
|
|
50
|
+
return this._inputs[4];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Gets the transform input component
|
|
54
|
+
*/
|
|
55
|
+
get transform() {
|
|
56
|
+
return this._inputs[5];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Gets the rotation input component
|
|
60
|
+
*/
|
|
61
|
+
get rotation() {
|
|
62
|
+
return this._inputs[6];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Gets the scaling input component
|
|
66
|
+
*/
|
|
67
|
+
get scaling() {
|
|
68
|
+
return this._inputs[7];
|
|
69
|
+
}
|
|
70
|
+
_buildBlock(state) {
|
|
71
|
+
const func = (state) => {
|
|
72
|
+
state.pushExecutionContext(this);
|
|
73
|
+
state.pushInstancingContext(this);
|
|
74
|
+
const iterationCount = this.count.getConnectedValue(state);
|
|
75
|
+
const additionalVertexData = [];
|
|
76
|
+
const rotMatrix = Matrix.Identity();
|
|
77
|
+
const radiusMatrix = Matrix.Identity();
|
|
78
|
+
const transformMatrix = Matrix.Identity();
|
|
79
|
+
const transformOffset = Vector3.Zero();
|
|
80
|
+
const rotationOffset = Vector3.Zero();
|
|
81
|
+
const scaleOffset = Vector3.Zero();
|
|
82
|
+
for (this._currentIndex = 0; this._currentIndex < iterationCount; this._currentIndex++) {
|
|
83
|
+
const instanceGeometry = this.instance.getConnectedValue(state);
|
|
84
|
+
if (!instanceGeometry || !instanceGeometry.positions || instanceGeometry.positions.length === 0) {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
// Clone the instance
|
|
88
|
+
const clone = instanceGeometry.clone();
|
|
89
|
+
const radius = this.radius.getConnectedValue(state);
|
|
90
|
+
const angleStart = this.angleStart.getConnectedValue(state);
|
|
91
|
+
const angleEnd = this.angleEnd.getConnectedValue(state);
|
|
92
|
+
const transform = this.transform.getConnectedValue(state);
|
|
93
|
+
const rotation = this.rotation.getConnectedValue(state);
|
|
94
|
+
const scale = state.adaptInput(this.scaling, NodeGeometryBlockConnectionPointTypes.Vector3, Vector3.OneReadOnly);
|
|
95
|
+
// Define arc size
|
|
96
|
+
const pieSlice = angleEnd - angleStart;
|
|
97
|
+
const rStep = pieSlice / iterationCount;
|
|
98
|
+
const angle = angleStart + rStep * this._currentIndex;
|
|
99
|
+
const angleQuat = Quaternion.FromEulerAngles(0, angle, 0);
|
|
100
|
+
// Get local transforms
|
|
101
|
+
transformOffset.copyFrom(transform.clone().scale(this._currentIndex));
|
|
102
|
+
rotationOffset.copyFrom(rotation.clone().scale(this._currentIndex));
|
|
103
|
+
scaleOffset.copyFrom(scale.clone().scale(this._currentIndex));
|
|
104
|
+
scaleOffset.addInPlaceFromFloats(1, 1, 1);
|
|
105
|
+
// Compose (rotMatrix x radius x scale x angle x user transform)
|
|
106
|
+
Matrix.RotationYawPitchRollToRef(rotationOffset.y, rotationOffset.x, rotationOffset.z, rotMatrix);
|
|
107
|
+
radiusMatrix.setTranslationFromFloats(0, 0, radius);
|
|
108
|
+
Matrix.ComposeToRef(scaleOffset, angleQuat, transformOffset, transformMatrix);
|
|
109
|
+
rotMatrix.multiplyToRef(radiusMatrix, radiusMatrix);
|
|
110
|
+
radiusMatrix.multiplyToRef(transformMatrix, transformMatrix);
|
|
111
|
+
state._instantiateWithMatrix(clone, transformMatrix, additionalVertexData);
|
|
112
|
+
}
|
|
113
|
+
// Merge
|
|
114
|
+
if (additionalVertexData.length) {
|
|
115
|
+
if (additionalVertexData.length === 1) {
|
|
116
|
+
this._vertexData = additionalVertexData[0];
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
// We do not merge the main one as user can use a merge node if wanted
|
|
120
|
+
const main = additionalVertexData.splice(0, 1)[0];
|
|
121
|
+
this._vertexData = main.merge(additionalVertexData, true, false, true, true);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Storage
|
|
125
|
+
state.restoreExecutionContext();
|
|
126
|
+
state.restoreInstancingContext();
|
|
127
|
+
return this._vertexData;
|
|
128
|
+
};
|
|
129
|
+
if (this.evaluateContext) {
|
|
130
|
+
this.output._storedFunction = func;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
this.output._storedFunction = null;
|
|
134
|
+
this.output._storedValue = func(state);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
RegisterClass("BABYLON.InstantiateRadialBlock", InstantiateRadialBlock);
|
|
139
|
+
//# sourceMappingURL=instantiateRadialBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instantiateRadialBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Instances/instantiateRadialBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAG5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,oBAAoB;IAC5D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,C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I,CAAC,WAAW,CAAC;QAC5B,CAAC,CAAC;QAEF,IAAI,IAAI,CAAC,eAAe,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;SACtC;aAAM;YACH,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;YACnC,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;SAC1C;IACL,CAAC;CACJ;AAED,aAAa,CAAC,gCAAgC,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { Matrix, Quaternion, Vector3 } from \"../../../../Maths/math.vector\";\r\nimport { type NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport type { VertexData } from \"core/Meshes/mesh.vertexData\";\r\nimport { InstantiateBaseBlock } from \"./instantiateBaseBlock\";\r\n\r\n/**\r\n * Block used to clone geometry in a radial shape\r\n */\r\nexport class InstantiateRadialBlock extends InstantiateBaseBlock {\r\n /**\r\n * Create a new InstantiateRadialBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n this.registerInput(\"radius\", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);\r\n\r\n // Angle start and end\r\n this.registerInput(\"angleStart\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"angleEnd\", NodeGeometryBlockConnectionPointTypes.Float, true, Math.PI * 2);\r\n\r\n // Transform offset\r\n this.registerInput(\"transform\", NodeGeometryBlockConnectionPointTypes.Vector3, true, new Vector3(0, 0, 0));\r\n\r\n // Rotation is magnitude per step\r\n this.registerInput(\"rotation\", NodeGeometryBlockConnectionPointTypes.Vector3, true, new Vector3(0, 0, 0));\r\n\r\n // Scale is magnitude per step\r\n this.registerInput(\"scaling\", NodeGeometryBlockConnectionPointTypes.Vector3, true, new Vector3(0, 0, 0));\r\n this.scaling.acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"InstantiateRadialBlock\";\r\n }\r\n\r\n /**\r\n * Gets the direction input component\r\n */\r\n public get radius(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the direction input component\r\n */\r\n public get angleStart(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the direction input component\r\n */\r\n public get angleEnd(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the transform input component\r\n */\r\n public get transform(): NodeGeometryConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the rotation input component\r\n */\r\n public get rotation(): NodeGeometryConnectionPoint {\r\n return this._inputs[6];\r\n }\r\n\r\n /**\r\n * Gets the scaling input component\r\n */\r\n public get scaling(): NodeGeometryConnectionPoint {\r\n return this._inputs[7];\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n const func = (state: NodeGeometryBuildState) => {\r\n state.pushExecutionContext(this);\r\n state.pushInstancingContext(this);\r\n\r\n const iterationCount = this.count.getConnectedValue(state) as number;\r\n\r\n const additionalVertexData: VertexData[] = [];\r\n\r\n const rotMatrix = Matrix.Identity();\r\n const radiusMatrix = Matrix.Identity();\r\n const transformMatrix = Matrix.Identity();\r\n const transformOffset = Vector3.Zero();\r\n const rotationOffset = Vector3.Zero();\r\n const scaleOffset = Vector3.Zero();\r\n\r\n for (this._currentIndex = 0; this._currentIndex < iterationCount; this._currentIndex++) {\r\n const instanceGeometry = this.instance.getConnectedValue(state) as VertexData;\r\n\r\n if (!instanceGeometry || !instanceGeometry.positions || instanceGeometry.positions.length === 0) {\r\n continue;\r\n }\r\n // Clone the instance\r\n const clone = instanceGeometry.clone();\r\n\r\n const radius = this.radius.getConnectedValue(state) as number;\r\n const angleStart: number = this.angleStart.getConnectedValue(state) as number;\r\n const angleEnd = this.angleEnd.getConnectedValue(state) as number;\r\n\r\n const transform = this.transform.getConnectedValue(state) as Vector3;\r\n\r\n const rotation = this.rotation.getConnectedValue(state) as Vector3;\r\n\r\n const scale = state.adaptInput(this.scaling, NodeGeometryBlockConnectionPointTypes.Vector3, Vector3.OneReadOnly);\r\n\r\n // Define arc size\r\n const pieSlice = angleEnd - angleStart;\r\n const rStep = pieSlice / iterationCount;\r\n\r\n const angle = angleStart + rStep * this._currentIndex;\r\n const angleQuat = Quaternion.FromEulerAngles(0, angle, 0);\r\n\r\n // Get local transforms\r\n transformOffset.copyFrom(transform.clone().scale(this._currentIndex));\r\n rotationOffset.copyFrom(rotation.clone().scale(this._currentIndex));\r\n scaleOffset.copyFrom(scale.clone().scale(this._currentIndex));\r\n scaleOffset.addInPlaceFromFloats(1, 1, 1);\r\n\r\n // Compose (rotMatrix x radius x scale x angle x user transform)\r\n Matrix.RotationYawPitchRollToRef(rotationOffset.y, rotationOffset.x, rotationOffset.z, rotMatrix);\r\n radiusMatrix.setTranslationFromFloats(0, 0, radius);\r\n Matrix.ComposeToRef(scaleOffset, angleQuat, transformOffset, transformMatrix);\r\n\r\n rotMatrix.multiplyToRef(radiusMatrix, radiusMatrix);\r\n radiusMatrix.multiplyToRef(transformMatrix, transformMatrix);\r\n\r\n state._instantiateWithMatrix(clone, transformMatrix, additionalVertexData);\r\n }\r\n\r\n // Merge\r\n if (additionalVertexData.length) {\r\n if (additionalVertexData.length === 1) {\r\n this._vertexData = additionalVertexData[0];\r\n } else {\r\n // We do not merge the main one as user can use a merge node if wanted\r\n const main = additionalVertexData.splice(0, 1)[0];\r\n this._vertexData = main.merge(additionalVertexData, true, false, true, true);\r\n }\r\n }\r\n\r\n // Storage\r\n state.restoreExecutionContext();\r\n state.restoreInstancingContext();\r\n return this._vertexData;\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.InstantiateRadialBlock\", InstantiateRadialBlock);\r\n"]}
|
package/Meshes/Node/index.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ export * from "./Blocks/Instances/instantiateOnVerticesBlock";
|
|
|
48
48
|
export * from "./Blocks/Instances/instantiateOnFacesBlock";
|
|
49
49
|
export * from "./Blocks/Instances/instantiateOnVolumeBlock";
|
|
50
50
|
export * from "./Blocks/Instances/instantiateBlock";
|
|
51
|
+
export * from "./Blocks/Instances/instantiateLinearBlock";
|
|
52
|
+
export * from "./Blocks/Instances/instantiateRadialBlock";
|
|
51
53
|
export * from "./Blocks/intFloatConverterBlock";
|
|
52
54
|
export * from "./Blocks/debugBlock";
|
|
53
55
|
export * from "./Blocks/geometryInfoBlock";
|
package/Meshes/Node/index.js
CHANGED
|
@@ -48,6 +48,8 @@ export * from "./Blocks/Instances/instantiateOnVerticesBlock.js";
|
|
|
48
48
|
export * from "./Blocks/Instances/instantiateOnFacesBlock.js";
|
|
49
49
|
export * from "./Blocks/Instances/instantiateOnVolumeBlock.js";
|
|
50
50
|
export * from "./Blocks/Instances/instantiateBlock.js";
|
|
51
|
+
export * from "./Blocks/Instances/instantiateLinearBlock.js";
|
|
52
|
+
export * from "./Blocks/Instances/instantiateRadialBlock.js";
|
|
51
53
|
export * from "./Blocks/intFloatConverterBlock.js";
|
|
52
54
|
export * from "./Blocks/debugBlock.js";
|
|
53
55
|
export * from "./Blocks/geometryInfoBlock.js";
|
package/Meshes/Node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CA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cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC","sourcesContent":["export * from \"./nodeGeometry\";\r\nexport * from \"./nodeGeometryBlock\";\r\nexport * from \"./nodeGeometryBlockConnectionPoint\";\r\nexport * from \"./nodeGeometryBuildState\";\r\nexport * from \"./Interfaces/nodeGeometryExecutionContext\";\r\nexport * from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nexport * from \"./Enums/nodeGeometryContextualSources\";\r\nexport * from \"./Blocks/geometryOptimizeBlock\";\r\nexport * from \"./Blocks/geometryOutputBlock\";\r\nexport * from \"./Blocks/geometryInputBlock\";\r\nexport * from \"./Blocks/Sources/planeBlock\";\r\nexport * from \"./Blocks/Sources/boxBlock\";\r\nexport * from \"./Blocks/Sources/meshBlock\";\r\nexport * from \"./Blocks/Sources/icoSphereBlock\";\r\nexport * from \"./Blocks/Sources/sphereBlock\";\r\nexport * from \"./Blocks/Sources/gridBlock\";\r\nexport * from \"./Blocks/Sources/torusBlock\";\r\nexport * from \"./Blocks/Sources/cylinderBlock\";\r\nexport * from \"./Blocks/Sources/capsuleBlock\";\r\nexport * from \"./Blocks/Sources/discBlock\";\r\nexport * from \"./Blocks/Sources/nullBlock\";\r\nexport * from \"./Blocks/Set/setPositionsBlock\";\r\nexport * from \"./Blocks/Set/setNormalsBlock\";\r\nexport * from \"./Blocks/Set/setUVsBlock\";\r\nexport * from \"./Blocks/Set/setColorsBlock\";\r\nexport * from \"./Blocks/Set/setTangentsBlock\";\r\nexport * from \"./Blocks/mathBlock\";\r\nexport * from \"./Blocks/mapRangeBlock\";\r\nexport * from \"./Blocks/conditionBlock\";\r\nexport * from \"./Blocks/randomBlock\";\r\nexport * from \"./Blocks/noiseBlock\";\r\nexport * from \"./Blocks/mergeGeometryBlock\";\r\nexport * from \"./Blocks/geometryCollectionBlock\";\r\nexport * from \"./Blocks/geometryElbowBlock\";\r\nexport * from \"./Blocks/computeNormalsBlock\";\r\nexport * from \"./Blocks/vectorConverterBlock\";\r\nexport * from \"./Blocks/normalizeVectorBlock\";\r\nexport * from \"./Blocks/Set/setMaterialIDBlock\";\r\nexport * from \"./Blocks/geometryTrigonometryBlock\";\r\nexport * from \"./Blocks/geometryTransformBlock\";\r\nexport * from \"./Blocks/Matrices/rotationXBlock\";\r\nexport * from \"./Blocks/Matrices/rotationYBlock\";\r\nexport * from \"./Blocks/Matrices/rotationZBlock\";\r\nexport * from \"./Blocks/Matrices/scalingBlock\";\r\nexport * from \"./Blocks/Matrices/alignBlock\";\r\nexport * from \"./Blocks/Matrices/translationBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVerticesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnFacesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVolumeBlock\";\r\nexport * from \"./Blocks/Instances/instantiateBlock\";\r\nexport * from \"./Blocks/intFloatConverterBlock\";\r\nexport * from \"./Blocks/debugBlock\";\r\nexport * from \"./Blocks/geometryInfoBlock\";\r\nexport * from \"./Blocks/mappingBlock\";\r\nexport * from \"./Blocks/matrixComposeBlock\";\r\nexport * from \"./Blocks/Teleport/teleportInBlock\";\r\nexport * from \"./Blocks/Teleport/teleportOutBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureFetchBlock\";\r\nexport * from \"./Blocks/boundingBlock\";\r\nexport * from \"./Blocks/booleanGeometryBlock\";\r\n"]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AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC","sourcesContent":["export * from \"./nodeGeometry\";\r\nexport * from \"./nodeGeometryBlock\";\r\nexport * from \"./nodeGeometryBlockConnectionPoint\";\r\nexport * from \"./nodeGeometryBuildState\";\r\nexport * from \"./Interfaces/nodeGeometryExecutionContext\";\r\nexport * from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nexport * from \"./Enums/nodeGeometryContextualSources\";\r\nexport * from \"./Blocks/geometryOptimizeBlock\";\r\nexport * from \"./Blocks/geometryOutputBlock\";\r\nexport * from \"./Blocks/geometryInputBlock\";\r\nexport * from \"./Blocks/Sources/planeBlock\";\r\nexport * from \"./Blocks/Sources/boxBlock\";\r\nexport * from \"./Blocks/Sources/meshBlock\";\r\nexport * from \"./Blocks/Sources/icoSphereBlock\";\r\nexport * from \"./Blocks/Sources/sphereBlock\";\r\nexport * from \"./Blocks/Sources/gridBlock\";\r\nexport * from \"./Blocks/Sources/torusBlock\";\r\nexport * from \"./Blocks/Sources/cylinderBlock\";\r\nexport * from \"./Blocks/Sources/capsuleBlock\";\r\nexport * from \"./Blocks/Sources/discBlock\";\r\nexport * from \"./Blocks/Sources/nullBlock\";\r\nexport * from \"./Blocks/Set/setPositionsBlock\";\r\nexport * from \"./Blocks/Set/setNormalsBlock\";\r\nexport * from \"./Blocks/Set/setUVsBlock\";\r\nexport * from \"./Blocks/Set/setColorsBlock\";\r\nexport * from \"./Blocks/Set/setTangentsBlock\";\r\nexport * from \"./Blocks/mathBlock\";\r\nexport * from \"./Blocks/mapRangeBlock\";\r\nexport * from \"./Blocks/conditionBlock\";\r\nexport * from \"./Blocks/randomBlock\";\r\nexport * from \"./Blocks/noiseBlock\";\r\nexport * from \"./Blocks/mergeGeometryBlock\";\r\nexport * from \"./Blocks/geometryCollectionBlock\";\r\nexport * from \"./Blocks/geometryElbowBlock\";\r\nexport * from \"./Blocks/computeNormalsBlock\";\r\nexport * from \"./Blocks/vectorConverterBlock\";\r\nexport * from \"./Blocks/normalizeVectorBlock\";\r\nexport * from \"./Blocks/Set/setMaterialIDBlock\";\r\nexport * from \"./Blocks/geometryTrigonometryBlock\";\r\nexport * from \"./Blocks/geometryTransformBlock\";\r\nexport * from \"./Blocks/Matrices/rotationXBlock\";\r\nexport * from \"./Blocks/Matrices/rotationYBlock\";\r\nexport * from \"./Blocks/Matrices/rotationZBlock\";\r\nexport * from \"./Blocks/Matrices/scalingBlock\";\r\nexport * from \"./Blocks/Matrices/alignBlock\";\r\nexport * from \"./Blocks/Matrices/translationBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVerticesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnFacesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVolumeBlock\";\r\nexport * from \"./Blocks/Instances/instantiateBlock\";\r\nexport * from \"./Blocks/Instances/instantiateLinearBlock\";\r\nexport * from \"./Blocks/Instances/instantiateRadialBlock\";\r\nexport * from \"./Blocks/intFloatConverterBlock\";\r\nexport * from \"./Blocks/debugBlock\";\r\nexport * from \"./Blocks/geometryInfoBlock\";\r\nexport * from \"./Blocks/mappingBlock\";\r\nexport * from \"./Blocks/matrixComposeBlock\";\r\nexport * from \"./Blocks/Teleport/teleportInBlock\";\r\nexport * from \"./Blocks/Teleport/teleportOutBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureFetchBlock\";\r\nexport * from \"./Blocks/boundingBlock\";\r\nexport * from \"./Blocks/booleanGeometryBlock\";\r\n"]}
|
package/Meshes/geometry.js
CHANGED
|
@@ -173,7 +173,12 @@ export class Geometry {
|
|
|
173
173
|
// to avoid converting to Float32Array at each draw call in engine.updateDynamicVertexBuffer, we make the conversion a single time here
|
|
174
174
|
data = new Float32Array(data);
|
|
175
175
|
}
|
|
176
|
-
const buffer = new VertexBuffer(this._engine, data, kind,
|
|
176
|
+
const buffer = new VertexBuffer(this._engine, data, kind, {
|
|
177
|
+
updatable,
|
|
178
|
+
postponeInternalCreation: this._meshes.length === 0,
|
|
179
|
+
stride,
|
|
180
|
+
label: "Geometry_" + this.id + "_" + kind,
|
|
181
|
+
});
|
|
177
182
|
this.setVerticesBuffer(buffer);
|
|
178
183
|
}
|
|
179
184
|
/**
|
|
@@ -213,7 +218,8 @@ export class Geometry {
|
|
|
213
218
|
}
|
|
214
219
|
else {
|
|
215
220
|
if (data != null) {
|
|
216
|
-
this._totalVertices =
|
|
221
|
+
this._totalVertices =
|
|
222
|
+
data.length / (buffer.type === VertexBuffer.BYTE || buffer.type === VertexBuffer.UNSIGNED_BYTE ? buffer.byteStride : buffer.byteStride / 4);
|
|
217
223
|
}
|
|
218
224
|
}
|
|
219
225
|
this._updateExtend(data);
|