Project

General

Profile

« Previous | Next » 

Revision 6c295be1

Added by Leszek Koltunski 12 months ago

Progress with BandagedObjectPyraminx.

View differences:

src/main/java/org/distorted/bandaged/BandagedCubit.java
43 43
    private final DistortedEffects mEffects;
44 44
    private final DistortedTexture mTexture;
45 45
    private final Static3D mMove;
46
    private final int mVariant;
46 47
    private final boolean mRoundCorners;
47 48

  
48 49
    private float mUnscaledX, mUnscaledY, mUnscaledZ;
......
116 117
// PUBLIC API
117 118
///////////////////////////////////////////////////////////////////////////////////////////////////
118 119

  
119
    public BandagedCubit(BandagedObject object, float[] position, Static4D quat1,
120
    public BandagedCubit(BandagedObject object, float[] position, int variant, Static4D quat1,
120 121
                         Static4D quat2, Static3D scale, boolean roundCorners)
121 122
      {
122 123
      mObject = object;
......
124 125
      mPosition = position;
125 126
      mIsAttached = true;
126 127
      mMarkedEffectID = -1;
128
      mVariant = variant;
127 129

  
128 130
      computeMove(mPosition);
129 131
      mMove = new Static3D(0,0,0);
130
      MeshBase mesh = mObject.createMesh(mPosition,mRoundCorners);
132
      MeshBase mesh = mObject.createMesh(mVariant,mPosition,mRoundCorners);
131 133

  
132 134
      mTexture = new DistortedTexture();
133 135
      if( mBitmap==null ) createBitmap(mObject.getColors());
......
155 157
      {
156 158
      int len1 = mPosition.length;
157 159
      int len2 = position.length;
158

  
159 160
      float[] tmpPosition = new float[len1+len2];
160

  
161 161
      System.arraycopy(mPosition, 0, tmpPosition,    0, len1);
162 162
      System.arraycopy(position , 0, tmpPosition, len1, len2);
163

  
164
      computeMove(tmpPosition);
165 163
      mPosition = tmpPosition;
166
      MeshBase mesh = mObject.createMesh(mPosition,mRoundCorners);
164

  
165
      computeMove(mPosition);
166
      MeshBase mesh = mObject.createMesh(mVariant,mPosition,mRoundCorners);
167 167
      resetTextureMaps(mesh);
168 168
      mNode.setMesh(mesh);
169 169
      mMove.set( scale*mUnscaledX, scale*mUnscaledY, scale*mUnscaledZ);
......
183 183
      mPosition[2] = z;
184 184

  
185 185
      computeMove(mPosition);
186
      MeshBase mesh = mObject.createMesh(mPosition,mRoundCorners);
186
      MeshBase mesh = mObject.createMesh(mVariant,mPosition,mRoundCorners);
187 187
      resetTextureMaps(mesh);
188 188
      mNode.setMesh(mesh);
189 189
      mMove.set( scale*mUnscaledX, scale*mUnscaledY, scale*mUnscaledZ);

Also available in: Unified diff