Project

General

Profile

« Previous | Next » 

Revision 7a9edb92

Added by Leszek Koltunski over 3 years ago

Add component centers to dmesh version 2.

View differences:

src/main/java/org/distorted/library/mesh/UniformBlockCenter.java
55 55

  
56 56
///////////////////////////////////////////////////////////////////////////////////////////////////
57 57

  
58
   void setEffectCenterNow(int comp, float x, float y, float z)
59
     {
60
     mCenter[4*comp  ] = x;
61
     mCenter[4*comp+1] = y;
62
     mCenter[4*comp+2] = z;
58
  void setEffectCenterNow(int comp, float x, float y, float z)
59
    {
60
    mCenter[4*comp  ] = x;
61
    mCenter[4*comp+1] = y;
62
    mCenter[4*comp+2] = z;
63 63

  
64
     mUBO.invalidate();
65
     }
64
    mUBO.invalidate();
65
    }
66 66

  
67 67
///////////////////////////////////////////////////////////////////////////////////////////////////
68 68

  
69
   int getIndex()
70
     {
71
     return mUBO.createImmediatelyFloat( BLOCK_SIZE, mCenter);
72
     }
69
  int getIndex()
70
    {
71
    return mUBO.createImmediatelyFloat( BLOCK_SIZE, mCenter);
72
    }
73 73

  
74 74
///////////////////////////////////////////////////////////////////////////////////////////////////
75 75

  
76
   void copy(int compTo, UniformBlockCenter blockFrom, int compFrom)
77
     {
78
     mCenter[4*compTo  ] = blockFrom.mCenter[4*compFrom  ];
79
     mCenter[4*compTo+1] = blockFrom.mCenter[4*compFrom+1];
80
     mCenter[4*compTo+2] = blockFrom.mCenter[4*compFrom+2];
81
     }
76
  void copy(int compTo, UniformBlockCenter blockFrom, int compFrom)
77
    {
78
    mCenter[4*compTo  ] = blockFrom.mCenter[4*compFrom  ];
79
    mCenter[4*compTo+1] = blockFrom.mCenter[4*compFrom+1];
80
    mCenter[4*compTo+2] = blockFrom.mCenter[4*compFrom+2];
81
    }
82

  
83
///////////////////////////////////////////////////////////////////////////////////////////////////
84

  
85
  float[] getBackingArray()
86
    {
87
    return mCenter;
88
    }
82 89
  }

Also available in: Unified diff