Project

General

Profile

« Previous | Next » 

Revision f0fa83ae

Added by Leszek Koltunski about 4 years ago

Some fixes for the Pyraminx.

View differences:

src/main/java/org/distorted/object/RubikCube.java
25 25
import org.distorted.library.effect.MatrixEffect;
26 26
import org.distorted.library.effect.MatrixEffectMove;
27 27
import org.distorted.library.effect.MatrixEffectRotate;
28
import org.distorted.library.effect.VertexEffectSink;
28 29
import org.distorted.library.main.DistortedEffects;
29 30
import org.distorted.library.main.DistortedTexture;
30 31
import org.distorted.library.mesh.MeshBase;
......
117 118
    return FACE_COLORS.length;
118 119
    }
119 120

  
121
///////////////////////////////////////////////////////////////////////////////////////////////////
122

  
123
  float getScreenRatio()
124
    {
125
    return 0.5f;
126
    }
127

  
128
///////////////////////////////////////////////////////////////////////////////////////////////////
129

  
130
  VertexEffectSink getSink(int size)
131
    {
132
    Static3D center = new Static3D(0,0,0);
133
    Static4D region = new Static4D(0,0,0,0.72f);
134
    float strength;
135

  
136
    switch(size)
137
      {
138
      case 1 : strength= 1.1f; break;
139
      case 2 : strength= 1.5f; break;
140
      case 3 : strength= 1.8f; break;
141
      case 4 : strength= 2.0f; break;
142
      default: strength= 3.0f - 4.0f/size;
143
      }
144

  
145
    return new VertexEffectSink( new Static1D(strength), center, region );
146
    }
147

  
120 148
///////////////////////////////////////////////////////////////////////////////////////////////////
121 149

  
122 150
  Static3D[] getRotationAxis()

Also available in: Unified diff