| 722 |
722 |
|
| 723 |
723 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| 724 |
724 |
// EFFECTS
|
| 725 |
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| 726 |
|
|
| 727 |
|
VertexEffect[] createVertexEffectsHelicopterFace()
|
| 728 |
|
{
|
| 729 |
|
float E = 0.5f;
|
| 730 |
|
float F = SQ2/4;
|
| 731 |
|
|
| 732 |
|
Static3D move0 = new Static3D(-E/4, -E/4, 0);
|
| 733 |
|
Static3D move1 = new Static3D(-(SQ2/24)-E/2, -(SQ2/24)-E/2, 0);
|
| 734 |
|
Static3D move2 = new Static3D(-E/2, F/3, 0);
|
| 735 |
|
Static3D move3 = new Static3D(+E/2, F/3, 0);
|
| 736 |
|
Static3D move4 = new Static3D(+E/3,+E/3, 0);
|
| 737 |
|
Static1D angle1 = new Static1D(135);
|
| 738 |
|
Static1D angle2 = new Static1D(90);
|
| 739 |
|
Static1D angle3 = new Static1D(-90);
|
| 740 |
|
Static1D angle4 = new Static1D(-135);
|
| 741 |
|
Static3D axisX = new Static3D(1,0,0);
|
| 742 |
|
Static3D axisY = new Static3D(0,1,0);
|
| 743 |
|
Static3D axisZ = new Static3D(0,0,1);
|
| 744 |
|
Static3D axis1 = new Static3D(1,-1,0);
|
| 745 |
|
Static3D center = new Static3D(0,0,0);
|
| 746 |
|
Static3D center1= new Static3D(-E/2,-E/2,0);
|
| 747 |
|
|
| 748 |
|
VertexEffect[] effect = new VertexEffect[10];
|
| 749 |
|
|
| 750 |
|
effect[0] = new VertexEffectMove(move0);
|
| 751 |
|
effect[1] = new VertexEffectRotate(angle1, axisZ, center);
|
| 752 |
|
effect[2] = new VertexEffectMove(move1);
|
| 753 |
|
effect[3] = new VertexEffectRotate(angle2, axis1, center1);
|
| 754 |
|
effect[4] = new VertexEffectMove(move2);
|
| 755 |
|
effect[5] = new VertexEffectMove(move3);
|
| 756 |
|
effect[6] = new VertexEffectRotate(angle3, axisZ, center);
|
| 757 |
|
effect[7] = new VertexEffectRotate(angle4, axisX, center);
|
| 758 |
|
effect[8] = new VertexEffectRotate(angle1, axisY, center);
|
| 759 |
|
effect[9] = new VertexEffectMove(move4);
|
| 760 |
|
|
| 761 |
|
effect[0].setMeshAssociation( 1,-1); // mesh 0
|
| 762 |
|
effect[1].setMeshAssociation( 2,-1); // mesh 1
|
| 763 |
|
effect[2].setMeshAssociation( 2,-1); // mesh 1
|
| 764 |
|
effect[3].setMeshAssociation( 2,-1); // mesh 1
|
| 765 |
|
effect[4].setMeshAssociation( 4,-1); // mesh 2
|
| 766 |
|
effect[5].setMeshAssociation( 8,-1); // mesh 3
|
| 767 |
|
effect[6].setMeshAssociation( 8,-1); // mesh 3
|
| 768 |
|
effect[7].setMeshAssociation( 4,-1); // mesh 2
|
| 769 |
|
effect[8].setMeshAssociation( 8,-1); // mesh 3
|
| 770 |
|
effect[9].setMeshAssociation(15,-1); // meshes 0,1,2,3
|
| 771 |
|
|
| 772 |
|
return effect;
|
| 773 |
|
}
|
| 774 |
|
|
| 775 |
725 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| 776 |
726 |
|
| 777 |
727 |
VertexEffect[] createVertexEffectsRediEdge()
|
| ... | ... | |
| 1250 |
1200 |
// OBJECTS
|
| 1251 |
1201 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| 1252 |
1202 |
|
| 1253 |
|
public MeshBase createHelicopterFaceMesh()
|
| 1254 |
|
{
|
| 1255 |
|
MeshBase mesh = createFacesHelicopterFace();
|
| 1256 |
|
VertexEffect[] effects = createVertexEffectsHelicopterFace();
|
| 1257 |
|
for( VertexEffect effect : effects ) mesh.apply(effect);
|
| 1258 |
|
|
| 1259 |
|
float E = 0.5f;
|
| 1260 |
|
Static3D roundingCenter = new Static3D(-E/2 + E/3,-E/2 + E/3,-E/2);
|
| 1261 |
|
|
| 1262 |
|
Static3D[] verticesType1 = new Static3D[1];
|
| 1263 |
|
verticesType1[0] = new Static3D(E/3,E/3,0.0f);
|
| 1264 |
|
roundCorners(mesh,roundingCenter,verticesType1,0.06f,0.15f);
|
| 1265 |
|
|
| 1266 |
|
Static3D[] verticesType2 = new Static3D[2];
|
| 1267 |
|
verticesType2[0] = new Static3D(-E+E/3, E/3 , 0);
|
| 1268 |
|
verticesType2[1] = new Static3D( E/3 ,-E+E/3, 0);
|
| 1269 |
|
roundCorners(mesh,roundingCenter,verticesType2,0.08f,0.20f);
|
| 1270 |
|
|
| 1271 |
|
mesh.mergeEffComponents();
|
| 1272 |
|
mesh.addEmptyTexComponent();
|
| 1273 |
|
mesh.addEmptyTexComponent();
|
| 1274 |
|
|
| 1275 |
|
return mesh;
|
| 1276 |
|
}
|
| 1277 |
|
|
| 1278 |
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| 1279 |
|
// Redi cube
|
| 1280 |
|
|
| 1281 |
1203 |
public MeshBase createRediEdgeMesh()
|
| 1282 |
1204 |
{
|
| 1283 |
1205 |
MeshBase mesh = createFacesRediEdge();
|
Convert the Helicopter face cubits to the new engine.