Project

General

Profile

Download (3.35 KB) Statistics
| Branch: | Revision:

distorted-objectlib / src / main / java / org / distorted / objectlib / shape / ShapeDiamond.java @ 4c2c0f44

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2019 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8
///////////////////////////////////////////////////////////////////////////////////////////////////
9

    
10
package org.distorted.objectlib.shape;
11

    
12
import org.distorted.library.type.Static3D;
13
import org.distorted.library.type.Static4D;
14
import org.distorted.objectlib.main.InitData;
15
import org.distorted.objectlib.main.TwistyObject;
16

    
17
import java.io.InputStream;
18

    
19
///////////////////////////////////////////////////////////////////////////////////////////////////
20

    
21
public abstract class ShapeDiamond extends TwistyObject
22
{
23
  public static final Static4D DEFAULT_ROT = new Static4D(-0.09848663f, 0.6306283f, 0.67572856f, 0.36878252f);
24

    
25
  public static final int COLOR_BALL_1 = 0xffff0000;
26
  public static final int COLOR_BALL_2 = 0xffcb2d6a;
27
  public static final int COLOR_BALL_3 = 0xff4ec9d0;
28
  public static final int COLOR_BALL_4 = 0xff4678ab;
29
  public static final int COLOR_BALL_5 = 0xff057350;
30
  public static final int COLOR_BALL_6 = 0xff289d42;
31
  public static final int COLOR_BALL_7 = 0xffddba44;
32
  public static final int COLOR_BALL_8 = 0xffee4713;
33

    
34
  public static final int[] FACE_COLORS = new int[]
35
         {
36
           COLOR_BALL_1, COLOR_BALL_1,
37
           COLOR_BALL_2, COLOR_BALL_2,
38
           COLOR_BALL_3, COLOR_BALL_3,
39
           COLOR_BALL_4, COLOR_BALL_4,
40
           COLOR_BALL_5, COLOR_BALL_5,
41
           COLOR_BALL_6, COLOR_BALL_6,
42
           COLOR_BALL_7, COLOR_BALL_7,
43
           COLOR_BALL_8, COLOR_BALL_8,
44
         };
45

    
46
  public static final int NUM_FACES = 16;
47
  public static final int FOV = 40;
48
  public static final float RATIO = 0.75f;
49

    
50
///////////////////////////////////////////////////////////////////////////////////////////////////
51

    
52
  public ShapeDiamond(InitData data, int meshState, int iconMode, float realSize, Static4D quat, Static3D move, float scale, InputStream stream)
53
    {
54
    super(data, meshState, iconMode, realSize, quat, move, scale, stream);
55
    }
56

    
57
///////////////////////////////////////////////////////////////////////////////////////////////////
58

    
59
  public final int getNumFaces()
60
    {
61
    return NUM_FACES;
62
    }
63

    
64
///////////////////////////////////////////////////////////////////////////////////////////////////
65

    
66
  public int getNumFaceColors()
67
    {
68
    return FACE_COLORS.length;
69
    }
70

    
71
///////////////////////////////////////////////////////////////////////////////////////////////////
72

    
73
  public int getColor(int face)
74
    {
75
    return FACE_COLORS[face];
76
    }
77

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

    
80
  public int getFOV()
81
    {
82
    return FOV;
83
    }
84

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

    
87
  public float getScreenRatio()
88
    {
89
    return RATIO;
90
    }
91
}
(1-1/6)