Revision 7bebb196
Added by Leszek Koltunski over 5 years ago
src/main/java/org/distorted/library/effect/VertexEffectDeform.java | ||
---|---|---|
42 | 42 |
{ |
43 | 43 |
mCenter.get(uniforms,index+CENTER_OFFSET,currentDuration,step); |
44 | 44 |
mRegion.get(uniforms,index+REGION_OFFSET,currentDuration,step); |
45 |
boolean ret = mVector.get(uniforms,index,currentDuration,step); |
|
46 |
|
|
47 |
uniforms[index+REGION_OFFSET+1] =-uniforms[index+REGION_OFFSET+1]; // region's y |
|
48 |
|
|
49 |
return ret; |
|
45 |
return mVector.get(uniforms,index,currentDuration,step); |
|
50 | 46 |
} |
51 | 47 |
|
52 | 48 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
116 | 112 |
+ "const float C = 5.0; \n" |
117 | 113 |
|
118 | 114 |
+ "vec3 center = vUniforms[effect+1].yzw; \n" |
119 |
+ "vec3 ps = center-v.xyz; \n"
|
|
115 |
+ "vec3 ps = center-v; \n" |
|
120 | 116 |
+ "vec3 aPS = abs(ps); \n" |
121 | 117 |
+ "vec3 maxps = u_objD + abs(center); \n" |
122 | 118 |
+ "float d = degree_region(vUniforms[effect+2],ps); \n" |
... | ... | |
135 | 131 |
|
136 | 132 |
+ "float mvXvert = -B * ps.x * aForce.y * (1.0-quot.y) * denomV; \n" // impact the vertical component of the force vector has on horizontal movement |
137 | 133 |
+ "float mvYhorz = -B * ps.y * aForce.x * (1.0-quot.x) * denomH; \n" // impact the horizontal component of the force vector has on vertical movement |
138 |
+ "float mvYvert = force.y * (1.0-quot.x*Aw.x*denomV) * vertCorr.y; \n" // impact the vertical component of the force vector has on vertical movement
|
|
139 |
+ "float mvXhorz = -force.x * (1.0-quot.y*Aw.y*denomH) * vertCorr.x; \n" // impact the horizontal component of the force vector has on horizontal movement
|
|
134 |
+ "float mvYvert = force.y * (1.0-quot.x*Aw.x*denomV) * vertCorr.y; \n" // impact the vertical component of the force vector has on vertical movement
|
|
135 |
+ "float mvXhorz = force.x * (1.0-quot.y*Aw.y*denomH) * vertCorr.x; \n" // impact the horizontal component of the force vector has on horizontal movement
|
|
140 | 136 |
|
141 |
+ "v.x -= (mvXvert+mvXhorz); \n"
|
|
142 |
+ "v.y -= (mvYvert+mvYhorz); \n"
|
|
137 |
+ "v.x += (mvXvert+mvXhorz); \n"
|
|
138 |
+ "v.y += (mvYvert+mvYhorz); \n"
|
|
143 | 139 |
|
144 | 140 |
+ "v.z += force.z*d*d*(3.0*d*d -8.0*d +6.0); \n" // thick bubble |
145 | 141 |
+ "float b = -(12.0*force.z*d*(1.0-d)*(1.0-d)*(1.0-d))*one_over_denom; \n" |
Also available in: Unified diff
Massive: make the coordinate system agree with that of OpenGL (i.e. invert the Y axis).