Project

General

Profile

« Previous | Next » 

Revision 7bebb196

Added by Leszek Koltunski over 5 years ago

Massive: make the coordinate system agree with that of OpenGL (i.e. invert the Y axis).

View differences:

src/main/java/org/distorted/library/effect/VertexEffectDistort.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+1] =-uniforms[index+1];
48
    uniforms[index+REGION_OFFSET+1] =-uniforms[index+REGION_OFFSET+1];  // region's y
49

  
50
    return ret;
45
    return mVector.get(uniforms,index,currentDuration,step);
51 46
    }
52 47

  
53 48
///////////////////////////////////////////////////////////////////////////////////////////////////
......
113 108
    addEffect(EffectName.DISTORT,
114 109

  
115 110
        "vec3 center = vUniforms[effect+1].yzw; \n"
116
      + "vec3 ps = center-v.xyz; \n"
111
      + "vec3 ps = center-v; \n"
117 112
      + "vec3 force = vUniforms[effect].xyz; \n"
118 113
      + "float d = degree(vUniforms[effect+2],center,ps); \n"
119 114
      + "float denom = dot(ps+(1.0-d)*force,ps); \n"

Also available in: Unified diff