commit 9a901a4e26a30f49de4234d8acd2f32c5d3317dd
Author: LeszekKoltunski <leszek@koltunski.pl>
Date:   Thu May 29 00:18:43 2025 +0200

    fix for the issue that VertexEffects couldn't be pre-applied to meshes.

diff --git a/src/main/java/org/distorted/library/effect/VertexEffectDeform.kt b/src/main/java/org/distorted/library/effect/VertexEffectDeform.kt
index 5ecde57..4e81e59 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectDeform.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectDeform.kt
@@ -95,7 +95,7 @@ class VertexEffectDeform : VertexEffect
         ///////////////////////////////////////////////////////////////////////////////////////////
         // 2020-05-03: replaced vec3 'u_Bounding' with a uniform 'vUniforms[effect].w' (i.e. mRadius)
         ///////////////////////////////////////////////////////////////////////////////////////////
-        fun code(): String
+        @JvmStatic fun code(): String
         {
             return ("""
                      const vec3 ONE = vec3(1.0,1.0,1.0);                                 
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectDisappear.kt b/src/main/java/org/distorted/library/effect/VertexEffectDisappear.kt
index 537517f..33ddee7 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectDisappear.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectDisappear.kt
@@ -29,7 +29,7 @@ class VertexEffectDisappear : VertexEffect(NAME)
     companion object
     {
         private val NAME = EffectName.DISAPPEAR
-        fun code(): String = "v = vec3(0.0, 0.0, 0.0);"
+        @JvmStatic fun code(): String = "v = vec3(0.0, 0.0, 0.0);"
         @JvmStatic fun enable() = addEffect(NAME, code())
     }
 
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectDistort.kt b/src/main/java/org/distorted/library/effect/VertexEffectDistort.kt
index 808e8ed..7c09c4a 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectDistort.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectDistort.kt
@@ -111,7 +111,7 @@ class VertexEffectDistort : VertexEffect
         // which makes Vrot = (a+n.y*c , b-n.y*c , v*n) where
         // a = vx*nz-vz*nx , b = vy*nz-vz*ny , c = (vx*ny-vy*nx)/(1+nz)    (unless n=(0,0,-1))
         ///////////////////////////////////////////////////////////////////////////////////////////////////
-        fun code(): String
+        @JvmStatic fun code(): String
         {
             return (""" vec3 ps = vUniforms[effect+1].yzw - v;                        
                         vec3 force = vUniforms[effect].xyz;                           
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectMove.kt b/src/main/java/org/distorted/library/effect/VertexEffectMove.kt
index 561c1d9..dc69165 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectMove.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectMove.kt
@@ -33,7 +33,7 @@ class VertexEffectMove(vector: Data3D) : VertexEffect(NAME)
     companion object
     {
         private val NAME = EffectName.VERTEX_MOVE
-        fun code(): String = "v += vUniforms[effect].xyz;"
+        @JvmStatic fun code(): String = "v += vUniforms[effect].xyz;"
         @JvmStatic fun enable() = addEffect(NAME, code())
     }
     ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectPinch.kt b/src/main/java/org/distorted/library/effect/VertexEffectPinch.kt
index cd4892c..120f84f 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectPinch.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectPinch.kt
@@ -49,7 +49,7 @@ class VertexEffectPinch : VertexEffect
         // when h>1 we are pushing points away from S: P' = P + (1/h-1)*dist(line to P)
         // (where 'line' above passes through the center point and goes along the vector)
         ///////////////////////////////////////////////////////////////////////////////////////////
-        fun code(): String
+        @JvmStatic fun code(): String
         {
             return ("""
                      vec3 ps = vUniforms[effect+1].yzw -v;               
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectPipe.kt b/src/main/java/org/distorted/library/effect/VertexEffectPipe.kt
index 2fd4994..207b0d1 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectPipe.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectPipe.kt
@@ -43,7 +43,7 @@ class VertexEffectPipe(pipe: Data5D, center: Data3D) : VertexEffect(NAME)
         // line defined by 'center' and 'vect' (so 'ps' is very small)
         // Then by means of some miracle we have
         // dot_ps>0, (sign_ps-1.0)==0.0 and dot_ps-(sign_ps-1.0) == 0.0 !! so n_ps - undef.
-        fun code(): String
+        @JvmStatic fun code(): String
         {
             return ("""
                      vec3 pc = vUniforms[effect+1].yzw - v;            
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectQuaternion.kt b/src/main/java/org/distorted/library/effect/VertexEffectQuaternion.kt
index 1e4caab..65b728b 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectQuaternion.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectQuaternion.kt
@@ -37,7 +37,7 @@ class VertexEffectQuaternion(quaternion: Data4D, center: Data3D) : VertexEffect(
         private val NAME = EffectName.VERTEX_QUATERNION
 
         ///////////////////////////////////////////////////////////////////////////////////////////////////
-        fun code(): String
+        @JvmStatic fun code(): String
         {
             return ("""
                      float qx = vUniforms[effect].x;               
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectRotate.kt b/src/main/java/org/distorted/library/effect/VertexEffectRotate.kt
index 35829a1..1534842 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectRotate.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectRotate.kt
@@ -39,7 +39,7 @@ class VertexEffectRotate(angle: Data1D, axis: Data3D, center: Data3D) : VertexEf
         private val NAME = EffectName.VERTEX_ROTATE
 
         ///////////////////////////////////////////////////////////////////////////////////////////////////
-        fun code(): String
+        @JvmStatic fun code(): String
         {
             return ("""
                      float angle = vUniforms[effect].x*3.14159265/360.0;
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectScale.kt b/src/main/java/org/distorted/library/effect/VertexEffectScale.kt
index 978ace0..3291206 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectScale.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectScale.kt
@@ -36,7 +36,7 @@ class VertexEffectScale : VertexEffect
         private val NAME = EffectName.VERTEX_SCALE
 
         ///////////////////////////////////////////////////////////////////////////////////////////////////
-        fun code(): String
+        @JvmStatic fun code(): String
         {
             return """
                  v *= vUniforms[effect].xyz;                        
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectShear.kt b/src/main/java/org/distorted/library/effect/VertexEffectShear.kt
index e613d90..ff65bcf 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectShear.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectShear.kt
@@ -37,7 +37,7 @@ class VertexEffectShear(shear: Data3D, center: Data3D) : VertexEffect(NAME)
 
         ///////////////////////////////////////////////////////////////////////////////////////////
         // For explanation (esp. about the way we modify vectors n and i) see MatrixEffectShear.
-        fun code(): String
+        @JvmStatic fun code(): String
         {
             return ("""
                      float sx = vUniforms[effect].x;                  
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectSink.kt b/src/main/java/org/distorted/library/effect/VertexEffectSink.kt
index 7d13574..41fa13c 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectSink.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectSink.kt
@@ -45,7 +45,7 @@ class VertexEffectSink : VertexEffect
         // Changed to the four complicated lines because the previous Sink effect fails to fully inflate the
         // Masterball.
         // Current function inflates and deflates much more as H is at the extremes (close to 0 and inf)
-        fun code(): String
+        @JvmStatic fun code(): String
         {
             return ("""
                      vec3 ps = vUniforms[effect+1].yzw - v;            
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectSwirl.kt b/src/main/java/org/distorted/library/effect/VertexEffectSwirl.kt
index c833a2b..2d647be 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectSwirl.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectSwirl.kt
@@ -48,7 +48,7 @@ class VertexEffectSwirl : VertexEffect
         // This effect rotates the current vertex V by vInterpolated.x radians clockwise around the circle dilated
         // by (1-d) around the center of the effect S.
         ///////////////////////////////////////////////////////////////////////////////////////////////////
-        fun code(): String
+        @JvmStatic fun code(): String
         {
             return ("""
                      vec3 center = vUniforms[effect+1].yzw;                             
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectWave.kt b/src/main/java/org/distorted/library/effect/VertexEffectWave.kt
index 065e54e..8aa0872 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectWave.kt
+++ b/src/main/java/org/distorted/library/effect/VertexEffectWave.kt
@@ -106,7 +106,7 @@ class VertexEffectWave : VertexEffect
         //
         // Generally speaking I'd keep to amplitude < length, as the opposite case has some other problems as well.
         ///////////////////////////////////////////////////////////////////////////////////////////
-        fun code(): String
+        @JvmStatic fun code(): String
         {
             return ("""
                      vec3 center     = vUniforms[effect+1].yzw;                   
