Project

General

Profile

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

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

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

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

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

    
76
    for(int i : mBandIndices )
77
      {
78
      str.append(i);
79
      str.append(' ');
80
      }
81

    
82
    str.append("\n");
83

    
84
    if( mConvexityCenter!=null )
85
      {
86
      str.append(mConvexityCenter[0]);
87
      str.append(' ');
88
      str.append(mConvexityCenter[1]);
89
      str.append(' ');
90
      str.append(mConvexityCenter[2]);
91
      }
92
    else
93
      {
94
      str.append("convexityCenter null");
95
      }
96

    
97
    android.util.Log.e("D", "ObjectFaceShape: \n"+str);
98
    }
99
  }
(5-5/13)