Project

General

Profile

« Previous | Next » 

Revision f046b159

Added by Leszek Koltunski almost 4 years ago

First attempt at the MeshBase.apply(VertexEffect) API.

View differences:

src/main/java/org/distorted/library/effect/VertexEffectMove.java
28 28
 */
29 29
public class VertexEffectMove extends VertexEffect
30 30
  {
31
  private static final EffectName NAME = EffectName.VERTEX_MOVE;
32

  
31 33
  private Data3D mVector;
32 34

  
33 35
///////////////////////////////////////////////////////////////////////////////////////////////////
......
38 40
 */
39 41
  public boolean compute(float[] uniforms, int index, long currentDuration, long step )
40 42
    {
41
    return mVector.get(uniforms,index,currentDuration,step);
43
    return mVector.get(uniforms,index+VALUES_OFFSET,currentDuration,step);
44
    }
45

  
46
///////////////////////////////////////////////////////////////////////////////////////////////////
47

  
48
  static String code()
49
    {
50
    return "v += vUniforms[effect].xyz;";
42 51
    }
43 52

  
44 53
///////////////////////////////////////////////////////////////////////////////////////////////////
......
49 58
 */
50 59
  public static void enable()
51 60
    {
52
    addEffect( EffectName.VERTEX_MOVE, "v += vUniforms[effect].xyz;" );
61
    addEffect( NAME, code() );
53 62
    }
54 63

  
55 64
///////////////////////////////////////////////////////////////////////////////////////////////////
......
60 69
 */
61 70
  public VertexEffectMove(Data3D vector)
62 71
    {
63
    super(EffectName.VERTEX_MOVE);
72
    super(NAME);
64 73
    mVector = vector;
65 74
    }
66 75
  }

Also available in: Unified diff