x_ite 9.4.5 → 9.5.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/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 +37 -34
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +8 -8
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +27 -27
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +23 -23
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +107 -155
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +18 -18
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +17 -17
- 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 +28 -28
- 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 +303 -8
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +1517 -1097
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.min.mjs +1 -1
- package/dist/x_ite.mjs +1517 -1097
- package/dist/x_ite.zip +0 -0
- package/package.json +3 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/* X_ITE v9.
|
|
1
|
+
/* X_ITE v9.5.0 */(() => { // 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.0")] .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.0")] .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.0")] .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.0")] .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.0")] .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.0")] .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.0")] .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.0")] .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.0")] .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
|
;
|
|
@@ -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,7 +361,7 @@ 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
366
|
|
|
428
367
|
gl .bindBuffer (gl .ARRAY_BUFFER, null);
|
|
@@ -442,10 +381,10 @@ Object .assign (Object .setPrototypeOf (X3DParticleEmitterNode .prototype, (X3DN
|
|
|
442
381
|
|
|
443
382
|
// DEBUG
|
|
444
383
|
|
|
445
|
-
// const data = new Float32Array (particleSystem .numParticles * (
|
|
384
|
+
// const data = new Float32Array (particleSystem .numParticles * (particlesStride / 4));
|
|
446
385
|
// gl .bindBuffer (gl .ARRAY_BUFFER, particleSystem .outputParticles);
|
|
447
386
|
// gl .getBufferSubData (gl .ARRAY_BUFFER, 0, data);
|
|
448
|
-
// console .log (data .slice (0,
|
|
387
|
+
// console .log (data .slice (0, particlesStride / 4));
|
|
449
388
|
},
|
|
450
389
|
addSampler (name)
|
|
451
390
|
{
|
|
@@ -478,7 +417,7 @@ Object .assign (Object .setPrototypeOf (X3DParticleEmitterNode .prototype, (X3DN
|
|
|
478
417
|
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
418
|
${Object .values (this .uniforms) .join ("\n")}
|
|
480
419
|
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 (
|
|
420
|
+
${Object .entries ((GeometryTypes_default())) .map (([k, v]) => `#define ${k} ${v}`) .join ("\n")}
|
|
482
421
|
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
422
|
${this .functions .join ("\n")}
|
|
484
423
|
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;Plane3 plane2=plane3(points[index].xyz,normals[index]);if(sign(plane_distance(plane2,fromPosition.xyz))==sign(plane_distance(plane2,toPosition.xyz)))return;velocity=reflect(velocity,normals[index]);toPosition=vec4(points[index].xyz+reflect(points[index].xyz-fromPosition.xyz,normals[index]),1.0);}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(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 r=Matrix3(Quaternion(vec3(0.0,0.0,1.0),output2.xyz));mat3 s=mat3(1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,particleSize.y);mat3 m=r*s;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;}}}`
|
|
@@ -618,7 +557,7 @@ const X3DParticleEmitterNode_default_ = X3DParticleEmitterNode;
|
|
|
618
557
|
Namespace_default().add ("X3DParticleEmitterNode", "x_ite/Components/ParticleSystems/X3DParticleEmitterNode", X3DParticleEmitterNode_default_);
|
|
619
558
|
/* harmony default export */ const ParticleSystems_X3DParticleEmitterNode = (X3DParticleEmitterNode_default_);
|
|
620
559
|
;// 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.
|
|
560
|
+
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.0")] .require ("standard/Math/Numbers/Vector3");
|
|
622
561
|
var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
|
|
623
562
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/PointEmitter.js
|
|
624
563
|
/*******************************************************************************
|
|
@@ -937,7 +876,7 @@ const X3DParticlePhysicsModelNode_default_ = X3DParticlePhysicsModelNode;
|
|
|
937
876
|
Namespace_default().add ("X3DParticlePhysicsModelNode", "x_ite/Components/ParticleSystems/X3DParticlePhysicsModelNode", X3DParticlePhysicsModelNode_default_);
|
|
938
877
|
/* harmony default export */ const ParticleSystems_X3DParticlePhysicsModelNode = (X3DParticlePhysicsModelNode_default_);
|
|
939
878
|
;// 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.
|
|
879
|
+
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.0")] .require ("x_ite/Base/X3DCast");
|
|
941
880
|
var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
|
|
942
881
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js
|
|
943
882
|
/*******************************************************************************
|
|
@@ -1511,28 +1450,28 @@ 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.0")] .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.0")] .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.0")] .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.0")] .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.0")] .require ("x_ite/Browser/Shape/AlphaMode");
|
|
1527
1466
|
var AlphaMode_default = /*#__PURE__*/__webpack_require__.n(AlphaMode_namespaceObject);
|
|
1528
1467
|
;// 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.
|
|
1468
|
+
const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.0")] .require ("standard/Math/Numbers/Matrix4");
|
|
1530
1469
|
var Matrix4_default = /*#__PURE__*/__webpack_require__.n(Matrix4_namespaceObject);
|
|
1531
1470
|
;// 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.
|
|
1471
|
+
const Matrix3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.0")] .require ("standard/Math/Numbers/Matrix3");
|
|
1533
1472
|
var Matrix3_default = /*#__PURE__*/__webpack_require__.n(Matrix3_namespaceObject);
|
|
1534
1473
|
;// 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.
|
|
1474
|
+
const Plane3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.0")] .require ("standard/Math/Geometry/Plane3");
|
|
1536
1475
|
var Plane3_default = /*#__PURE__*/__webpack_require__.n(Plane3_namespaceObject);
|
|
1537
1476
|
;// CONCATENATED MODULE: ./src/standard/Math/Algorithms/QuickSort.js
|
|
1538
1477
|
/*******************************************************************************
|
|
@@ -2165,12 +2104,13 @@ function ParticleSystem (executionContext)
|
|
|
2165
2104
|
this .creationTime = 0;
|
|
2166
2105
|
this .pauseTime = 0;
|
|
2167
2106
|
this .deltaTime = 0;
|
|
2168
|
-
this .
|
|
2107
|
+
this .particlesStride = Float32Array .BYTES_PER_ELEMENT * 7 * 4; // 7 x vec4
|
|
2169
2108
|
this .particleOffsets = Array .from ({length: 7}, (_, i) => Float32Array .BYTES_PER_ELEMENT * 4 * i); // i x vec4
|
|
2170
2109
|
this .particleOffset = this .particleOffsets [0];
|
|
2171
2110
|
this .colorOffset = this .particleOffsets [1];
|
|
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),
|
|
@@ -2247,16 +2187,28 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2247
2187
|
{
|
|
2248
2188
|
switch (this .geometryType)
|
|
2249
2189
|
{
|
|
2250
|
-
case
|
|
2190
|
+
case (GeometryTypes_default()).GEOMETRY:
|
|
2251
2191
|
return this .getGeometry ();
|
|
2252
2192
|
default:
|
|
2253
2193
|
return this .geometryContext;
|
|
2254
2194
|
}
|
|
2255
2195
|
},
|
|
2196
|
+
getGeometryType ()
|
|
2197
|
+
{
|
|
2198
|
+
return this .geometryType;
|
|
2199
|
+
},
|
|
2200
|
+
getNumInstances ()
|
|
2201
|
+
{
|
|
2202
|
+
return this .numParticles;
|
|
2203
|
+
},
|
|
2204
|
+
getInstances ()
|
|
2205
|
+
{
|
|
2206
|
+
return this .outputParticles;
|
|
2207
|
+
},
|
|
2256
2208
|
set_bbox__ ()
|
|
2257
2209
|
{
|
|
2258
2210
|
if (this ._bboxSize .getValue () .equals (this .getDefaultBBoxSize ()))
|
|
2259
|
-
this .bbox .set ();
|
|
2211
|
+
this .bbox .set ((Vector3_default()).One, (Vector3_default()).Zero);
|
|
2260
2212
|
else
|
|
2261
2213
|
this .bbox .set (this ._bboxSize .getValue (), this ._bboxCenter .getValue ());
|
|
2262
2214
|
|
|
@@ -2271,7 +2223,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2271
2223
|
{
|
|
2272
2224
|
switch (this .geometryType)
|
|
2273
2225
|
{
|
|
2274
|
-
case
|
|
2226
|
+
case (GeometryTypes_default()).POINT:
|
|
2275
2227
|
{
|
|
2276
2228
|
this .setTransparent (true);
|
|
2277
2229
|
break;
|
|
@@ -2280,7 +2232,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2280
2232
|
{
|
|
2281
2233
|
this .setTransparent (this .getAppearance () .isTransparent () ||
|
|
2282
2234
|
this .colorRampNode ?.isTransparent () ||
|
|
2283
|
-
(this .geometryType ===
|
|
2235
|
+
(this .geometryType === (GeometryTypes_default()).GEOMETRY &&
|
|
2284
2236
|
this .geometryNode ?.isTransparent ()));
|
|
2285
2237
|
break;
|
|
2286
2238
|
}
|
|
@@ -2370,13 +2322,13 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2370
2322
|
|
|
2371
2323
|
// Get geometryType.
|
|
2372
2324
|
|
|
2373
|
-
this .geometryType = $.enum (
|
|
2325
|
+
this .geometryType = $.enum ((GeometryTypes_default()), this ._geometryType .getValue (), (GeometryTypes_default()).QUAD);
|
|
2374
2326
|
|
|
2375
2327
|
// Create buffers.
|
|
2376
2328
|
|
|
2377
2329
|
switch (this .geometryType)
|
|
2378
2330
|
{
|
|
2379
|
-
case
|
|
2331
|
+
case (GeometryTypes_default()).POINT:
|
|
2380
2332
|
{
|
|
2381
2333
|
this .geometryContext .geometryType = 0;
|
|
2382
2334
|
this .geometryContext .hasNormals = false;
|
|
@@ -2392,7 +2344,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2392
2344
|
|
|
2393
2345
|
break;
|
|
2394
2346
|
}
|
|
2395
|
-
case
|
|
2347
|
+
case (GeometryTypes_default()).LINE:
|
|
2396
2348
|
{
|
|
2397
2349
|
this .geometryContext .geometryType = 1;
|
|
2398
2350
|
this .geometryContext .hasNormals = false;
|
|
@@ -2409,9 +2361,9 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2409
2361
|
|
|
2410
2362
|
break;
|
|
2411
2363
|
}
|
|
2412
|
-
case
|
|
2413
|
-
case
|
|
2414
|
-
case
|
|
2364
|
+
case (GeometryTypes_default()).TRIANGLE:
|
|
2365
|
+
case (GeometryTypes_default()).QUAD:
|
|
2366
|
+
case (GeometryTypes_default()).SPRITE:
|
|
2415
2367
|
{
|
|
2416
2368
|
this .geometryContext .geometryType = 2;
|
|
2417
2369
|
this .geometryContext .hasNormals = true;
|
|
@@ -2429,7 +2381,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2429
2381
|
|
|
2430
2382
|
break;
|
|
2431
2383
|
}
|
|
2432
|
-
case
|
|
2384
|
+
case (GeometryTypes_default()).GEOMETRY:
|
|
2433
2385
|
{
|
|
2434
2386
|
this .texCoordCount = 0;
|
|
2435
2387
|
break;
|
|
@@ -2698,9 +2650,9 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2698
2650
|
const
|
|
2699
2651
|
gl = this .getBrowser () .getContext (),
|
|
2700
2652
|
maxParticles = this .maxParticles,
|
|
2701
|
-
|
|
2653
|
+
particlesStride = this .particlesStride,
|
|
2702
2654
|
outputParticles = Object .assign (gl .createBuffer (), this .outputParticles),
|
|
2703
|
-
data = new Uint8Array (maxParticles *
|
|
2655
|
+
data = new Uint8Array (maxParticles * particlesStride);
|
|
2704
2656
|
|
|
2705
2657
|
// Resize input buffer.
|
|
2706
2658
|
|
|
@@ -2712,7 +2664,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2712
2664
|
gl .bindBuffer (gl .COPY_READ_BUFFER, this .outputParticles);
|
|
2713
2665
|
gl .bindBuffer (gl .ARRAY_BUFFER, outputParticles);
|
|
2714
2666
|
gl .bufferData (gl .ARRAY_BUFFER, data, gl .DYNAMIC_DRAW);
|
|
2715
|
-
gl .copyBufferSubData (gl .COPY_READ_BUFFER, gl .ARRAY_BUFFER, 0, 0, Math .min (maxParticles *
|
|
2667
|
+
gl .copyBufferSubData (gl .COPY_READ_BUFFER, gl .ARRAY_BUFFER, 0, 0, Math .min (maxParticles * particlesStride, lastNumParticles * particlesStride));
|
|
2716
2668
|
gl .deleteBuffer (this .outputParticles);
|
|
2717
2669
|
|
|
2718
2670
|
this .outputParticles = outputParticles;
|
|
@@ -2864,6 +2816,9 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2864
2816
|
{ },
|
|
2865
2817
|
traverse (type, renderObject)
|
|
2866
2818
|
{
|
|
2819
|
+
if (!this .numParticles)
|
|
2820
|
+
return;
|
|
2821
|
+
|
|
2867
2822
|
switch (type)
|
|
2868
2823
|
{
|
|
2869
2824
|
case (TraverseType_default()).POINTER:
|
|
@@ -2888,76 +2843,73 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2888
2843
|
case (TraverseType_default()).DISPLAY:
|
|
2889
2844
|
{
|
|
2890
2845
|
if (renderObject .addDisplayShape (this))
|
|
2891
|
-
|
|
2846
|
+
{
|
|
2847
|
+
// Currently used for GeneratedCubeMapTexture.
|
|
2848
|
+
this .getAppearance () .traverse (type, renderObject);
|
|
2849
|
+
}
|
|
2892
2850
|
|
|
2893
2851
|
break;
|
|
2894
2852
|
}
|
|
2895
2853
|
}
|
|
2896
2854
|
|
|
2897
|
-
if (this .geometryType ===
|
|
2855
|
+
if (this .geometryType === (GeometryTypes_default()).GEOMETRY)
|
|
2898
2856
|
{
|
|
2899
|
-
|
|
2900
|
-
|
|
2857
|
+
// Currently used for ScreenText and Tools.
|
|
2858
|
+
this .getGeometry () ?.traverse (type, renderObject);
|
|
2901
2859
|
}
|
|
2902
2860
|
},
|
|
2903
2861
|
displaySimple (gl, renderContext, shaderNode)
|
|
2904
2862
|
{
|
|
2905
|
-
|
|
2906
|
-
{
|
|
2907
|
-
// Display geometry.
|
|
2863
|
+
// Display geometry.
|
|
2908
2864
|
|
|
2909
|
-
|
|
2865
|
+
switch (this .geometryType)
|
|
2866
|
+
{
|
|
2867
|
+
case (GeometryTypes_default()).GEOMETRY:
|
|
2910
2868
|
{
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
{
|
|
2923
|
-
const outputParticles = this .outputParticles;
|
|
2924
|
-
|
|
2925
|
-
if (outputParticles .vertexArrayObject .enable (shaderNode .getProgram ()))
|
|
2926
|
-
{
|
|
2927
|
-
const particleStride = this .particleStride;
|
|
2869
|
+
this .getGeometry () ?.displaySimpleInstanced (gl, shaderNode, this);
|
|
2870
|
+
break;
|
|
2871
|
+
}
|
|
2872
|
+
case (GeometryTypes_default()).SPRITE:
|
|
2873
|
+
{
|
|
2874
|
+
this .updateSprite (gl, this .getScreenAlignedRotation (renderContext .modelViewMatrix));
|
|
2875
|
+
// [fall trough]
|
|
2876
|
+
}
|
|
2877
|
+
default:
|
|
2878
|
+
{
|
|
2879
|
+
const outputParticles = this .outputParticles;
|
|
2928
2880
|
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
}
|
|
2881
|
+
if (outputParticles .vertexArrayObject .enable (shaderNode .getProgram ()))
|
|
2882
|
+
{
|
|
2883
|
+
const particlesStride = this .particlesStride;
|
|
2933
2884
|
|
|
2934
|
-
|
|
2935
|
-
|
|
2885
|
+
shaderNode .enableParticleAttribute (gl, outputParticles, particlesStride, this .particleOffset, 1);
|
|
2886
|
+
shaderNode .enableInstanceMatrixAttribute (gl, outputParticles, particlesStride, this .matrixOffset, 1);
|
|
2887
|
+
shaderNode .enableVertexAttribute (gl, this .geometryBuffer, 0, this .verticesOffset);
|
|
2936
2888
|
}
|
|
2889
|
+
|
|
2890
|
+
gl .drawArraysInstanced (this .primitiveMode, 0, this .vertexCount, this .numParticles);
|
|
2891
|
+
break;
|
|
2937
2892
|
}
|
|
2938
2893
|
}
|
|
2939
2894
|
},
|
|
2940
2895
|
display (gl, renderContext)
|
|
2941
2896
|
{
|
|
2942
|
-
if (!this .numParticles)
|
|
2943
|
-
return;
|
|
2944
|
-
|
|
2945
2897
|
// Display geometry.
|
|
2946
2898
|
|
|
2947
2899
|
switch (this .geometryType)
|
|
2948
2900
|
{
|
|
2949
|
-
case
|
|
2901
|
+
case (GeometryTypes_default()).GEOMETRY:
|
|
2950
2902
|
{
|
|
2951
|
-
this .getGeometry () ?.
|
|
2903
|
+
this .getGeometry () ?.displayInstanced (gl, renderContext, this);
|
|
2952
2904
|
break;
|
|
2953
2905
|
}
|
|
2954
|
-
case
|
|
2906
|
+
case (GeometryTypes_default()).SPRITE:
|
|
2955
2907
|
{
|
|
2956
2908
|
this .updateSprite (gl, this .getScreenAlignedRotation (renderContext .modelViewMatrix));
|
|
2957
2909
|
// [fall trough]
|
|
2958
2910
|
}
|
|
2959
|
-
case
|
|
2960
|
-
case
|
|
2911
|
+
case (GeometryTypes_default()).QUAD:
|
|
2912
|
+
case (GeometryTypes_default()).TRIANGLE:
|
|
2961
2913
|
{
|
|
2962
2914
|
const positiveScale = Matrix4_default().prototype .determinant3 .call (renderContext .modelViewMatrix) > 0;
|
|
2963
2915
|
|
|
@@ -2998,14 +2950,14 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2998
2950
|
|
|
2999
2951
|
if (outputParticles .vertexArrayObject .enable (shaderNode .getProgram ()))
|
|
3000
2952
|
{
|
|
3001
|
-
const
|
|
2953
|
+
const particlesStride = this .particlesStride;
|
|
3002
2954
|
|
|
3003
|
-
shaderNode .enableParticleAttribute (gl, outputParticles,
|
|
3004
|
-
shaderNode .
|
|
2955
|
+
shaderNode .enableParticleAttribute (gl, outputParticles, particlesStride, this .particleOffset, 1);
|
|
2956
|
+
shaderNode .enableInstanceMatrixAttribute (gl, outputParticles, particlesStride, this .matrixOffset, 1);
|
|
3005
2957
|
|
|
3006
2958
|
if (this .geometryContext .colorMaterial)
|
|
3007
2959
|
{
|
|
3008
|
-
shaderNode .enableColorAttribute (gl, outputParticles,
|
|
2960
|
+
shaderNode .enableColorAttribute (gl, outputParticles, particlesStride, this .colorOffset);
|
|
3009
2961
|
shaderNode .colorAttributeDivisor (gl, 1);
|
|
3010
2962
|
}
|
|
3011
2963
|
|
|
@@ -3123,7 +3075,7 @@ const ParticleSystem_default_ = ParticleSystem;
|
|
|
3123
3075
|
Namespace_default().add ("ParticleSystem", "x_ite/Components/ParticleSystems/ParticleSystem", ParticleSystem_default_);
|
|
3124
3076
|
/* harmony default export */ const ParticleSystems_ParticleSystem = (ParticleSystem_default_);
|
|
3125
3077
|
;// 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.
|
|
3078
|
+
const IndexedLineSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.0")] .require ("x_ite/Components/Rendering/IndexedLineSet");
|
|
3127
3079
|
var IndexedLineSet_default = /*#__PURE__*/__webpack_require__.n(IndexedLineSet_namespaceObject);
|
|
3128
3080
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/PolylineEmitter.js
|
|
3129
3081
|
/*******************************************************************************
|
|
@@ -3377,7 +3329,7 @@ const PolylineEmitter_default_ = PolylineEmitter;
|
|
|
3377
3329
|
Namespace_default().add ("PolylineEmitter", "x_ite/Components/ParticleSystems/PolylineEmitter", PolylineEmitter_default_);
|
|
3378
3330
|
/* harmony default export */ const ParticleSystems_PolylineEmitter = (PolylineEmitter_default_);
|
|
3379
3331
|
;// 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.
|
|
3332
|
+
const Triangle3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.0")] .require ("standard/Math/Geometry/Triangle3");
|
|
3381
3333
|
var Triangle3_default = /*#__PURE__*/__webpack_require__.n(Triangle3_namespaceObject);
|
|
3382
3334
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/SurfaceEmitter.js
|
|
3383
3335
|
/*******************************************************************************
|
|
@@ -3637,7 +3589,7 @@ const SurfaceEmitter_default_ = SurfaceEmitter;
|
|
|
3637
3589
|
Namespace_default().add ("SurfaceEmitter", "x_ite/Components/ParticleSystems/SurfaceEmitter", SurfaceEmitter_default_);
|
|
3638
3590
|
/* harmony default export */ const ParticleSystems_SurfaceEmitter = (SurfaceEmitter_default_);
|
|
3639
3591
|
;// 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.
|
|
3592
|
+
const IndexedFaceSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.0")] .require ("x_ite/Components/Geometry3D/IndexedFaceSet");
|
|
3641
3593
|
var IndexedFaceSet_default = /*#__PURE__*/__webpack_require__.n(IndexedFaceSet_namespaceObject);
|
|
3642
3594
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/VolumeEmitter.js
|
|
3643
3595
|
/*******************************************************************************
|
|
@@ -3934,7 +3886,7 @@ const VolumeEmitter_default_ = VolumeEmitter;
|
|
|
3934
3886
|
Namespace_default().add ("VolumeEmitter", "x_ite/Components/ParticleSystems/VolumeEmitter", VolumeEmitter_default_);
|
|
3935
3887
|
/* harmony default export */ const ParticleSystems_VolumeEmitter = (VolumeEmitter_default_);
|
|
3936
3888
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Algorithm\")"
|
|
3937
|
-
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.
|
|
3889
|
+
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.0")] .require ("standard/Math/Algorithm");
|
|
3938
3890
|
var Algorithm_default = /*#__PURE__*/__webpack_require__.n(Algorithm_namespaceObject);
|
|
3939
3891
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/WindPhysicsModel.js
|
|
3940
3892
|
/*******************************************************************************
|