x_ite 9.5.0 → 9.5.2
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 +1 -1
- package/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +14 -14
- 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 +18 -18
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +33 -33
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +32 -34
- 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 +101 -66
- 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 +97 -44
- 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 +862 -653
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.min.mjs +1 -1
- package/dist/x_ite.mjs +862 -653
- package/dist/x_ite.zip +0 -0
- package/package.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/* X_ITE v9.5.
|
|
1
|
+
/* X_ITE v9.5.2 */(() => { // 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.5.
|
|
8
|
+
module.exports = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("lib/jquery");
|
|
9
9
|
|
|
10
10
|
/***/ })
|
|
11
11
|
|
|
@@ -73,28 +73,28 @@ 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.5.
|
|
76
|
+
const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .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.5.
|
|
79
|
+
const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .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.5.
|
|
82
|
+
const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .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.5.
|
|
85
|
+
const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .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.5.
|
|
88
|
+
const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("x_ite/Components/Core/X3DNode");
|
|
89
89
|
var X3DNode_default = /*#__PURE__*/__webpack_require__.n(X3DNode_namespaceObject);
|
|
90
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.
|
|
91
|
+
const GeometryTypes_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("x_ite/Browser/ParticleSystems/GeometryTypes");
|
|
92
92
|
var GeometryTypes_default = /*#__PURE__*/__webpack_require__.n(GeometryTypes_namespaceObject);
|
|
93
93
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DConstants\")"
|
|
94
|
-
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
94
|
+
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("x_ite/Base/X3DConstants");
|
|
95
95
|
var X3DConstants_default = /*#__PURE__*/__webpack_require__.n(X3DConstants_namespaceObject);
|
|
96
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.
|
|
97
|
+
const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("x_ite/Namespace");
|
|
98
98
|
var Namespace_default = /*#__PURE__*/__webpack_require__.n(Namespace_namespaceObject);
|
|
99
99
|
;// CONCATENATED MODULE: ./src/x_ite/Browser/ParticleSystems/Line3.glsl.js
|
|
100
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;}`
|
|
@@ -118,7 +118,7 @@ Namespace_default().add ("Box3.glsl", "x_ite/Browser/ParticleSystems/Box3.glsl",
|
|
|
118
118
|
const BVH_glsl_default_ = /* glsl */ `#define BVH_NODE 0
|
|
119
119
|
#define BVH_TRIANGLE 1
|
|
120
120
|
#define BVH_STACK_SIZE 32
|
|
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]=
|
|
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;}`
|
|
122
122
|
;
|
|
123
123
|
|
|
124
124
|
Namespace_default().add ("BVH.glsl", "x_ite/Browser/ParticleSystems/BVH.glsl", BVH_glsl_default_);
|
|
@@ -363,13 +363,12 @@ Object .assign (Object .setPrototypeOf (X3DParticleEmitterNode .prototype, (X3DN
|
|
|
363
363
|
gl .enableVertexAttribArray (attribute);
|
|
364
364
|
gl .vertexAttribPointer (attribute, 4, gl .FLOAT, false, particlesStride, particleOffsets [i]);
|
|
365
365
|
}
|
|
366
|
-
|
|
367
|
-
gl .bindBuffer (gl .ARRAY_BUFFER, null);
|
|
368
366
|
}
|
|
369
367
|
|
|
370
368
|
// Transform particles.
|
|
371
369
|
|
|
372
370
|
gl .bindFramebuffer (gl .FRAMEBUFFER, null); // Prevent texture feedback loop error, see NYC in Firefox.
|
|
371
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, null);
|
|
373
372
|
gl .bindTransformFeedback (gl .TRANSFORM_FEEDBACK, this .transformFeedback);
|
|
374
373
|
gl .bindBufferBase (gl .TRANSFORM_FEEDBACK_BUFFER, 0, particleSystem .outputParticles);
|
|
375
374
|
gl .enable (gl .RASTERIZER_DISCARD);
|
|
@@ -420,7 +419,7 @@ ${Object .values (this .uniforms) .join ("\n")}
|
|
|
420
419
|
${Object .entries ((GeometryTypes_default())) .map (([k, v]) => `#define ${k} ${v}`) .join ("\n")}
|
|
421
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);}
|
|
422
421
|
${this .functions .join ("\n")}
|
|
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;
|
|
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;}}}`
|
|
424
423
|
|
|
425
424
|
const fragmentShaderSource = /* glsl */ `#version 300 es
|
|
426
425
|
precision highp float;void main(){}`
|
|
@@ -557,7 +556,7 @@ const X3DParticleEmitterNode_default_ = X3DParticleEmitterNode;
|
|
|
557
556
|
Namespace_default().add ("X3DParticleEmitterNode", "x_ite/Components/ParticleSystems/X3DParticleEmitterNode", X3DParticleEmitterNode_default_);
|
|
558
557
|
/* harmony default export */ const ParticleSystems_X3DParticleEmitterNode = (X3DParticleEmitterNode_default_);
|
|
559
558
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
|
|
560
|
-
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
559
|
+
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("standard/Math/Numbers/Vector3");
|
|
561
560
|
var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
|
|
562
561
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/PointEmitter.js
|
|
563
562
|
/*******************************************************************************
|
|
@@ -876,7 +875,7 @@ const X3DParticlePhysicsModelNode_default_ = X3DParticlePhysicsModelNode;
|
|
|
876
875
|
Namespace_default().add ("X3DParticlePhysicsModelNode", "x_ite/Components/ParticleSystems/X3DParticlePhysicsModelNode", X3DParticlePhysicsModelNode_default_);
|
|
877
876
|
/* harmony default export */ const ParticleSystems_X3DParticlePhysicsModelNode = (X3DParticlePhysicsModelNode_default_);
|
|
878
877
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DCast\")"
|
|
879
|
-
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
878
|
+
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("x_ite/Base/X3DCast");
|
|
880
879
|
var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
|
|
881
880
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js
|
|
882
881
|
/*******************************************************************************
|
|
@@ -952,16 +951,16 @@ Object .assign (Object .setPrototypeOf (BoundedPhysicsModel .prototype, Particle
|
|
|
952
951
|
},
|
|
953
952
|
set_geometry__ ()
|
|
954
953
|
{
|
|
955
|
-
|
|
956
|
-
this .geometryNode ._rebuild .removeInterest ("addNodeEvent", this);
|
|
954
|
+
this .geometryNode ?._rebuild .removeInterest ("addNodeEvent", this);
|
|
957
955
|
|
|
958
956
|
this .geometryNode = X3DCast_default() ((X3DConstants_default()).X3DGeometryNode, this ._geometry);
|
|
959
957
|
|
|
960
|
-
|
|
961
|
-
this .geometryNode ._rebuild .addInterest ("addNodeEvent", this);
|
|
958
|
+
this .geometryNode ?._rebuild .addInterest ("addNodeEvent", this);
|
|
962
959
|
},
|
|
963
960
|
addGeometry (boundedNormals, boundedVertices)
|
|
964
961
|
{
|
|
962
|
+
const damping = this ._damping .getValue ();
|
|
963
|
+
|
|
965
964
|
if (this .geometryNode && this ._enabled .getValue ())
|
|
966
965
|
{
|
|
967
966
|
const
|
|
@@ -969,7 +968,7 @@ Object .assign (Object .setPrototypeOf (BoundedPhysicsModel .prototype, Particle
|
|
|
969
968
|
vertices = this .geometryNode .getVertices () .getValue ();
|
|
970
969
|
|
|
971
970
|
for (const value of normals)
|
|
972
|
-
boundedNormals .push (value);
|
|
971
|
+
boundedNormals .push (value * damping);
|
|
973
972
|
|
|
974
973
|
for (const value of vertices)
|
|
975
974
|
boundedVertices .push (value);
|
|
@@ -1004,6 +1003,7 @@ Object .defineProperties (BoundedPhysicsModel,
|
|
|
1004
1003
|
value: new (FieldDefinitionArray_default()) ([
|
|
1005
1004
|
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "metadata", new (Fields_default()).SFNode ()),
|
|
1006
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
|
|
1007
1007
|
new (X3DFieldDefinition_default()) ((X3DConstants_default()).inputOutput, "geometry", new (Fields_default()).SFNode ()),
|
|
1008
1008
|
]),
|
|
1009
1009
|
enumerable: true,
|
|
@@ -1450,28 +1450,34 @@ const ForcePhysicsModel_default_ = ForcePhysicsModel;
|
|
|
1450
1450
|
Namespace_default().add ("ForcePhysicsModel", "x_ite/Components/ParticleSystems/ForcePhysicsModel", ForcePhysicsModel_default_);
|
|
1451
1451
|
/* harmony default export */ const ParticleSystems_ForcePhysicsModel = (ForcePhysicsModel_default_);
|
|
1452
1452
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/X3DShapeNode\")"
|
|
1453
|
-
const X3DShapeNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
1453
|
+
const X3DShapeNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("x_ite/Components/Shape/X3DShapeNode");
|
|
1454
1454
|
var X3DShapeNode_default = /*#__PURE__*/__webpack_require__.n(X3DShapeNode_namespaceObject);
|
|
1455
1455
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Browser/Rendering/GeometryContext\")"
|
|
1456
|
-
const GeometryContext_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
1456
|
+
const GeometryContext_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("x_ite/Browser/Rendering/GeometryContext");
|
|
1457
1457
|
var GeometryContext_default = /*#__PURE__*/__webpack_require__.n(GeometryContext_namespaceObject);
|
|
1458
1458
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/VertexArray\")"
|
|
1459
|
-
const VertexArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
1459
|
+
const VertexArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("x_ite/Rendering/VertexArray");
|
|
1460
1460
|
var VertexArray_default = /*#__PURE__*/__webpack_require__.n(VertexArray_namespaceObject);
|
|
1461
1461
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/TraverseType\")"
|
|
1462
|
-
const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
1462
|
+
const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("x_ite/Rendering/TraverseType");
|
|
1463
1463
|
var TraverseType_default = /*#__PURE__*/__webpack_require__.n(TraverseType_namespaceObject);
|
|
1464
1464
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Browser/Shape/AlphaMode\")"
|
|
1465
|
-
const AlphaMode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
1465
|
+
const AlphaMode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("x_ite/Browser/Shape/AlphaMode");
|
|
1466
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.2")] .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.2")] .require ("x_ite/Components/Rendering/Coordinate");
|
|
1472
|
+
var Coordinate_default = /*#__PURE__*/__webpack_require__.n(Coordinate_namespaceObject);
|
|
1467
1473
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Matrix4\")"
|
|
1468
|
-
const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
1474
|
+
const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("standard/Math/Numbers/Matrix4");
|
|
1469
1475
|
var Matrix4_default = /*#__PURE__*/__webpack_require__.n(Matrix4_namespaceObject);
|
|
1470
1476
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Matrix3\")"
|
|
1471
|
-
const Matrix3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
1477
|
+
const Matrix3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("standard/Math/Numbers/Matrix3");
|
|
1472
1478
|
var Matrix3_default = /*#__PURE__*/__webpack_require__.n(Matrix3_namespaceObject);
|
|
1473
1479
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Plane3\")"
|
|
1474
|
-
const Plane3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
1480
|
+
const Plane3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("standard/Math/Geometry/Plane3");
|
|
1475
1481
|
var Plane3_default = /*#__PURE__*/__webpack_require__.n(Plane3_namespaceObject);
|
|
1476
1482
|
;// CONCATENATED MODULE: ./src/standard/Math/Algorithms/QuickSort.js
|
|
1477
1483
|
/*******************************************************************************
|
|
@@ -2032,16 +2038,9 @@ Namespace_default().add ("BVH", "standard/Math/Utility/BVH", BVH_default_);
|
|
|
2032
2038
|
|
|
2033
2039
|
|
|
2034
2040
|
|
|
2035
|
-
const PointGeometry = new Float32Array ([0, 0, 0, 1]);
|
|
2036
2041
|
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
0, 0, 0, 1,
|
|
2040
|
-
1, 0, 0, 1,
|
|
2041
|
-
// Vertices
|
|
2042
|
-
0, 0, -0.5, 1,
|
|
2043
|
-
0, 0, 0.5, 1,
|
|
2044
|
-
]);
|
|
2042
|
+
|
|
2043
|
+
const PointGeometry = new Float32Array ([0, 0, 0, 1]);
|
|
2045
2044
|
|
|
2046
2045
|
// p4 ------ p3
|
|
2047
2046
|
// | / |
|
|
@@ -2108,6 +2107,7 @@ function ParticleSystem (executionContext)
|
|
|
2108
2107
|
this .particleOffsets = Array .from ({length: 7}, (_, i) => Float32Array .BYTES_PER_ELEMENT * 4 * i); // i x vec4
|
|
2109
2108
|
this .particleOffset = this .particleOffsets [0];
|
|
2110
2109
|
this .colorOffset = this .particleOffsets [1];
|
|
2110
|
+
this .velocityOffset = this .particleOffsets [2];
|
|
2111
2111
|
this .matrixOffset = this .particleOffsets [3];
|
|
2112
2112
|
this .texCoordOffset = 0;
|
|
2113
2113
|
this .instancesStride = this .particlesStride;
|
|
@@ -2139,6 +2139,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2139
2139
|
this ._maxParticles .addInterest ("set_enabled__", this);
|
|
2140
2140
|
this ._particleLifetime .addInterest ("set_particleLifetime__", this);
|
|
2141
2141
|
this ._lifetimeVariation .addInterest ("set_lifetimeVariation__", this);
|
|
2142
|
+
this ._particleSize .addInterest ("set_particleSize__", this);
|
|
2142
2143
|
this ._emitter .addInterest ("set_emitter__", this);
|
|
2143
2144
|
this ._physics .addInterest ("set_physics__", this);
|
|
2144
2145
|
this ._colorKey .addInterest ("set_color__", this);
|
|
@@ -2148,11 +2149,21 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2148
2149
|
|
|
2149
2150
|
// Create particles stuff.
|
|
2150
2151
|
|
|
2151
|
-
this .inputParticles
|
|
2152
|
-
|
|
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
|
+
});
|
|
2153
2159
|
|
|
2154
|
-
this .
|
|
2155
|
-
|
|
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
|
+
});
|
|
2156
2167
|
|
|
2157
2168
|
// Create forces stuff.
|
|
2158
2169
|
|
|
@@ -2166,6 +2177,19 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2166
2177
|
this .geometryBuffer = this .createBuffer ();
|
|
2167
2178
|
this .texCoordBuffers = new Array (browser .getMaxTexCoords ()) .fill (this .geometryBuffer);
|
|
2168
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
|
+
|
|
2169
2193
|
// Init fields.
|
|
2170
2194
|
// Call order is very important at startup.
|
|
2171
2195
|
|
|
@@ -2175,6 +2199,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2175
2199
|
this .set_createParticles__ ();
|
|
2176
2200
|
this .set_particleLifetime__ ();
|
|
2177
2201
|
this .set_lifetimeVariation__ ();
|
|
2202
|
+
this .set_particleSize__ ();
|
|
2178
2203
|
this .set_physics__ ();
|
|
2179
2204
|
this .set_colorRamp__ ();
|
|
2180
2205
|
this .set_texCoordRamp__ ();
|
|
@@ -2333,7 +2358,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2333
2358
|
this .geometryContext .geometryType = 0;
|
|
2334
2359
|
this .geometryContext .hasNormals = false;
|
|
2335
2360
|
|
|
2336
|
-
this .texCoordCount
|
|
2361
|
+
this .texCoordCount = 0;
|
|
2337
2362
|
this .vertexCount = 1;
|
|
2338
2363
|
this .hasNormals = false;
|
|
2339
2364
|
this .verticesOffset = 0;
|
|
@@ -2349,16 +2374,7 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2349
2374
|
this .geometryContext .geometryType = 1;
|
|
2350
2375
|
this .geometryContext .hasNormals = false;
|
|
2351
2376
|
|
|
2352
|
-
this .texCoordCount
|
|
2353
|
-
this .vertexCount = 2;
|
|
2354
|
-
this .hasNormals = false;
|
|
2355
|
-
this .texCoordsOffset = 0;
|
|
2356
|
-
this .verticesOffset = Float32Array .BYTES_PER_ELEMENT * 8;
|
|
2357
|
-
this .primitiveMode = gl .LINES;
|
|
2358
|
-
|
|
2359
|
-
gl .bindBuffer (gl .ARRAY_BUFFER, this .geometryBuffer);
|
|
2360
|
-
gl .bufferData (gl .ARRAY_BUFFER, LineGeometry, gl .DYNAMIC_DRAW);
|
|
2361
|
-
|
|
2377
|
+
this .texCoordCount = 0;
|
|
2362
2378
|
break;
|
|
2363
2379
|
}
|
|
2364
2380
|
case (GeometryTypes_default()).TRIANGLE:
|
|
@@ -2416,6 +2432,11 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2416
2432
|
{
|
|
2417
2433
|
this .lifetimeVariation = this ._lifetimeVariation .getValue ();
|
|
2418
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
|
+
},
|
|
2419
2440
|
set_emitter__ ()
|
|
2420
2441
|
{
|
|
2421
2442
|
this .emitterNode = X3DCast_default() ((X3DConstants_default()).X3DParticleEmitterNode, this ._emitter);
|
|
@@ -2614,8 +2635,11 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2614
2635
|
},
|
|
2615
2636
|
updateVertexArrays ()
|
|
2616
2637
|
{
|
|
2617
|
-
this .inputParticles .vertexArrayObject
|
|
2618
|
-
this .outputParticles .vertexArrayObject
|
|
2638
|
+
this .inputParticles .vertexArrayObject .update ();
|
|
2639
|
+
this .outputParticles .vertexArrayObject .update ();
|
|
2640
|
+
|
|
2641
|
+
this .inputParticles .thickLinesVertexArrayObject .update ();
|
|
2642
|
+
this .outputParticles .thickLinesVertexArrayObject .update ();
|
|
2619
2643
|
},
|
|
2620
2644
|
createTexture ()
|
|
2621
2645
|
{
|
|
@@ -2864,6 +2888,11 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2864
2888
|
|
|
2865
2889
|
switch (this .geometryType)
|
|
2866
2890
|
{
|
|
2891
|
+
case (GeometryTypes_default()).LINE:
|
|
2892
|
+
{
|
|
2893
|
+
this .lineGeometryNode .displaySimpleInstanced (gl, shaderNode, this);
|
|
2894
|
+
break;
|
|
2895
|
+
}
|
|
2867
2896
|
case (GeometryTypes_default()).GEOMETRY:
|
|
2868
2897
|
{
|
|
2869
2898
|
this .getGeometry () ?.displaySimpleInstanced (gl, shaderNode, this);
|
|
@@ -2898,6 +2927,11 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2898
2927
|
|
|
2899
2928
|
switch (this .geometryType)
|
|
2900
2929
|
{
|
|
2930
|
+
case (GeometryTypes_default()).LINE:
|
|
2931
|
+
{
|
|
2932
|
+
this .lineGeometryNode .displayInstanced (gl, renderContext, this);
|
|
2933
|
+
break;
|
|
2934
|
+
}
|
|
2901
2935
|
case (GeometryTypes_default()).GEOMETRY:
|
|
2902
2936
|
{
|
|
2903
2937
|
this .getGeometry () ?.displayInstanced (gl, renderContext, this);
|
|
@@ -2950,10 +2984,11 @@ Object .assign (Object .setPrototypeOf (ParticleSystem .prototype, (X3DShapeNode
|
|
|
2950
2984
|
|
|
2951
2985
|
if (outputParticles .vertexArrayObject .enable (shaderNode .getProgram ()))
|
|
2952
2986
|
{
|
|
2953
|
-
const particlesStride = this
|
|
2987
|
+
const { particlesStride } = this;
|
|
2954
2988
|
|
|
2955
|
-
shaderNode .enableParticleAttribute
|
|
2956
|
-
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);
|
|
2957
2992
|
|
|
2958
2993
|
if (this .geometryContext .colorMaterial)
|
|
2959
2994
|
{
|
|
@@ -3075,7 +3110,7 @@ const ParticleSystem_default_ = ParticleSystem;
|
|
|
3075
3110
|
Namespace_default().add ("ParticleSystem", "x_ite/Components/ParticleSystems/ParticleSystem", ParticleSystem_default_);
|
|
3076
3111
|
/* harmony default export */ const ParticleSystems_ParticleSystem = (ParticleSystem_default_);
|
|
3077
3112
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Rendering/IndexedLineSet\")"
|
|
3078
|
-
const IndexedLineSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
3113
|
+
const IndexedLineSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("x_ite/Components/Rendering/IndexedLineSet");
|
|
3079
3114
|
var IndexedLineSet_default = /*#__PURE__*/__webpack_require__.n(IndexedLineSet_namespaceObject);
|
|
3080
3115
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/PolylineEmitter.js
|
|
3081
3116
|
/*******************************************************************************
|
|
@@ -3215,12 +3250,12 @@ Object .assign (Object .setPrototypeOf (PolylineEmitter .prototype, ParticleSyst
|
|
|
3215
3250
|
this .polylinesNode ._coordIndex = this ._coordIndex;
|
|
3216
3251
|
this .polylinesNode ._coord = this ._coord;
|
|
3217
3252
|
|
|
3218
|
-
this .polylinesNode ._rebuild .addInterest ("set_polyline", this);
|
|
3219
3253
|
this .polylinesNode .setPrivate (true);
|
|
3220
3254
|
this .polylinesNode .setup ();
|
|
3255
|
+
this .polylinesNode ._rebuild .addInterest ("set_polylines__", this);
|
|
3221
3256
|
|
|
3222
3257
|
this .set_direction__ ();
|
|
3223
|
-
this .
|
|
3258
|
+
this .set_polylines__ ();
|
|
3224
3259
|
},
|
|
3225
3260
|
set_direction__: (() =>
|
|
3226
3261
|
{
|
|
@@ -3233,7 +3268,7 @@ Object .assign (Object .setPrototypeOf (PolylineEmitter .prototype, ParticleSyst
|
|
|
3233
3268
|
this .setUniform ("uniform3f", "direction", direction .x, direction .y, direction .z);
|
|
3234
3269
|
};
|
|
3235
3270
|
})(),
|
|
3236
|
-
|
|
3271
|
+
set_polylines__: (() =>
|
|
3237
3272
|
{
|
|
3238
3273
|
const
|
|
3239
3274
|
vertex1 = new (Vector3_default()) (),
|
|
@@ -3329,7 +3364,7 @@ const PolylineEmitter_default_ = PolylineEmitter;
|
|
|
3329
3364
|
Namespace_default().add ("PolylineEmitter", "x_ite/Components/ParticleSystems/PolylineEmitter", PolylineEmitter_default_);
|
|
3330
3365
|
/* harmony default export */ const ParticleSystems_PolylineEmitter = (PolylineEmitter_default_);
|
|
3331
3366
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Triangle3\")"
|
|
3332
|
-
const Triangle3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
3367
|
+
const Triangle3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("standard/Math/Geometry/Triangle3");
|
|
3333
3368
|
var Triangle3_default = /*#__PURE__*/__webpack_require__.n(Triangle3_namespaceObject);
|
|
3334
3369
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/SurfaceEmitter.js
|
|
3335
3370
|
/*******************************************************************************
|
|
@@ -3589,7 +3624,7 @@ const SurfaceEmitter_default_ = SurfaceEmitter;
|
|
|
3589
3624
|
Namespace_default().add ("SurfaceEmitter", "x_ite/Components/ParticleSystems/SurfaceEmitter", SurfaceEmitter_default_);
|
|
3590
3625
|
/* harmony default export */ const ParticleSystems_SurfaceEmitter = (SurfaceEmitter_default_);
|
|
3591
3626
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Geometry3D/IndexedFaceSet\")"
|
|
3592
|
-
const IndexedFaceSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
3627
|
+
const IndexedFaceSet_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("x_ite/Components/Geometry3D/IndexedFaceSet");
|
|
3593
3628
|
var IndexedFaceSet_default = /*#__PURE__*/__webpack_require__.n(IndexedFaceSet_namespaceObject);
|
|
3594
3629
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/VolumeEmitter.js
|
|
3595
3630
|
/*******************************************************************************
|
|
@@ -3750,9 +3785,9 @@ Object .assign (Object .setPrototypeOf (VolumeEmitter .prototype, ParticleSystem
|
|
|
3750
3785
|
this .volumeNode ._coordIndex = this ._coordIndex;
|
|
3751
3786
|
this .volumeNode ._coord = this ._coord;
|
|
3752
3787
|
|
|
3753
|
-
this .volumeNode ._rebuild .addInterest ("set_geometry__", this);
|
|
3754
3788
|
this .volumeNode .setPrivate (true);
|
|
3755
3789
|
this .volumeNode .setup ();
|
|
3790
|
+
this .volumeNode ._rebuild .addInterest ("set_geometry__", this);
|
|
3756
3791
|
|
|
3757
3792
|
this .set_direction__ ();
|
|
3758
3793
|
this .set_geometry__ ();
|
|
@@ -3886,7 +3921,7 @@ const VolumeEmitter_default_ = VolumeEmitter;
|
|
|
3886
3921
|
Namespace_default().add ("VolumeEmitter", "x_ite/Components/ParticleSystems/VolumeEmitter", VolumeEmitter_default_);
|
|
3887
3922
|
/* harmony default export */ const ParticleSystems_VolumeEmitter = (VolumeEmitter_default_);
|
|
3888
3923
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Algorithm\")"
|
|
3889
|
-
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.
|
|
3924
|
+
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.5.2")] .require ("standard/Math/Algorithm");
|
|
3890
3925
|
var Algorithm_default = /*#__PURE__*/__webpack_require__.n(Algorithm_namespaceObject);
|
|
3891
3926
|
;// CONCATENATED MODULE: ./src/x_ite/Components/ParticleSystems/WindPhysicsModel.js
|
|
3892
3927
|
/*******************************************************************************
|