Project

General

Profile

« Previous | Next » 

Revision 10a842b0

Added by Leszek Koltunski over 1 year ago

Progress with the Camouflage 3x3x3.
Now only proper scrambling remains.

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyCamouflage.java
9 9

  
10 10
package org.distorted.objectlib.objects;
11 11

  
12
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_CHANGING_SHAPEMOD;
12
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_CHANGING_MIRROR;
13 13

  
14 14
import org.distorted.library.effect.EffectName;
15 15
import org.distorted.library.type.Static3D;
......
27 27

  
28 28
public class TwistyCamouflage extends TwistyBandagedAbstract
29 29
{
30
  private static final float SIZE_CORRECTION = 1.1f;
31

  
30 32
  public static final float[][] CAM_333 = new float[][]
31 33
    {
32 34
      getCenters( -1.0f, 1.0f, 1.0f, 2, 2, 2),
......
117 119

  
118 120
  public TwistyCamouflage(InitData data, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
119 121
    {
120
    super(data, meshState, iconMode, (data.getNumLayers()[0]+data.getNumLayers()[1]+data.getNumLayers()[2])/3.0f, quat, move, scale, stream);
122
    super(data, meshState, iconMode, SIZE_CORRECTION*(data.getNumLayers()[0]+data.getNumLayers()[1]+data.getNumLayers()[2])/3.0f, quat, move, scale, stream);
123
    }
124

  
125
///////////////////////////////////////////////////////////////////////////////////////////////////
126

  
127
  @Override
128
  public int getInternalColor()
129
    {
130
    return 0xff333333;
121 131
    }
122 132

  
123 133
///////////////////////////////////////////////////////////////////////////////////////////////////
......
190 200

  
191 201
  public int getTouchControlType()
192 202
    {
193
    return TC_CHANGING_SHAPEMOD;
203
    return TC_CHANGING_MIRROR;
204
    }
205

  
206
///////////////////////////////////////////////////////////////////////////////////////////////////
207

  
208
  public float[] getDist3D(int[] numLayers)
209
    {
210
    float x = numLayers[0];
211
    float y = numLayers[1];
212
    float z = numLayers[2];
213
    float a = SIZE_CORRECTION*(x+y+z)/1.5f;
214

  
215
    return new float[] {(x+2)/a,x/a,y/a,(y+2)/a,z/a,(z+2)/a};
194 216
    }
195 217

  
196 218
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff