Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / helpers / ObjectFaceShape.java @ 9c7d220a

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2021 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.helpers;
11

    
12
///////////////////////////////////////////////////////////////////////////////////////////////////
13

    
14
public class ObjectFaceShape
15
  {
16
  private final int[] mBandIndices;
17
  private final float[] mConvexityCenter;
18
  private final float[][] mBands;
19

    
20
///////////////////////////////////////////////////////////////////////////////////////////////////
21

    
22
  public ObjectFaceShape(float[][] bands, int[] bandIndices, float[] convexityCenter)
23
    {
24
    mBands           = bands;
25
    mBandIndices     = bandIndices;
26
    mConvexityCenter = convexityCenter;
27
    }
28

    
29
///////////////////////////////////////////////////////////////////////////////////////////////////
30

    
31
  public float[][] getBands()
32
    {
33
    return mBands;
34
    }
35

    
36
///////////////////////////////////////////////////////////////////////////////////////////////////
37

    
38
  public int[] getBandIndices()
39
    {
40
    return mBandIndices;
41
    }
42

    
43
///////////////////////////////////////////////////////////////////////////////////////////////////
44

    
45
  public float[] getConvexityCenter()
46
    {
47
    return mConvexityCenter;
48
    }
49

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

    
52
  public void debug()
53
    {
54
    StringBuilder str = new StringBuilder();
55

    
56
    str.append("Bands\n");
57

    
58
    for(float[] ba : mBands)
59
      {
60
      str.append(' ');
61
      str.append(ba[0]);
62
      str.append(' ');
63
      str.append(ba[1]);
64
      str.append(' ');
65
      str.append(ba[2]);
66
      str.append(' ');
67
      str.append(ba[3]);
68
      str.append(' ');
69
      str.append(ba[4]);
70
      str.append(' ');
71
      str.append(ba[5]);
72
      str.append(' ');
73
      str.append(ba[6]);
74
      str.append("\n");
75
      }
76

    
77
    str.append("Indices ");
78

    
79
    for(int i : mBandIndices )
80
      {
81
      str.append(' ');
82
      str.append(i);
83
      }
84

    
85
    str.append("\n");
86
    str.append("convexityCenter");
87

    
88
    if( mConvexityCenter!=null )
89
      {
90
      str.append(' ');
91
      str.append(mConvexityCenter[0]);
92
      str.append(' ');
93
      str.append(mConvexityCenter[1]);
94
      str.append(' ');
95
      str.append(mConvexityCenter[2]);
96
      }
97
    else
98
      {
99
      str.append(" null");
100
      }
101

    
102
    android.util.Log.e("D", "ObjectFaceShape: \n"+str);
103
    }
104
  }
(6-6/13)