Project

General

Profile

« Previous | Next » 

Revision b24e4719

Added by Leszek Koltunski over 5 years ago

Make the Fragment effects truly 3D: change their 4D 'region' into a 3D 'center' (a point in 3D) and 3D 'region' (which is now a set of 3 radii defining an ellipsoid around the center)

Also corresponding changes to the applications.

View differences:

src/main/java/org/distorted/library/effect/Effect.java
32 32
  private final EffectType mType;
33 33
  private final EffectName mName;
34 34
  private final int mDimension;
35
  private final boolean mSupportsR;
36
  private final boolean mSupportsC;
35
  private final int mRegionDim;
36
  private final int mCenterDim;
37 37

  
38 38
  private static long mNextID = 0;
39 39

  
......
53 53
    {
54 54
    mName      = name;
55 55
    mType      = name.getType();
56
    mDimension = name.getDimension();
57
    mSupportsC = name.supportsCenter();
58
    mSupportsR = name.supportsRegion();
56
    mDimension = name.getEffectDimension();
57
    mCenterDim = name.getCenterDimension();
58
    mRegionDim = name.getRegionDimension();
59 59

  
60 60
    int n = name.ordinal();
61 61
    float[] u = name.getUnity();
......
167 167

  
168 168
///////////////////////////////////////////////////////////////////////////////////////////////////
169 169
/**
170
 * Does this effect have a Center?
170
 * Return the dimension of the Center supported by this effect (0- no center supported at all).
171 171
 */
172
  public boolean supportsCenter()
172
  public int getCenterDimension()
173 173
    {
174
    return mSupportsC;
174
    return mCenterDim;
175 175
    }
176 176

  
177 177
///////////////////////////////////////////////////////////////////////////////////////////////////
178 178
/**
179
 * Does this effect support being masked by a Region?
179
 * Return the dimension of the Region supported by this effect (0- no region supported at all).
180 180
 */
181
  public boolean supportsRegion()
181
  public int getRegionDimension()
182 182
    {
183
    return mSupportsR;
183
    return mRegionDim;
184 184
    }
185 185

  
186 186
///////////////////////////////////////////////////////////////////////////////////////////////////
187 187
/**
188 188
 * Return the number of Uniforms needed to describe this effect.
189 189
 */
190
  public int getDimension()
190
  public int getEffectDimension()
191 191
    {
192 192
    return mDimension;
193 193
    }

Also available in: Unified diff