Project

General

Profile

« Previous | Next » 

Revision 226c8cfa

Added by Leszek Koltunski almost 4 years ago

Progress making it possible to apply Vertex Effects only to some Components of a Mesh.

View differences:

src/main/java/org/distorted/objects/RubikCube.java
194 194
      Static1D dRad  = new Static1D(1);
195 195

  
196 196
      VertexEffectMove   effect0 = new VertexEffectMove(new Static3D(0,0,+0.5f));
197
      effect0.setMeshAssociation(63);  // all 6 sides
197
      effect0.setMeshAssociation(-1,63);  // all 6 sides
198 198
      VertexEffectRotate effect1 = new VertexEffectRotate( angle180, axisX, center );
199
      effect1.setMeshAssociation(32);  // back
199
      effect1.setMeshAssociation(-1,32);  // back
200 200
      VertexEffectRotate effect2 = new VertexEffectRotate( angle90 , axisX, center );
201
      effect2.setMeshAssociation(8);  // bottom
201
      effect2.setMeshAssociation(-1, 8);  // bottom
202 202
      VertexEffectRotate effect3 = new VertexEffectRotate( angle270, axisX, center );
203
      effect3.setMeshAssociation(4);  // top
203
      effect3.setMeshAssociation(-1, 4);  // top
204 204
      VertexEffectRotate effect4 = new VertexEffectRotate( angle270, axisY, center );
205
      effect4.setMeshAssociation(2);  // left
205
      effect4.setMeshAssociation(-1, 2);  // left
206 206
      VertexEffectRotate effect5 = new VertexEffectRotate( angle90 , axisY, center );
207
      effect5.setMeshAssociation(1);  // right
207
      effect5.setMeshAssociation(-1, 1);  // right
208 208

  
209 209
      VertexEffectDeform effect6 = new VertexEffectDeform(dVec0, dRad, dCen0, dReg);
210 210
      VertexEffectDeform effect7 = new VertexEffectDeform(dVec1, dRad, dCen1, dReg);
src/main/java/org/distorted/objects/RubikPyraminx.java
278 278

  
279 279
    VertexEffectSink   effect12= new VertexEffectSink( new Static1D(1.3f), center, region );
280 280

  
281
    effect4.setMeshAssociation(14);  // apply to mesh[1], [2] and [3]
282
    effect5.setMeshAssociation( 2);  // apply only to mesh[1]
283
    effect6.setMeshAssociation( 4);  // apply only to mesh[2]
284
    effect7.setMeshAssociation( 8);  // apply only to mesh[3]
281
    effect4.setMeshAssociation(-1,14);  // apply to mesh[1], [2] and [3]
282
    effect5.setMeshAssociation(-1, 2);  // apply only to mesh[1]
283
    effect6.setMeshAssociation(-1, 4);  // apply only to mesh[2]
284
    effect7.setMeshAssociation(-1, 8);  // apply only to mesh[3]
285 285

  
286 286
    result.apply(effect1);
287 287
    result.apply(effect2);

Also available in: Unified diff