x_ite 9.4.5 → 9.5.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/README.md +19 -5
- package/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +33 -17
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +25 -25
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +20 -20
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +45 -60
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +40 -39
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +9 -9
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +28 -28
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +25 -27
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +181 -194
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +20 -22
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +19 -21
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +38 -38
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +24 -24
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjection.js +15 -15
- package/dist/assets/components/TextureProjection.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +40 -36
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +19 -19
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +363 -15
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.d.ts +1 -1
- package/dist/x_ite.js +2311 -1682
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.min.mjs +1 -1
- package/dist/x_ite.mjs +2311 -1682
- package/dist/x_ite.zip +0 -0
- package/package.json +4 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/* X_ITE v9.
|
|
1
|
+
/* X_ITE v9.5.1 */(() => { // webpackBootstrap
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
5
|
/***/ 823:
|
|
6
6
|
/***/ ((module) => {
|
|
7
7
|
|
|
8
|
-
module.exports = window [Symbol .for ("X_ITE.X3D-9.
|
|
8
|
+
module.exports = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("lib/jquery");
|
|
9
9
|
|
|
10
10
|
/***/ })
|
|
11
11
|
|
|
@@ -73,96 +73,35 @@ var __webpack_exports__ = {};
|
|
|
73
73
|
// UNUSED EXPORTS: default
|
|
74
74
|
|
|
75
75
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components\")"
|
|
76
|
-
const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
76
|
+
const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Components");
|
|
77
77
|
var Components_default = /*#__PURE__*/__webpack_require__.n(Components_namespaceObject);
|
|
78
78
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Fields\")"
|
|
79
|
-
const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
79
|
+
const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Fields");
|
|
80
80
|
var Fields_default = /*#__PURE__*/__webpack_require__.n(Fields_namespaceObject);
|
|
81
81
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DFieldDefinition\")"
|
|
82
|
-
const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
82
|
+
const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Base/X3DFieldDefinition");
|
|
83
83
|
var X3DFieldDefinition_default = /*#__PURE__*/__webpack_require__.n(X3DFieldDefinition_namespaceObject);
|
|
84
84
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/FieldDefinitionArray\")"
|
|
85
|
-
const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
85
|
+
const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Base/FieldDefinitionArray");
|
|
86
86
|
var FieldDefinitionArray_default = /*#__PURE__*/__webpack_require__.n(FieldDefinitionArray_namespaceObject);
|
|
87
87
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Core/X3DNode\")"
|
|
88
|
-
const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
88
|
+
const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Components/Core/X3DNode");
|
|
89
89
|
var X3DNode_default = /*#__PURE__*/__webpack_require__.n(X3DNode_namespaceObject);
|
|
90
|
-
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/
|
|
91
|
-
const
|
|
92
|
-
var
|
|
93
|
-
;// CONCATENATED MODULE: ./src/x_ite/Browser/ParticleSystems/GeometryTypes.js
|
|
94
|
-
/*******************************************************************************
|
|
95
|
-
*
|
|
96
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
97
|
-
*
|
|
98
|
-
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
99
|
-
*
|
|
100
|
-
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
101
|
-
*
|
|
102
|
-
* The copyright notice above does not evidence any actual of intended
|
|
103
|
-
* publication of such source code, and is an unpublished work by create3000.
|
|
104
|
-
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
105
|
-
* create3000.
|
|
106
|
-
*
|
|
107
|
-
* No permission is granted to copy, distribute, or create derivative works from
|
|
108
|
-
* the contents of this software, in whole or in part, without the prior written
|
|
109
|
-
* permission of create3000.
|
|
110
|
-
*
|
|
111
|
-
* NON-MILITARY USE ONLY
|
|
112
|
-
*
|
|
113
|
-
* All create3000 software are effectively free software with a non-military use
|
|
114
|
-
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
115
|
-
* source in any way you please with the exception anything that uses it must be
|
|
116
|
-
* marked to indicate is contains 'non-military use only' components.
|
|
117
|
-
*
|
|
118
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
119
|
-
*
|
|
120
|
-
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
121
|
-
*
|
|
122
|
-
* This file is part of the X_ITE Project.
|
|
123
|
-
*
|
|
124
|
-
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
125
|
-
* terms of the GNU General Public License version 3 only, as published by the
|
|
126
|
-
* Free Software Foundation.
|
|
127
|
-
*
|
|
128
|
-
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
129
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
130
|
-
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
131
|
-
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
132
|
-
*
|
|
133
|
-
* You should have received a copy of the GNU General Public License version 3
|
|
134
|
-
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
135
|
-
* copy of the GPLv3 License.
|
|
136
|
-
*
|
|
137
|
-
* For Silvio, Joy and Adi.
|
|
138
|
-
*
|
|
139
|
-
******************************************************************************/
|
|
140
|
-
|
|
141
|
-
let i = 0;
|
|
142
|
-
|
|
143
|
-
const GeometryTypes = {
|
|
144
|
-
POINT: i ++,
|
|
145
|
-
LINE: i ++,
|
|
146
|
-
TRIANGLE: i ++,
|
|
147
|
-
QUAD: i ++,
|
|
148
|
-
SPRITE: i ++,
|
|
149
|
-
GEOMETRY: i ++,
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
const __default__ = GeometryTypes;
|
|
153
|
-
;
|
|
154
|
-
|
|
155
|
-
Namespace_default().add ("GeometryTypes", "x_ite/Browser/ParticleSystems/GeometryTypes", __default__);
|
|
156
|
-
/* harmony default export */ const ParticleSystems_GeometryTypes = (__default__);
|
|
90
|
+
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Browser/ParticleSystems/GeometryTypes\")"
|
|
91
|
+
const GeometryTypes_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Browser/ParticleSystems/GeometryTypes");
|
|
92
|
+
var GeometryTypes_default = /*#__PURE__*/__webpack_require__.n(GeometryTypes_namespaceObject);
|
|
157
93
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DConstants\")"
|
|
158
|
-
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
94
|
+
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Base/X3DConstants");
|
|
159
95
|
var X3DConstants_default = /*#__PURE__*/__webpack_require__.n(X3DConstants_namespaceObject);
|
|
96
|
+
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Namespace\")"
|
|
97
|
+
const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Namespace");
|
|
98
|
+
var Namespace_default = /*#__PURE__*/__webpack_require__.n(Namespace_namespaceObject);
|
|
160
99
|
;// CONCATENATED MODULE: ./src/x_ite/Browser/ParticleSystems/Line3.glsl.js
|
|
161
|
-
const
|
|
100
|
+
const __default__ = /* glsl */ `struct Line3{vec3 point;vec3 direction;};bool intersects(const in Line3 line,const in vec3 a,const in vec3 b,const in vec3 c,out vec3 r){vec3 edge1=b-a;vec3 edge2=c-a;vec3 pvec=cross(line.direction,edge2);float det=dot(edge1,pvec);if(det==0.0)return false;float inv_det=1.0/det;vec3 tvec=line.point-a;float u=dot(tvec,pvec)*inv_det;if(u<0.0||u>1.0)return false;vec3 qvec=cross(tvec,edge1);float v=dot(line.direction,qvec)*inv_det;if(v<0.0||u+v>1.0)return false;r=vec3(u,v,1.0-u-v);return true;}`
|
|
162
101
|
;
|
|
163
102
|
|
|
164
|
-
Namespace_default().add ("Line3.glsl", "x_ite/Browser/ParticleSystems/Line3.glsl",
|
|
165
|
-
/* harmony default export */ const Line3_glsl = (
|
|
103
|
+
Namespace_default().add ("Line3.glsl", "x_ite/Browser/ParticleSystems/Line3.glsl", __default__);
|
|
104
|
+
/* harmony default export */ const Line3_glsl = (__default__);
|
|
166
105
|
;// CONCATENATED MODULE: ./src/x_ite/Browser/ParticleSystems/Plane3.glsl.js
|
|
167
106
|
const Plane3_glsl_default_ = /* glsl */ `struct Plane3{vec3 normal;float distanceFromOrigin;};Plane3 plane3(const in vec3 point,const in vec3 normal){return Plane3(normal,dot(normal,point));}float plane_distance(const in Plane3 plane,const in vec3 point){return dot(point,plane.normal)-plane.distanceFromOrigin;}bool intersects(const in Plane3 plane,const in Line3 line,out vec3 point){float theta=dot(line.direction,plane.normal);if(theta==0.0)return false;float t=(plane.distanceFromOrigin-dot(plane.normal,line.point))/theta;point=line.point+line.direction*t;return true;}void sort(inout vec4 points[ARRAY_SIZE],const in int count,const in Plane3 plane){const float shrink=1.0/1.3;int gap=count;bool exchanged=true;while(exchanged){gap=int(float(gap)*shrink);if(gap<=1){exchanged=false;gap=1;}for(int i=0,l=count-gap;i<l;++i){int j=gap+i;if(plane_distance(plane,points[i].xyz)>plane_distance(plane,points[j].xyz)){vec4 tmp1=points[i];points[i]=points[j];points[j]=tmp1;exchanged=true;}}}}int min_index(const in vec4 points[ARRAY_SIZE],const in int count,const in float value,const in Plane3 plane){int index=-1;float dist=1000000.0;for(int i=0;i<count;++i){float d=plane_distance(plane,points[i].xyz);if(d>=value&&d<dist){dist=d;index=i;}}return index;}`
|
|
168
107
|
;
|
|
@@ -179,7 +118,7 @@ Namespace_default().add ("Box3.glsl", "x_ite/Browser/ParticleSystems/Box3.glsl",
|
|
|
179
118
|
const BVH_glsl_default_ = /* glsl */ `#define BVH_NODE 0
|
|
180
119
|
#define BVH_TRIANGLE 1
|
|
181
120
|
#define BVH_STACK_SIZE 32
|
|
182
|
-
int bvhNodeIndex=0;void setBVHIndex(const in int index){bvhNodeIndex=index;}int getBVHRoot(const in sampler2D volume,const in int hierarchyIndex,const in int rootIndex){return int(texelFetch(volume,rootIndex,0).x)+hierarchyIndex;}int getBVHType(const in sampler2D volume){return int(texelFetch(volume,bvhNodeIndex,0).x);}vec3 getBVHMin(const in sampler2D volume){return texelFetch(volume,bvhNodeIndex+1,0).xyz;}vec3 getBVHMax(const in sampler2D volume){return texelFetch(volume,bvhNodeIndex+2,0).xyz;}int getBVHLeft(const in sampler2D volume,const in int hierarchyIndex){return int(texelFetch(volume,bvhNodeIndex,0).y)+hierarchyIndex;}int getBVHRight(const in sampler2D volume,const in int hierarchyIndex){return int(texelFetch(volume,bvhNodeIndex,0).z)+hierarchyIndex;}int getBVHTriangle(const in sampler2D volume){return int(texelFetch(volume,bvhNodeIndex,0).y);}int getIntersections(const in sampler2D volume,const in int verticesIndex,const in int hierarchyIndex,const in int rootIndex,const in Line3 line,out vec4 points[ARRAY_SIZE]){int current=getBVHRoot(volume,hierarchyIndex,rootIndex);int count=0;int stackIndex=-1;int stack[BVH_STACK_SIZE];while(stackIndex>=0||current>=0){if(current>=0){setBVHIndex(current);if(getBVHType(volume)==BVH_NODE){if(intersects(getBVHMin(volume),getBVHMax(volume),line)){stack[++stackIndex]=current;current=getBVHLeft(volume,hierarchyIndex);}else{current=-1;}}else{int t=getBVHTriangle(volume);int v=verticesIndex+t;vec3 r=vec3(0.0);vec3 a=texelFetch(volume,v,0).xyz;vec3 b=texelFetch(volume,v+1,0).xyz;vec3 c=texelFetch(volume,v+2,0).xyz;if(intersects(line,a,b,c,r))points[count++]=vec4(r.z*a+r.x*b+r.y*c,1.0);current=-1;}}else{setBVHIndex(stack[stackIndex--]);current=getBVHRight(volume,hierarchyIndex);}}return count;}int getIntersections(const in sampler2D volume,const in int verticesIndex,const in int normalsIndex,const in int hierarchyIndex,const in int rootIndex,const in Line3 line,out vec4 points[ARRAY_SIZE],out vec3 normals[ARRAY_SIZE]){int current=getBVHRoot(volume,hierarchyIndex,rootIndex);int count=0;int stackIndex=-1;int stack[BVH_STACK_SIZE];while(stackIndex>=0||current>=0){if(current>=0){setBVHIndex(current);if(getBVHType(volume)==BVH_NODE){if(intersects(getBVHMin(volume),getBVHMax(volume),line)){stack[++stackIndex]=current;current=getBVHLeft(volume,hierarchyIndex);}else{current=-1;}}else{int t=getBVHTriangle(volume);int v=verticesIndex+t;vec3 r=vec3(0.0);vec3 a=texelFetch(volume,v,0).xyz;vec3 b=texelFetch(volume,v+1,0).xyz;vec3 c=texelFetch(volume,v+2,0).xyz;if(intersects(line,a,b,c,r)){points[count]=vec4(r.z*a+r.x*b+r.y*c,1.0);int n=normalsIndex+t;vec3 n0=texelFetch(volume,n,0).xyz;vec3 n1=texelFetch(volume,n+1,0).xyz;vec3 n2=texelFetch(volume,n+2,0).xyz;normals[count]=
|
|
121
|
+
int bvhNodeIndex=0;void setBVHIndex(const in int index){bvhNodeIndex=index;}int getBVHRoot(const in sampler2D volume,const in int hierarchyIndex,const in int rootIndex){return int(texelFetch(volume,rootIndex,0).x)+hierarchyIndex;}int getBVHType(const in sampler2D volume){return int(texelFetch(volume,bvhNodeIndex,0).x);}vec3 getBVHMin(const in sampler2D volume){return texelFetch(volume,bvhNodeIndex+1,0).xyz;}vec3 getBVHMax(const in sampler2D volume){return texelFetch(volume,bvhNodeIndex+2,0).xyz;}int getBVHLeft(const in sampler2D volume,const in int hierarchyIndex){return int(texelFetch(volume,bvhNodeIndex,0).y)+hierarchyIndex;}int getBVHRight(const in sampler2D volume,const in int hierarchyIndex){return int(texelFetch(volume,bvhNodeIndex,0).z)+hierarchyIndex;}int getBVHTriangle(const in sampler2D volume){return int(texelFetch(volume,bvhNodeIndex,0).y);}int getIntersections(const in sampler2D volume,const in int verticesIndex,const in int hierarchyIndex,const in int rootIndex,const in Line3 line,out vec4 points[ARRAY_SIZE]){int current=getBVHRoot(volume,hierarchyIndex,rootIndex);int count=0;int stackIndex=-1;int stack[BVH_STACK_SIZE];while(stackIndex>=0||current>=0){if(current>=0){setBVHIndex(current);if(getBVHType(volume)==BVH_NODE){if(intersects(getBVHMin(volume),getBVHMax(volume),line)){stack[++stackIndex]=current;current=getBVHLeft(volume,hierarchyIndex);}else{current=-1;}}else{int t=getBVHTriangle(volume);int v=verticesIndex+t;vec3 r=vec3(0.0);vec3 a=texelFetch(volume,v,0).xyz;vec3 b=texelFetch(volume,v+1,0).xyz;vec3 c=texelFetch(volume,v+2,0).xyz;if(intersects(line,a,b,c,r))points[count++]=vec4(r.z*a+r.x*b+r.y*c,1.0);current=-1;}}else{setBVHIndex(stack[stackIndex--]);current=getBVHRight(volume,hierarchyIndex);}}return count;}int getIntersections(const in sampler2D volume,const in int verticesIndex,const in int normalsIndex,const in int hierarchyIndex,const in int rootIndex,const in Line3 line,out vec4 points[ARRAY_SIZE],out vec3 normals[ARRAY_SIZE]){int current=getBVHRoot(volume,hierarchyIndex,rootIndex);int count=0;int stackIndex=-1;int stack[BVH_STACK_SIZE];while(stackIndex>=0||current>=0){if(current>=0){setBVHIndex(current);if(getBVHType(volume)==BVH_NODE){if(intersects(getBVHMin(volume),getBVHMax(volume),line)){stack[++stackIndex]=current;current=getBVHLeft(volume,hierarchyIndex);}else{current=-1;}}else{int t=getBVHTriangle(volume);int v=verticesIndex+t;vec3 r=vec3(0.0);vec3 a=texelFetch(volume,v,0).xyz;vec3 b=texelFetch(volume,v+1,0).xyz;vec3 c=texelFetch(volume,v+2,0).xyz;if(intersects(line,a,b,c,r)){points[count]=vec4(r.z*a+r.x*b+r.y*c,1.0);int n=normalsIndex+t;vec3 n0=texelFetch(volume,n,0).xyz;vec3 n1=texelFetch(volume,n+1,0).xyz;vec3 n2=texelFetch(volume,n+2,0).xyz;normals[count]=r.z*n0+r.x*n1+r.y*n2;++count;}current=-1;}}else{setBVHIndex(stack[stackIndex--]);current=getBVHRight(volume,hierarchyIndex);}}return count;}`
|
|
183
122
|
;
|
|
184
123
|
|
|
185
124
|
Namespace_default().add ("BVH.glsl", "x_ite/Browser/ParticleSystems/BVH.glsl", BVH_glsl_default_);
|
|
@@ -343,7 +282,7 @@ Object .assign (Object .setPrototypeOf (X3DParticleEmitterNode .prototype, (X3DN
|
|
|
343
282
|
browser = this .getBrowser (),
|
|
344
283
|
gl = browser .getContext (),
|
|
345
284
|
inputParticles = particleSystem .inputParticles,
|
|
346
|
-
|
|
285
|
+
particlesStride = particleSystem .particlesStride,
|
|
347
286
|
particleOffsets = particleSystem .particleOffsets,
|
|
348
287
|
program = this .program;
|
|
349
288
|
|
|
@@ -422,15 +361,14 @@ Object .assign (Object .setPrototypeOf (X3DParticleEmitterNode .prototype, (X3DN
|
|
|
422
361
|
{
|
|
423
362
|
gl .bindBuffer (gl .ARRAY_BUFFER, inputParticles);
|
|
424
363
|
gl .enableVertexAttribArray (attribute);
|
|
425
|
-
gl .vertexAttribPointer (attribute, 4, gl .FLOAT, false,
|
|
364
|
+
gl .vertexAttribPointer (attribute, 4, gl .FLOAT, false, particlesStride, particleOffsets [i]);
|
|
426
365
|
}
|
|
427
|
-
|
|
428
|
-
gl .bindBuffer (gl .ARRAY_BUFFER, null);
|
|
429
366
|
}
|
|
430
367
|
|
|
431
368
|
// Transform particles.
|
|
432
369
|
|
|
433
370
|
gl .bindFramebuffer (gl .FRAMEBUFFER, null); // Prevent texture feedback loop error, see NYC in Firefox.
|
|
371
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, null);
|
|
434
372
|
gl .bindTransformFeedback (gl .TRANSFORM_FEEDBACK, this .transformFeedback);
|
|
435
373
|
gl .bindBufferBase (gl .TRANSFORM_FEEDBACK_BUFFER, 0, particleSystem .outputParticles);
|
|
436
374
|
gl .enable (gl .RASTERIZER_DISCARD);
|
|
@@ -442,10 +380,10 @@ Object .assign (Object .setPrototypeOf (X3DParticleEmitterNode .prototype, (X3DN
|
|
|
442
380
|
|
|
443
381
|
// DEBUG
|
|
444
382
|
|
|
445
|
-
// const data = new Float32Array (particleSystem .numParticles * (
|
|
383
|
+
// const data = new Float32Array (particleSystem .numParticles * (particlesStride / 4));
|
|
446
384
|
// gl .bindBuffer (gl .ARRAY_BUFFER, particleSystem .outputParticles);
|
|
447
385
|
// gl .getBufferSubData (gl .ARRAY_BUFFER, 0, data);
|
|
448
|
-
// console .log (data .slice (0,
|
|
386
|
+
// console .log (data .slice (0, particlesStride / 4));
|
|
449
387
|
},
|
|
450
388
|
addSampler (name)
|
|
451
389
|
{
|
|
@@ -478,10 +416,10 @@ Object .assign (Object .setPrototypeOf (X3DParticleEmitterNode .prototype, (X3DN
|
|
|
478
416
|
precision highp float;precision highp int;precision highp sampler2D;uniform int randomSeed;uniform int geometryType;uniform bool createParticles;uniform float particleLifetime;uniform float lifetimeVariation;uniform float deltaTime;uniform vec2 particleSize;uniform int numForces;uniform sampler2D forces;uniform int boundedVerticesIndex;uniform int boundedNormalsIndex;uniform int boundedHierarchyIndex;uniform int boundedHierarchyRoot;uniform sampler2D boundedVolume;uniform int numColors;uniform sampler2D colorRamp;uniform int texCoordCount;uniform int numTexCoords;uniform sampler2D texCoordRamp;
|
|
479
417
|
${Object .values (this .uniforms) .join ("\n")}
|
|
480
418
|
in vec4 input0;in vec4 input2;in vec4 input6;out vec4 output0;out vec4 output1;out vec4 output2;out vec4 output3;out vec4 output4;out vec4 output5;out vec4 output6;
|
|
481
|
-
${Object .entries (
|
|
419
|
+
${Object .entries ((GeometryTypes_default())) .map (([k, v]) => `#define ${k} ${v}`) .join ("\n")}
|
|
482
420
|
const int ARRAY_SIZE=32;const float M_PI=3.14159265359;uniform float NaN;vec4 texelFetch(const in sampler2D sampler,const in int index,const in int lod){int x=textureSize(sampler,lod).x;ivec2 p=ivec2(index % x,index/x);vec4 t=texelFetch(sampler,p,lod);return t;}vec3 save_normalize(const in vec3 vector){float l=length(vector);if(l==0.0)return vec3(0.0);return vector/l;}vec4 Quaternion(const in vec3 fromVector,const in vec3 toVector){vec3 from=save_normalize(fromVector);vec3 to=save_normalize(toVector);float cos_angle=dot(from,to);vec3 cross_vec=cross(from,to);float cross_len=length(cross_vec);if(cross_len==0.0){if(cos_angle>0.0){return vec4(0.0,0.0,0.0,1.0);}else{vec3 t=cross(from,vec3(1.0,0.0,0.0));if(dot(t,t)==0.0)t=cross(from,vec3(0.0,1.0,0.0));t=save_normalize(t);return vec4(t,0.0);}}else{float s=sqrt(abs(1.0-cos_angle)*0.5);cross_vec=save_normalize(cross_vec);return vec4(cross_vec*s,sqrt(abs(1.0+cos_angle)*0.5));}}vec3 multVecQuat(const in vec3 v,const in vec4 q){float a=q.w*q.w-q.x*q.x-q.y*q.y-q.z*q.z;float b=2.0*(v.x*q.x+v.y*q.y+v.z*q.z);float c=2.0*q.w;vec3 r=a*v.xyz+b*q.xyz+c*(q.yzx*v.zxy-q.zxy*v.yzx);return r;}mat3 Matrix3(const in vec4 quaternion){float x=quaternion.x;float y=quaternion.y;float z=quaternion.z;float w=quaternion.w;float A=y*y;float B=z*z;float C=x*y;float D=z*w;float E=z*x;float F=y*w;float G=x*x;float H=y*z;float I=x*w;return mat3(1.0-2.0*(A+B),2.0*(C+D),2.0*(E-F),2.0*(C-D),1.0-2.0*(B+G),2.0*(H+I),2.0*(E+F),2.0*(H-I),1.0-2.0*(A+G));}uint seed=1u;void srand(const in int value){seed=uint(value);}float random(){seed=seed*1103515245u+12345u;return float(seed)/4294967295.0;}float getRandomValue(const in float min,const in float max){return min+random()*(max-min);}float getRandomLifetime(){float v=particleLifetime*lifetimeVariation;float min_=max(0.0,particleLifetime-v);float max_=particleLifetime+v;return getRandomValue(min_,max_);}float getRandomSpeed(){float v=speed*variation;float min_=max(0.0,speed-v);float max_=speed+v;return getRandomValue(min_,max_);}vec3 getRandomNormal(){float theta=getRandomValue(-M_PI,M_PI);float cphi=getRandomValue(-1.0,1.0);float r=sqrt(1.0-cphi*cphi);return vec3(sin(theta)*r,cos(theta)*r,cphi);}vec3 getRandomNormalWithAngle(const in float angle){float theta=getRandomValue(-M_PI,M_PI);float cphi=getRandomValue(cos(angle),1.0);float r=sqrt(1.0-cphi*cphi);return vec3(sin(theta)*r,cos(theta)*r,cphi);}vec3 getRandomNormalWithDirectionAndAngle(const in vec3 direction,const in float angle){vec4 rotation=Quaternion(vec3(0.0,0.0,1.0),direction);vec3 normal=getRandomNormalWithAngle(angle);return multVecQuat(normal,rotation);}vec3 getRandomSurfaceNormal(const in vec3 direction){float theta=getRandomValue(-M_PI,M_PI);float cphi=pow(random(),1.0/3.0);float r=sqrt(1.0-cphi*cphi);vec3 normal=vec3(sin(theta)*r,cos(theta)*r,cphi);vec4 rotation=Quaternion(vec3(0.0,0.0,1.0),direction);return multVecQuat(normal,rotation);}vec3 getRandomSphericalVelocity(){vec3 normal=getRandomNormal();float speed=getRandomSpeed();return normal*speed;}int upperBound(const in sampler2D sampler,in int count,const in float value){int first=0;int step=0;while(count>0){int index=first;step=count>>1;index+=step;if(value<texelFetch(sampler,index,0).x){count=step;}else{first=++index;count-=step+1;}}return first;}void interpolate(const in sampler2D sampler,const in int count,const in float fraction,out int index0,out int index1,out float weight){if(count==1||fraction<=texelFetch(sampler,0,0).x){index0=0;index1=0;weight=0.0;}else if(fraction>=texelFetch(sampler,count-1,0).x){index0=count-2;index1=count-1;weight=1.0;}else{int index=upperBound(sampler,count,fraction);if(index<count){index1=index;index0=index-1;float key0=texelFetch(sampler,index0,0).x;float key1=texelFetch(sampler,index1,0).x;weight=clamp((fraction-key0)/(key1-key0),0.0,1.0);}else{index0=0;index1=0;weight=0.0;}}}void interpolate(const in sampler2D sampler,const in int count,const in float fraction,out int index0){if(count==1||fraction<=texelFetch(sampler,0,0).x){index0=0;}else if(fraction>=texelFetch(sampler,count-1,0).x){index0=count-2;}else{int index=upperBound(sampler,count,fraction);if(index<count)index0=index-1;else index0=0;}}vec3 getRandomBarycentricCoord(){float u=random();float v=random();if(u+v>1.0){u=1.0-u;v=1.0-v;}float t=1.0-u-v;return vec3(t,u,v);}void getRandomPointOnSurface(const in sampler2D surface,const in int verticesIndex,const in int normalsIndex,out vec4 position,out vec3 normal){float lastAreaSoFar=texelFetch(surface,verticesIndex-1,0).x;float fraction=random()*lastAreaSoFar;int index0;int index1;int index2;float weight;interpolate(surface,verticesIndex,fraction,index0,index1,weight);index0*=3;index1=index0+1;index2=index0+2;vec4 vertex0=texelFetch(surface,verticesIndex+index0,0);vec4 vertex1=texelFetch(surface,verticesIndex+index1,0);vec4 vertex2=texelFetch(surface,verticesIndex+index2,0);vec3 normal0=texelFetch(surface,normalsIndex+index0,0).xyz;vec3 normal1=texelFetch(surface,normalsIndex+index1,0).xyz;vec3 normal2=texelFetch(surface,normalsIndex+index2,0).xyz;vec3 r=getRandomBarycentricCoord();position=r.z*vertex0+r.x*vertex1+r.y*vertex2;normal=save_normalize(r.z*normal0+r.x*normal1+r.y*normal2);}
|
|
483
421
|
${this .functions .join ("\n")}
|
|
484
|
-
vec4 getColor(const in float lifetime,const in float elapsedTime){if(numColors>0){float fraction=elapsedTime/lifetime;int index0;int index1;float weight;interpolate(colorRamp,numColors,fraction,index0,index1,weight);vec4 color0=texelFetch(colorRamp,numColors+index0,0);vec4 color1=texelFetch(colorRamp,numColors+index1,0);return mix(color0,color1,weight);}else{return vec4(1.0);}}void bounce(const in vec4 fromPosition,inout vec4 toPosition,inout vec3 velocity){if(boundedHierarchyRoot<0)return;Line3 line=Line3(fromPosition.xyz,save_normalize(velocity));vec4 points[ARRAY_SIZE];vec3 normals[ARRAY_SIZE];int numIntersections=getIntersections(boundedVolume,boundedVerticesIndex,boundedNormalsIndex,boundedHierarchyIndex,boundedHierarchyRoot,line,points,normals);if(numIntersections==0)return;Plane3 plane1=plane3(line.point,line.direction);int index=min_index(points,numIntersections,0.0,plane1);if(index==-1)return;
|
|
422
|
+
vec4 getColor(const in float lifetime,const in float elapsedTime){if(numColors>0){float fraction=elapsedTime/lifetime;int index0;int index1;float weight;interpolate(colorRamp,numColors,fraction,index0,index1,weight);vec4 color0=texelFetch(colorRamp,numColors+index0,0);vec4 color1=texelFetch(colorRamp,numColors+index1,0);return mix(color0,color1,weight);}else{return vec4(1.0);}}void bounce(const in float deltaTime,const in vec4 fromPosition,inout vec4 toPosition,inout vec3 velocity){if(boundedHierarchyRoot<0)return;Line3 line=Line3(fromPosition.xyz,save_normalize(velocity));vec4 points[ARRAY_SIZE];vec3 normals[ARRAY_SIZE];int numIntersections=getIntersections(boundedVolume,boundedVerticesIndex,boundedNormalsIndex,boundedHierarchyIndex,boundedHierarchyRoot,line,points,normals);if(numIntersections==0)return;Plane3 plane1=plane3(line.point,line.direction);int index=min_index(points,numIntersections,0.0,plane1);if(index==-1)return;vec3 point=points[index].xyz;vec3 normal=save_normalize(normals[index]);Plane3 plane2=plane3(point,normal);if(sign(plane_distance(plane2,fromPosition.xyz))==sign(plane_distance(plane2,toPosition.xyz)))return;float damping=length(normals[index]);velocity=reflect(velocity,normal);toPosition=vec4(point+save_normalize(velocity)*0.0001,1.0);velocity*=damping;}int getTexCoordIndex0(const in float lifetime,const in float elapsedTime){if(numTexCoords==0){return-1;}else{float fraction=elapsedTime/lifetime;int index0=0;interpolate(texCoordRamp,numTexCoords,fraction,index0);return numTexCoords+index0*texCoordCount;}}void main(){int life=int(input0[0]);float lifetime=input0[1];float elapsedTime=input0[2]+deltaTime;srand((gl_VertexID+randomSeed)*randomSeed);if(elapsedTime>lifetime){lifetime=getRandomLifetime();elapsedTime=0.0;output0=vec4(max(life+1,1),lifetime,elapsedTime,getTexCoordIndex0(lifetime,elapsedTime));if(createParticles){output1=getColor(lifetime,elapsedTime);output2=vec4(getRandomVelocity(),0.0);output6=getRandomPosition();}else{output1=vec4(0.0);output2=vec4(0.0);output6=vec4(NaN);}}else{vec3 velocity=input2.xyz;vec4 position=input6;for(int i=0;i<numForces;++i){vec4 force=texelFetch(forces,i,0);float turbulence=force.w;vec3 normal=getRandomNormalWithDirectionAndAngle(force.xyz,turbulence);float speed=length(force.xyz);velocity+=normal*speed;}position.xyz+=velocity*deltaTime;bounce(deltaTime,input6,position,velocity);output0=vec4(life,lifetime,elapsedTime,getTexCoordIndex0(lifetime,elapsedTime));output1=getColor(lifetime,elapsedTime);output2=vec4(velocity,0.0);output6=position;}switch(geometryType){case POINT:case SPRITE:case GEOMETRY:{output3=vec4(1.0,0.0,0.0,0.0);output4=vec4(0.0,1.0,0.0,0.0);output5=vec4(0.0,0.0,1.0,0.0);break;}case LINE:{mat3 m=Matrix3(Quaternion(vec3(0.0,0.0,1.0),output2.xyz));output3=vec4(m[0],0.0);output4=vec4(m[1],0.0);output5=vec4(m[2],0.0);break;}default:{output3=vec4(particleSize.x,0.0,0.0,0.0);output4=vec4(0.0,particleSize.y,0.0,0.0);output5=vec4(0.0,0.0,1.0,0.0);break;}}}`
|
|
485
423
|
|
|
486
424
|
const fragmentShaderSource = /* glsl */ `#version 300 es
|
|
487
425
|
precision highp float;void main(){}`
|
|
@@ -618,7 +556,7 @@ const X3DParticleEmitterNode_default_ = X3DParticleEmitterNode;
|
|
|
618
556
|
Namespace_default().add ("X3DParticleEmitterNode", "x_ite/Components/ParticleSystems/X3DParticleEmitterNode", X3DParticleEmitterNode_default_);
|
|
619
557
|
/* harmony default export */ const ParticleSystems_X3DParticleEmitterNode = (X3DParticleEmitterNode_default_);
|
|
620
558
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
|
|
621
|
-
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
559
|
+
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("standard/Math/Numbers/Vector3");
|
|
622
560
|
var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
|
|
623
561
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/PointEmitter.js
|
|
624
562
|
/*******************************************************************************
|
|
@@ -937,7 +875,7 @@ const X3DParticlePhysicsModelNode_default_ = X3DParticlePhysicsModelNode;
|
|
|
937
875
|
Namespace_default().add ("X3DParticlePhysicsModelNode", "x_ite/Components/ParticleSystems/X3DParticlePhysicsModelNode", X3DParticlePhysicsModelNode_default_);
|
|
938
876
|
/* harmony default export */ const ParticleSystems_X3DParticlePhysicsModelNode = (X3DParticlePhysicsModelNode_default_);
|
|
939
877
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DCast\")"
|
|
940
|
-
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
878
|
+
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Base/X3DCast");
|
|
941
879
|
var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
|
|
942
880
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js
|
|
943
881
|
/*******************************************************************************
|
|
@@ -1013,16 +951,16 @@ Object .assign (Object .setPrototypeOf (BoundedPhysicsModel .prototype, Particle
|
|
|
1013
951
|
},
|
|
1014
952
|
set_geometry__ ()
|
|
1015
953
|
{
|
|
1016
|
-
|
|
1017
|
-
this .geometryNode ._rebuild .removeInterest ("addNodeEvent", this);
|
|
954
|
+
this .geometryNode ?._rebuild .removeInterest ("addNodeEvent", this);
|
|
1018
955
|
|
|
1019
956
|
this .geometryNode = X3DCast_default() ((X3DConstants_default()).X3DGeometryNode, this ._geometry);
|
|
1020
957
|
|
|
1021
|
-
|
|
1022
|
-
this .geometryNode ._rebuild .addInterest ("addNodeEvent", this);
|
|
958
|
+
this .geometryNode ?._rebuild .addInterest ("addNodeEvent", this);
|
|
1023
959
|
},
|
|
1024
960
|
addGeometry (boundedNormals, boundedVertices)
|
|
1025
961
|
{
|
|
962
|
+
const damping = this ._damping .getValue ();
|
|
963
|
+
|
|
1026
964
|
if (this .geometryNode && this ._enabled .getValue ())
|
|
1027
965
|
{
|
|
1028
966
|
const
|
|
@@ -1030,7 +968,7 @@ Object .assign (Object .setPrototypeOf (BoundedPhysicsModel .prototype, Particle
|
|
|
1030
968
|
vertices = this .geometryNode .getVertices () .getValue ();
|
|
1031
969
|
|
|
1032
970
|
for (const value of normals)
|
|
1033
|
-
boundedNormals .push (value);
|
|
971
|
+
boundedNormals .push (value * damping);
|
|
1034
972
|
|
|
1035
973
|
for (const value of vertices)
|
|
1036
974
|
boundedVertices .push (value);
|
|
@@ -1065,6 +1003,7 @@ Object .defineProperties (BoundedPhysicsModel,
|
|
|
1065
1003
|
value: new (FieldDefinitionArray_default()) ([
|
|
1066
1004
|
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
1067
1005
|
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "enabled", new (Fields_default()).SFBool (true)),
|
|
1006
|
+
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "damping", new (Fields_default()).SFFloat (1)), // skip test
|
|
1068
1007
|
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "geometry", new (Fields_default()).SFNode ()),
|
|
1069
1008
|
]),
|
|
1070
1009
|
enumerable: true,
|
|
@@ -1511,28 +1450,34 @@ const ForcePhysicsModel_default_ = ForcePhysicsModel;
|
|
|
1511
1450
|
Namespace_default().add ("ForcePhysicsModel", "x_ite/Components/ParticleSystems/ForcePhysicsModel", ForcePhysicsModel_default_);
|
|
1512
1451
|
/* harmony default export */ const ParticleSystems_ForcePhysicsModel = (ForcePhysicsModel_default_);
|
|
1513
1452
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/X3DShapeNode\")"
|
|
1514
|
-
const X3DShapeNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
1453
|
+
const X3DShapeNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Components/Shape/X3DShapeNode");
|
|
1515
1454
|
var X3DShapeNode_default = /*#__PURE__*/__webpack_require__.n(X3DShapeNode_namespaceObject);
|
|
1516
1455
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Browser/Rendering/GeometryContext\")"
|
|
1517
|
-
const GeometryContext_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
1456
|
+
const GeometryContext_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Browser/Rendering/GeometryContext");
|
|
1518
1457
|
var GeometryContext_default = /*#__PURE__*/__webpack_require__.n(GeometryContext_namespaceObject);
|
|
1519
1458
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/VertexArray\")"
|
|
1520
|
-
const VertexArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
1459
|
+
const VertexArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Rendering/VertexArray");
|
|
1521
1460
|
var VertexArray_default = /*#__PURE__*/__webpack_require__.n(VertexArray_namespaceObject);
|
|
1522
1461
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/TraverseType\")"
|
|
1523
|
-
const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
1462
|
+
const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Rendering/TraverseType");
|
|
1524
1463
|
var TraverseType_default = /*#__PURE__*/__webpack_require__.n(TraverseType_namespaceObject);
|
|
1525
1464
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Browser/Shape/AlphaMode\")"
|
|
1526
|
-
const AlphaMode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
1465
|
+
const AlphaMode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Browser/Shape/AlphaMode");
|
|
1527
1466
|
var AlphaMode_default = /*#__PURE__*/__webpack_require__.n(AlphaMode_namespaceObject);
|
|
1467
|
+
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Rendering/LineSet\")"
|
|
1468
|
+
const LineSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Components/Rendering/LineSet");
|
|
1469
|
+
var LineSet_default = /*#__PURE__*/__webpack_require__.n(LineSet_namespaceObject);
|
|
1470
|
+
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Rendering/Coordinate\")"
|
|
1471
|
+
const Coordinate_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Components/Rendering/Coordinate");
|
|
1472
|
+
var Coordinate_default = /*#__PURE__*/__webpack_require__.n(Coordinate_namespaceObject);
|
|
1528
1473
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Matrix4\")"
|
|
1529
|
-
const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
1474
|
+
const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("standard/Math/Numbers/Matrix4");
|
|
1530
1475
|
var Matrix4_default = /*#__PURE__*/__webpack_require__.n(Matrix4_namespaceObject);
|
|
1531
1476
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Matrix3\")"
|
|
1532
|
-
const Matrix3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
1477
|
+
const Matrix3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("standard/Math/Numbers/Matrix3");
|
|
1533
1478
|
var Matrix3_default = /*#__PURE__*/__webpack_require__.n(Matrix3_namespaceObject);
|
|
1534
1479
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Plane3\")"
|
|
1535
|
-
const Plane3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
1480
|
+
const Plane3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("standard/Math/Geometry/Plane3");
|
|
1536
1481
|
var Plane3_default = /*#__PURE__*/__webpack_require__.n(Plane3_namespaceObject);
|
|
1537
1482
|
;// CONCATENATED MODULE: ./src/standard/Math/Algorithms/QuickSort.js
|
|
1538
1483
|
/*******************************************************************************
|
|
@@ -2093,16 +2038,9 @@ Namespace_default().add ("BVH", "standard/Math/Utility/BVH", BVH_default_);
|
|
|
2093
2038
|
|
|
2094
2039
|
|
|
2095
2040
|
|
|
2096
|
-
const PointGeometry = new Float32Array ([0, 0, 0, 1]);
|
|
2097
2041
|
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
0, 0, 0, 1,
|
|
2101
|
-
1, 0, 0, 1,
|
|
2102
|
-
// Vertices
|
|
2103
|
-
0, 0, -0.5, 1,
|
|
2104
|
-
0, 0, 0.5, 1,
|
|
2105
|
-
]);
|
|
2042
|
+
|
|
2043
|
+
const PointGeometry = new Float32Array ([0, 0, 0, 1]);
|
|
2106
2044
|
|
|
2107
2045
|
// p4 ------ p3
|
|
2108
2046
|
// | / |
|
|
@@ -2165,12 +2103,14 @@ function ParticleSystem (executionContext)
|
|
|
2165
2103
|
this .creationTime = 0;
|
|
2166
2104
|
this .pauseTime = 0;
|
|
2167
2105
|
this .deltaTime = 0;
|
|
2168
|
-
this .
|
|
2106
|
+
this .particlesStride = Float32Array .BYTES_PER_ELEMENT * 7 * 4; // 7 x vec4
|
|
2169
2107
|
this .particleOffsets = Array .from ({length: 7}, (_, i) => Float32Array .BYTES_PER_ELEMENT * 4 * i); // i x vec4
|
|
2170
2108
|
this .particleOffset = this .particleOffsets [0];
|
|
2171
2109
|
this .colorOffset = this .particleOffsets [1];
|
|
2110
|
+
this .velocityOffset = this .particleOffsets [2];
|
|
2172
2111
|
this .matrixOffset = this .particleOffsets [3];
|
|
2173
2112
|
this .texCoordOffset = 0;
|
|
2113
|
+
this .instancesStride = this .particlesStride;
|
|
2174
2114
|
}
|
|
2175
2115
|
|
|
2176
2116
|
Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode_default()).prototype),
|
|
@@ -2199,6 +2139,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2199
2139
|
this ._maxParticles .addInterest ("set_enabled__", this);
|
|
2200
2140
|
this ._particleLifetime .addInterest ("set_particleLifetime__", this);
|
|
2201
2141
|
this ._lifetimeVariation .addInterest ("set_lifetimeVariation__", this);
|
|
2142
|
+
this ._particleSize .addInterest ("set_particleSize__", this);
|
|
2202
2143
|
this ._emitter .addInterest ("set_emitter__", this);
|
|
2203
2144
|
this ._physics .addInterest ("set_physics__", this);
|
|
2204
2145
|
this ._colorKey .addInterest ("set_color__", this);
|
|
@@ -2208,11 +2149,21 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2208
2149
|
|
|
2209
2150
|
// Create particles stuff.
|
|
2210
2151
|
|
|
2211
|
-
this .inputParticles
|
|
2212
|
-
|
|
2152
|
+
this .inputParticles = Object .assign (gl .createBuffer (),
|
|
2153
|
+
{
|
|
2154
|
+
vertexArrayObject: new (VertexArray_default()) (gl),
|
|
2155
|
+
thickLinesVertexArrayObject: new (VertexArray_default()) (gl),
|
|
2156
|
+
lineTrianglesBuffer: gl .createBuffer (),
|
|
2157
|
+
numLines: 0,
|
|
2158
|
+
});
|
|
2213
2159
|
|
|
2214
|
-
this .
|
|
2215
|
-
|
|
2160
|
+
this .outputParticles = Object .assign (gl .createBuffer (),
|
|
2161
|
+
{
|
|
2162
|
+
vertexArrayObject: new (VertexArray_default()) (gl),
|
|
2163
|
+
thickLinesVertexArrayObject: new (VertexArray_default()) (gl),
|
|
2164
|
+
lineTrianglesBuffer: gl .createBuffer (),
|
|
2165
|
+
numLines: 0,
|
|
2166
|
+
});
|
|
2216
2167
|
|
|
2217
2168
|
// Create forces stuff.
|
|
2218
2169
|
|
|
@@ -2226,6 +2177,19 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2226
2177
|
this .geometryBuffer = this .createBuffer ();
|
|
2227
2178
|
this .texCoordBuffers = new Array (browser .getMaxTexCoords ()) .fill (this .geometryBuffer);
|
|
2228
2179
|
|
|
2180
|
+
// Create geometry for LINE geometryType.
|
|
2181
|
+
|
|
2182
|
+
this .lineGeometryNode = new (LineSet_default()) (this .getExecutionContext ());
|
|
2183
|
+
this .lineCoordinateNode = new (Coordinate_default()) (this .getExecutionContext ());
|
|
2184
|
+
|
|
2185
|
+
this .lineCoordinateNode ._point = [0, 0, -0.5, 0, 0, 0.5];
|
|
2186
|
+
|
|
2187
|
+
this .lineGeometryNode ._vertexCount = [2];
|
|
2188
|
+
this .lineGeometryNode ._coord = this .lineCoordinateNode;
|
|
2189
|
+
|
|
2190
|
+
this .lineCoordinateNode .setup ();
|
|
2191
|
+
this .lineGeometryNode .setup ();
|
|
2192
|
+
|
|
2229
2193
|
// Init fields.
|
|
2230
2194
|
// Call order is very important at startup.
|
|
2231
2195
|
|
|
@@ -2235,6 +2199,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2235
2199
|
this .set_createParticles__ ();
|
|
2236
2200
|
this .set_particleLifetime__ ();
|
|
2237
2201
|
this .set_lifetimeVariation__ ();
|
|
2202
|
+
this .set_particleSize__ ();
|
|
2238
2203
|
this .set_physics__ ();
|
|
2239
2204
|
this .set_colorRamp__ ();
|
|
2240
2205
|
this .set_texCoordRamp__ ();
|
|
@@ -2247,16 +2212,28 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2247
2212
|
{
|
|
2248
2213
|
switch (this .geometryType)
|
|
2249
2214
|
{
|
|
2250
|
-
case
|
|
2215
|
+
case (GeometryTypes_default()).GEOMETRY:
|
|
2251
2216
|
return this .getGeometry ();
|
|
2252
2217
|
default:
|
|
2253
2218
|
return this .geometryContext;
|
|
2254
2219
|
}
|
|
2255
2220
|
},
|
|
2221
|
+
getGeometryType ()
|
|
2222
|
+
{
|
|
2223
|
+
return this .geometryType;
|
|
2224
|
+
},
|
|
2225
|
+
getNumInstances ()
|
|
2226
|
+
{
|
|
2227
|
+
return this .numParticles;
|
|
2228
|
+
},
|
|
2229
|
+
getInstances ()
|
|
2230
|
+
{
|
|
2231
|
+
return this .outputParticles;
|
|
2232
|
+
},
|
|
2256
2233
|
set_bbox__ ()
|
|
2257
2234
|
{
|
|
2258
2235
|
if (this ._bboxSize .getValue () .equals (this .getDefaultBBoxSize ()))
|
|
2259
|
-
this .bbox .set ();
|
|
2236
|
+
this .bbox .set ((Vector3_default()).One, (Vector3_default()).Zero);
|
|
2260
2237
|
else
|
|
2261
2238
|
this .bbox .set (this ._bboxSize .getValue (), this ._bboxCenter .getValue ());
|
|
2262
2239
|
|
|
@@ -2271,7 +2248,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2271
2248
|
{
|
|
2272
2249
|
switch (this .geometryType)
|
|
2273
2250
|
{
|
|
2274
|
-
case
|
|
2251
|
+
case (GeometryTypes_default()).POINT:
|
|
2275
2252
|
{
|
|
2276
2253
|
this .setTransparent (true);
|
|
2277
2254
|
break;
|
|
@@ -2280,7 +2257,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2280
2257
|
{
|
|
2281
2258
|
this .setTransparent (this .getAppearance () .isTransparent () ||
|
|
2282
2259
|
this .colorRampNode ?.isTransparent () ||
|
|
2283
|
-
(this .geometryType ===
|
|
2260
|
+
(this .geometryType === (GeometryTypes_default()).GEOMETRY &&
|
|
2284
2261
|
this .geometryNode ?.isTransparent ()));
|
|
2285
2262
|
break;
|
|
2286
2263
|
}
|
|
@@ -2370,18 +2347,18 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2370
2347
|
|
|
2371
2348
|
// Get geometryType.
|
|
2372
2349
|
|
|
2373
|
-
this .geometryType = $.enum (
|
|
2350
|
+
this .geometryType = $.enum ((GeometryTypes_default()), this ._geometryType .getValue (), (GeometryTypes_default()).QUAD);
|
|
2374
2351
|
|
|
2375
2352
|
// Create buffers.
|
|
2376
2353
|
|
|
2377
2354
|
switch (this .geometryType)
|
|
2378
2355
|
{
|
|
2379
|
-
case
|
|
2356
|
+
case (GeometryTypes_default()).POINT:
|
|
2380
2357
|
{
|
|
2381
2358
|
this .geometryContext .geometryType = 0;
|
|
2382
2359
|
this .geometryContext .hasNormals = false;
|
|
2383
2360
|
|
|
2384
|
-
this .texCoordCount
|
|
2361
|
+
this .texCoordCount = 0;
|
|
2385
2362
|
this .vertexCount = 1;
|
|
2386
2363
|
this .hasNormals = false;
|
|
2387
2364
|
this .verticesOffset = 0;
|
|
@@ -2392,26 +2369,17 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2392
2369
|
|
|
2393
2370
|
break;
|
|
2394
2371
|
}
|
|
2395
|
-
case
|
|
2372
|
+
case (GeometryTypes_default()).LINE:
|
|
2396
2373
|
{
|
|
2397
2374
|
this .geometryContext .geometryType = 1;
|
|
2398
2375
|
this .geometryContext .hasNormals = false;
|
|
2399
2376
|
|
|
2400
|
-
this .texCoordCount
|
|
2401
|
-
this .vertexCount = 2;
|
|
2402
|
-
this .hasNormals = false;
|
|
2403
|
-
this .texCoordsOffset = 0;
|
|
2404
|
-
this .verticesOffset = Float32Array .BYTES_PER_ELEMENT * 8;
|
|
2405
|
-
this .primitiveMode = gl .LINES;
|
|
2406
|
-
|
|
2407
|
-
gl .bindBuffer (gl .ARRAY_BUFFER, this .geometryBuffer);
|
|
2408
|
-
gl .bufferData (gl .ARRAY_BUFFER, LineGeometry, gl .DYNAMIC_DRAW);
|
|
2409
|
-
|
|
2377
|
+
this .texCoordCount = 0;
|
|
2410
2378
|
break;
|
|
2411
2379
|
}
|
|
2412
|
-
case
|
|
2413
|
-
case
|
|
2414
|
-
case
|
|
2380
|
+
case (GeometryTypes_default()).TRIANGLE:
|
|
2381
|
+
case (GeometryTypes_default()).QUAD:
|
|
2382
|
+
case (GeometryTypes_default()).SPRITE:
|
|
2415
2383
|
{
|
|
2416
2384
|
this .geometryContext .geometryType = 2;
|
|
2417
2385
|
this .geometryContext .hasNormals = true;
|
|
@@ -2429,7 +2397,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2429
2397
|
|
|
2430
2398
|
break;
|
|
2431
2399
|
}
|
|
2432
|
-
case
|
|
2400
|
+
case (GeometryTypes_default()).GEOMETRY:
|
|
2433
2401
|
{
|
|
2434
2402
|
this .texCoordCount = 0;
|
|
2435
2403
|
break;
|
|
@@ -2464,6 +2432,11 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2464
2432
|
{
|
|
2465
2433
|
this .lifetimeVariation = this ._lifetimeVariation .getValue ();
|
|
2466
2434
|
},
|
|
2435
|
+
set_particleSize__ ()
|
|
2436
|
+
{
|
|
2437
|
+
this .lineCoordinateNode ._point [0] .z = -this ._particleSize .y / 2;
|
|
2438
|
+
this .lineCoordinateNode ._point [1] .z = +this ._particleSize .y / 2;
|
|
2439
|
+
},
|
|
2467
2440
|
set_emitter__ ()
|
|
2468
2441
|
{
|
|
2469
2442
|
this .emitterNode = X3DCast_default() ((X3DConstants_default()).X3DParticleEmitterNode, this ._emitter);
|
|
@@ -2662,8 +2635,11 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2662
2635
|
},
|
|
2663
2636
|
updateVertexArrays ()
|
|
2664
2637
|
{
|
|
2665
|
-
this .inputParticles .vertexArrayObject
|
|
2666
|
-
this .outputParticles .vertexArrayObject
|
|
2638
|
+
this .inputParticles .vertexArrayObject .update ();
|
|
2639
|
+
this .outputParticles .vertexArrayObject .update ();
|
|
2640
|
+
|
|
2641
|
+
this .inputParticles .thickLinesVertexArrayObject .update ();
|
|
2642
|
+
this .outputParticles .thickLinesVertexArrayObject .update ();
|
|
2667
2643
|
},
|
|
2668
2644
|
createTexture ()
|
|
2669
2645
|
{
|
|
@@ -2698,9 +2674,9 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2698
2674
|
const
|
|
2699
2675
|
gl = this .getBrowser () .getContext (),
|
|
2700
2676
|
maxParticles = this .maxParticles,
|
|
2701
|
-
|
|
2677
|
+
particlesStride = this .particlesStride,
|
|
2702
2678
|
outputParticles = Object .assign (gl .createBuffer (), this .outputParticles),
|
|
2703
|
-
data = new Uint8Array (maxParticles *
|
|
2679
|
+
data = new Uint8Array (maxParticles * particlesStride);
|
|
2704
2680
|
|
|
2705
2681
|
// Resize input buffer.
|
|
2706
2682
|
|
|
@@ -2712,7 +2688,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2712
2688
|
gl .bindBuffer (gl .COPY_READ_BUFFER, this .outputParticles);
|
|
2713
2689
|
gl .bindBuffer (gl .ARRAY_BUFFER, outputParticles);
|
|
2714
2690
|
gl .bufferData (gl .ARRAY_BUFFER, data, gl .DYNAMIC_DRAW);
|
|
2715
|
-
gl .copyBufferSubData (gl .COPY_READ_BUFFER, gl .ARRAY_BUFFER, 0, 0, Math .min (maxParticles *
|
|
2691
|
+
gl .copyBufferSubData (gl .COPY_READ_BUFFER, gl .ARRAY_BUFFER, 0, 0, Math .min (maxParticles * particlesStride, lastNumParticles * particlesStride));
|
|
2716
2692
|
gl .deleteBuffer (this .outputParticles);
|
|
2717
2693
|
|
|
2718
2694
|
this .outputParticles = outputParticles;
|
|
@@ -2864,6 +2840,9 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2864
2840
|
{ },
|
|
2865
2841
|
traverse (type, renderObject)
|
|
2866
2842
|
{
|
|
2843
|
+
if (!this .numParticles)
|
|
2844
|
+
return;
|
|
2845
|
+
|
|
2867
2846
|
switch (type)
|
|
2868
2847
|
{
|
|
2869
2848
|
case (TraverseType_default()).POINTER:
|
|
@@ -2888,76 +2867,83 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2888
2867
|
case (TraverseType_default()).DISPLAY:
|
|
2889
2868
|
{
|
|
2890
2869
|
if (renderObject .addDisplayShape (this))
|
|
2891
|
-
|
|
2870
|
+
{
|
|
2871
|
+
// Currently used for GeneratedCubeMapTexture.
|
|
2872
|
+
this .getAppearance () .traverse (type, renderObject);
|
|
2873
|
+
}
|
|
2892
2874
|
|
|
2893
2875
|
break;
|
|
2894
2876
|
}
|
|
2895
2877
|
}
|
|
2896
2878
|
|
|
2897
|
-
if (this .geometryType ===
|
|
2879
|
+
if (this .geometryType === (GeometryTypes_default()).GEOMETRY)
|
|
2898
2880
|
{
|
|
2899
|
-
|
|
2900
|
-
|
|
2881
|
+
// Currently used for ScreenText and Tools.
|
|
2882
|
+
this .getGeometry () ?.traverse (type, renderObject);
|
|
2901
2883
|
}
|
|
2902
2884
|
},
|
|
2903
2885
|
displaySimple (gl, renderContext, shaderNode)
|
|
2904
2886
|
{
|
|
2905
|
-
|
|
2906
|
-
{
|
|
2907
|
-
// Display geometry.
|
|
2887
|
+
// Display geometry.
|
|
2908
2888
|
|
|
2909
|
-
|
|
2889
|
+
switch (this .geometryType)
|
|
2890
|
+
{
|
|
2891
|
+
case (GeometryTypes_default()).LINE:
|
|
2910
2892
|
{
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
const particleStride = this .particleStride;
|
|
2893
|
+
this .lineGeometryNode .displaySimpleInstanced (gl, shaderNode, this);
|
|
2894
|
+
break;
|
|
2895
|
+
}
|
|
2896
|
+
case (GeometryTypes_default()).GEOMETRY:
|
|
2897
|
+
{
|
|
2898
|
+
this .getGeometry () ?.displaySimpleInstanced (gl, shaderNode, this);
|
|
2899
|
+
break;
|
|
2900
|
+
}
|
|
2901
|
+
case (GeometryTypes_default()).SPRITE:
|
|
2902
|
+
{
|
|
2903
|
+
this .updateSprite (gl, this .getScreenAlignedRotation (renderContext .modelViewMatrix));
|
|
2904
|
+
// [fall trough]
|
|
2905
|
+
}
|
|
2906
|
+
default:
|
|
2907
|
+
{
|
|
2908
|
+
const outputParticles = this .outputParticles;
|
|
2928
2909
|
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
}
|
|
2910
|
+
if (outputParticles .vertexArrayObject .enable (shaderNode .getProgram ()))
|
|
2911
|
+
{
|
|
2912
|
+
const particlesStride = this .particlesStride;
|
|
2933
2913
|
|
|
2934
|
-
|
|
2935
|
-
|
|
2914
|
+
shaderNode .enableParticleAttribute (gl, outputParticles, particlesStride, this .particleOffset, 1);
|
|
2915
|
+
shaderNode .enableInstanceMatrixAttribute (gl, outputParticles, particlesStride, this .matrixOffset, 1);
|
|
2916
|
+
shaderNode .enableVertexAttribute (gl, this .geometryBuffer, 0, this .verticesOffset);
|
|
2936
2917
|
}
|
|
2918
|
+
|
|
2919
|
+
gl .drawArraysInstanced (this .primitiveMode, 0, this .vertexCount, this .numParticles);
|
|
2920
|
+
break;
|
|
2937
2921
|
}
|
|
2938
2922
|
}
|
|
2939
2923
|
},
|
|
2940
2924
|
display (gl, renderContext)
|
|
2941
2925
|
{
|
|
2942
|
-
if (!this .numParticles)
|
|
2943
|
-
return;
|
|
2944
|
-
|
|
2945
2926
|
// Display geometry.
|
|
2946
2927
|
|
|
2947
2928
|
switch (this .geometryType)
|
|
2948
2929
|
{
|
|
2949
|
-
case
|
|
2930
|
+
case (GeometryTypes_default()).LINE:
|
|
2931
|
+
{
|
|
2932
|
+
this .lineGeometryNode .displayInstanced (gl, renderContext, this);
|
|
2933
|
+
break;
|
|
2934
|
+
}
|
|
2935
|
+
case (GeometryTypes_default()).GEOMETRY:
|
|
2950
2936
|
{
|
|
2951
|
-
this .getGeometry () ?.
|
|
2937
|
+
this .getGeometry () ?.displayInstanced (gl, renderContext, this);
|
|
2952
2938
|
break;
|
|
2953
2939
|
}
|
|
2954
|
-
case
|
|
2940
|
+
case (GeometryTypes_default()).SPRITE:
|
|
2955
2941
|
{
|
|
2956
2942
|
this .updateSprite (gl, this .getScreenAlignedRotation (renderContext .modelViewMatrix));
|
|
2957
2943
|
// [fall trough]
|
|
2958
2944
|
}
|
|
2959
|
-
case
|
|
2960
|
-
case
|
|
2945
|
+
case (GeometryTypes_default()).QUAD:
|
|
2946
|
+
case (GeometryTypes_default()).TRIANGLE:
|
|
2961
2947
|
{
|
|
2962
2948
|
const positiveScale = Matrix4_default().prototype .determinant3 .call (renderContext .modelViewMatrix) > 0;
|
|
2963
2949
|
|
|
@@ -2998,14 +2984,15 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2998
2984
|
|
|
2999
2985
|
if (outputParticles .vertexArrayObject .enable (shaderNode .getProgram ()))
|
|
3000
2986
|
{
|
|
3001
|
-
const
|
|
2987
|
+
const { particlesStride } = this;
|
|
3002
2988
|
|
|
3003
|
-
shaderNode .enableParticleAttribute
|
|
3004
|
-
shaderNode .
|
|
2989
|
+
shaderNode .enableParticleAttribute (gl, outputParticles, particlesStride, this .particleOffset, 1);
|
|
2990
|
+
shaderNode .enableParticleVelocityAttribute (gl, outputParticles, particlesStride, this .velocityOffset, 1);
|
|
2991
|
+
shaderNode .enableInstanceMatrixAttribute (gl, outputParticles, particlesStride, this .matrixOffset, 1);
|
|
3005
2992
|
|
|
3006
2993
|
if (this .geometryContext .colorMaterial)
|
|
3007
2994
|
{
|
|
3008
|
-
shaderNode .enableColorAttribute (gl, outputParticles,
|
|
2995
|
+
shaderNode .enableColorAttribute (gl, outputParticles, particlesStride, this .colorOffset);
|
|
3009
2996
|
shaderNode .colorAttributeDivisor (gl, 1);
|
|
3010
2997
|
}
|
|
3011
2998
|
|
|
@@ -3123,7 +3110,7 @@ const ParticleSystem_default_ = ParticleSystem;
|
|
|
3123
3110
|
Namespace_default().add ("ParticleSystem", "x_ite/Components/ParticleSystems/ParticleSystem", ParticleSystem_default_);
|
|
3124
3111
|
/* harmony default export */ const ParticleSystems_ParticleSystem = (ParticleSystem_default_);
|
|
3125
3112
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Rendering/IndexedLineSet\")"
|
|
3126
|
-
const IndexedLineSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
3113
|
+
const IndexedLineSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Components/Rendering/IndexedLineSet");
|
|
3127
3114
|
var IndexedLineSet_default = /*#__PURE__*/__webpack_require__.n(IndexedLineSet_namespaceObject);
|
|
3128
3115
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/PolylineEmitter.js
|
|
3129
3116
|
/*******************************************************************************
|
|
@@ -3263,12 +3250,12 @@ Object .assign (Object .setPrototypeOf (PolylineEmitter .prototype, ParticleSyst
|
|
|
3263
3250
|
this .polylinesNode ._coordIndex = this ._coordIndex;
|
|
3264
3251
|
this .polylinesNode ._coord = this ._coord;
|
|
3265
3252
|
|
|
3266
|
-
this .polylinesNode ._rebuild .addInterest ("set_polyline", this);
|
|
3267
3253
|
this .polylinesNode .setPrivate (true);
|
|
3268
3254
|
this .polylinesNode .setup ();
|
|
3255
|
+
this .polylinesNode ._rebuild .addInterest ("set_polylines__", this);
|
|
3269
3256
|
|
|
3270
3257
|
this .set_direction__ ();
|
|
3271
|
-
this .
|
|
3258
|
+
this .set_polylines__ ();
|
|
3272
3259
|
},
|
|
3273
3260
|
set_direction__: (() =>
|
|
3274
3261
|
{
|
|
@@ -3281,7 +3268,7 @@ Object .assign (Object .setPrototypeOf (PolylineEmitter .prototype, ParticleSyst
|
|
|
3281
3268
|
this .setUniform ("uniform3f", "direction", direction .x, direction .y, direction .z);
|
|
3282
3269
|
};
|
|
3283
3270
|
})(),
|
|
3284
|
-
|
|
3271
|
+
set_polylines__: (() =>
|
|
3285
3272
|
{
|
|
3286
3273
|
const
|
|
3287
3274
|
vertex1 = new (Vector3_default()) (),
|
|
@@ -3377,7 +3364,7 @@ const PolylineEmitter_default_ = PolylineEmitter;
|
|
|
3377
3364
|
Namespace_default().add ("PolylineEmitter", "x_ite/Components/ParticleSystems/PolylineEmitter", PolylineEmitter_default_);
|
|
3378
3365
|
/* harmony default export */ const ParticleSystems_PolylineEmitter = (PolylineEmitter_default_);
|
|
3379
3366
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Triangle3\")"
|
|
3380
|
-
const Triangle3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
3367
|
+
const Triangle3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("standard/Math/Geometry/Triangle3");
|
|
3381
3368
|
var Triangle3_default = /*#__PURE__*/__webpack_require__.n(Triangle3_namespaceObject);
|
|
3382
3369
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/SurfaceEmitter.js
|
|
3383
3370
|
/*******************************************************************************
|
|
@@ -3637,7 +3624,7 @@ const SurfaceEmitter_default_ = SurfaceEmitter;
|
|
|
3637
3624
|
Namespace_default().add ("SurfaceEmitter", "x_ite/Components/ParticleSystems/SurfaceEmitter", SurfaceEmitter_default_);
|
|
3638
3625
|
/* harmony default export */ const ParticleSystems_SurfaceEmitter = (SurfaceEmitter_default_);
|
|
3639
3626
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Geometry3D/IndexedFaceSet\")"
|
|
3640
|
-
const IndexedFaceSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
3627
|
+
const IndexedFaceSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("x_ite/Components/Geometry3D/IndexedFaceSet");
|
|
3641
3628
|
var IndexedFaceSet_default = /*#__PURE__*/__webpack_require__.n(IndexedFaceSet_namespaceObject);
|
|
3642
3629
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/VolumeEmitter.js
|
|
3643
3630
|
/*******************************************************************************
|
|
@@ -3798,9 +3785,9 @@ Object .assign (Object .setPrototypeOf (VolumeEmitter .prototype, ParticleSystem
|
|
|
3798
3785
|
this .volumeNode ._coordIndex = this ._coordIndex;
|
|
3799
3786
|
this .volumeNode ._coord = this ._coord;
|
|
3800
3787
|
|
|
3801
|
-
this .volumeNode ._rebuild .addInterest ("set_geometry__", this);
|
|
3802
3788
|
this .volumeNode .setPrivate (true);
|
|
3803
3789
|
this .volumeNode .setup ();
|
|
3790
|
+
this .volumeNode ._rebuild .addInterest ("set_geometry__", this);
|
|
3804
3791
|
|
|
3805
3792
|
this .set_direction__ ();
|
|
3806
3793
|
this .set_geometry__ ();
|
|
@@ -3934,7 +3921,7 @@ const VolumeEmitter_default_ = VolumeEmitter;
|
|
|
3934
3921
|
Namespace_default().add ("VolumeEmitter", "x_ite/Components/ParticleSystems/VolumeEmitter", VolumeEmitter_default_);
|
|
3935
3922
|
/* harmony default export */ const ParticleSystems_VolumeEmitter = (VolumeEmitter_default_);
|
|
3936
3923
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Algorithm\")"
|
|
3937
|
-
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
3924
|
+
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.1")] .require ("standard/Math/Algorithm");
|
|
3938
3925
|
var Algorithm_default = /*#__PURE__*/__webpack_require__.n(Algorithm_namespaceObject);
|
|
3939
3926
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/WindPhysicsModel.js
|
|
3940
3927
|
/*******************************************************************************
|