| 28 |
28 |
private int[][] mBasicAngle;
|
| 29 |
29 |
private float[] mDist3D, mDist;
|
| 30 |
30 |
private ObjectShape[] mShapes;
|
|
31 |
private ObjectVertexEffects[] mEffects;
|
| 31 |
32 |
private int[][] mCubitToVariantQuatMap;
|
| 32 |
33 |
private float[][] mCutPlanes;
|
| 33 |
34 |
private Static3D[] mRotAxis;
|
| ... | ... | |
| 106 |
107 |
Static4D[] quats = getQuats();
|
| 107 |
108 |
float[][] pos = getCubitPositions();
|
| 108 |
109 |
Static3D[] faceAxis = getFaceAxis();
|
| 109 |
|
float[] dist = distsToFace();
|
|
110 |
float[] dist = getDist();
|
| 110 |
111 |
|
| 111 |
112 |
float[][] potentialVertices = FactoryShape.computePotentialVertices(mCutPlanes);
|
| 112 |
113 |
|
| ... | ... | |
| 328 |
329 |
return centers;
|
| 329 |
330 |
}
|
| 330 |
331 |
|
|
332 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
333 |
|
|
334 |
private int getFirstCubitOfVariant(int variant)
|
|
335 |
{
|
|
336 |
if( mShapes==null ) prepareShapes();
|
|
337 |
|
|
338 |
for(int c=0; c<mNumCubits; c++)
|
|
339 |
if( mCubitToVariantQuatMap[c][0]==variant ) return c;
|
|
340 |
|
|
341 |
return -1;
|
|
342 |
}
|
|
343 |
|
| 331 |
344 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| 332 |
345 |
|
| 333 |
346 |
public ObjectVertexEffects getVertexEffects(int variant)
|
| 334 |
347 |
{
|
| 335 |
|
ObjectShape shape = getObjectShape(variant);
|
| 336 |
|
float[][] vertices = shape.getVertices();
|
| 337 |
|
float[][] centers = computeVertexEffectCenter(variant);
|
| 338 |
|
float[][] pos = getCubitPositions();
|
| 339 |
|
int[] cornerIndices= FactoryShape.computeVertexEffectsIndices(vertices, pos[variant], getFaceAxis(), getDist() );
|
| 340 |
|
float[] strength = getCornerPressStrength();
|
| 341 |
|
float[][] corners = { strength };
|
| 342 |
|
int[] centerIndices= new int[centers.length];
|
| 343 |
|
for(int c=0; c<centers.length; c++) centerIndices[c] = c;
|
| 344 |
|
|
| 345 |
|
return FactoryCubit.generateVertexEffect(vertices,corners,cornerIndices,centers,centerIndices);
|
|
348 |
if( mEffects==null )
|
|
349 |
{
|
|
350 |
int numVariants = getNumCubitVariants();
|
|
351 |
mEffects = new ObjectVertexEffects[numVariants];
|
|
352 |
}
|
|
353 |
|
|
354 |
if( mEffects[variant]==null )
|
|
355 |
{
|
|
356 |
ObjectShape shape = getObjectShape(variant);
|
|
357 |
float[][] vertices = shape.getVertices();
|
|
358 |
float[][] centers = computeVertexEffectCenter(variant);
|
|
359 |
float[][] pos = getCubitPositions();
|
|
360 |
int firstCubit = getFirstCubitOfVariant(variant);
|
|
361 |
int[] cornerIndices= FactoryShape.computeVertexEffectsIndices(vertices, pos[firstCubit], getFaceAxis(), getDist() );
|
|
362 |
float[] strength = getCornerPressStrength();
|
|
363 |
float[][] corners = { strength };
|
|
364 |
int[] centerIndices= new int[centers.length];
|
|
365 |
for(int c=0; c<centers.length; c++) centerIndices[c] = c;
|
|
366 |
|
|
367 |
mEffects[variant] = FactoryCubit.generateVertexEffect(vertices,corners,cornerIndices,centers,centerIndices);
|
|
368 |
}
|
|
369 |
|
|
370 |
return mEffects[variant];
|
| 346 |
371 |
}
|
| 347 |
372 |
|
| 348 |
373 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
fix rounding corners in TwistyCutSolid.