Project

General

Profile

« Previous | Next » 

Revision 5931ae4d

Added by Leszek Koltunski over 2 years ago

Beginning to automatically calculate cubitFaceColors.

View differences:

src/main/java/org/distorted/objectlib/helpers/ObjectShape.java
19 19

  
20 20
package org.distorted.objectlib.helpers;
21 21

  
22
import org.distorted.library.type.Static4D;
23
import org.distorted.objectlib.main.TwistyObject;
24

  
22 25
///////////////////////////////////////////////////////////////////////////////////////////////////
23 26

  
24 27
public class ObjectShape
......
71 74

  
72 75
    return ret;
73 76
    }
77

  
78
///////////////////////////////////////////////////////////////////////////////////////////////////
79

  
80
  private static int[] computeCubitFaceColors(ObjectShape shape, float[] position, Static4D quat)
81
    {
82
    return null;
83
    }
84

  
85
///////////////////////////////////////////////////////////////////////////////////////////////////
86

  
87
  public static int[][] computeColors(ObjectShape[] shapes, float[][] positions, Static4D[] quats, TwistyObject object)
88
    {
89
    int numCubits = positions.length;
90
    int[][] colors = new int[numCubits][];
91
    int[] numLayers = object.getNumLayers();
92

  
93
    for(int cubit=0; cubit<numCubits; cubit++)
94
      {
95
      int variant = object.getCubitVariant(cubit,numLayers);
96
      colors[cubit] = computeCubitFaceColors(shapes[variant],positions[cubit],quats[cubit]);
97
      }
98

  
99
    return colors;
100
    }
74 101
  }

Also available in: Unified diff