@@ -79,7 +79,7 @@ public class MorphControl extends AbstractControl implements Savable {
7979 private float [] tmpNormArray ;
8080 private float [] tmpTanArray ;
8181
82- private static final VertexBuffer .Type bufferTypes [] = VertexBuffer .Type .values ();
82+ private static final GlVertexBuffer .Type bufferTypes [] = GlVertexBuffer .Type .values ();
8383
8484 @ Override
8585 public void setSpatial (Spatial spatial ) {
@@ -237,49 +237,49 @@ private int getMaxGPUTargets(RenderManager rm, Geometry geom, Material mat, int
237237 }
238238
239239 private int bindMorphTargetBuffer (Mesh mesh , int targetNumBuffers , int boundBufferIdx , MorphTarget t ) {
240- int start = VertexBuffer .Type .MorphTarget0 .ordinal ();
240+ int start = GlVertexBuffer .Type .MorphTarget0 .ordinal ();
241241 if (targetNumBuffers >= 1 ) {
242- activateBuffer (mesh , boundBufferIdx , start , t .getBuffer (VertexBuffer .Type .Position ));
242+ activateBuffer (mesh , boundBufferIdx , start , t .getBuffer (GlVertexBuffer .Type .Position ));
243243 boundBufferIdx ++;
244244 }
245245 if (targetNumBuffers >= 2 ) {
246- activateBuffer (mesh , boundBufferIdx , start , t .getBuffer (VertexBuffer .Type .Normal ));
246+ activateBuffer (mesh , boundBufferIdx , start , t .getBuffer (GlVertexBuffer .Type .Normal ));
247247 boundBufferIdx ++;
248248 }
249249 if (!approximateTangents && targetNumBuffers == 3 ) {
250- activateBuffer (mesh , boundBufferIdx , start , t .getBuffer (VertexBuffer .Type .Tangent ));
250+ activateBuffer (mesh , boundBufferIdx , start , t .getBuffer (GlVertexBuffer .Type .Tangent ));
251251 boundBufferIdx ++;
252252 }
253253 return boundBufferIdx ;
254254 }
255255
256256 private void writeCpuBuffer (int targetNumBuffers , MorphTarget mt ) {
257257 if (targetNumBuffers >= 1 ) {
258- FloatBuffer dest = mt .getBuffer (VertexBuffer .Type .Position );
258+ FloatBuffer dest = mt .getBuffer (GlVertexBuffer .Type .Position );
259259 dest .rewind ();
260260 dest .put (tmpPosArray , 0 , dest .capacity ());
261261 }
262262 if (targetNumBuffers >= 2 ) {
263- FloatBuffer dest = mt .getBuffer (VertexBuffer .Type .Normal );
263+ FloatBuffer dest = mt .getBuffer (GlVertexBuffer .Type .Normal );
264264 dest .rewind ();
265265 dest .put (tmpNormArray , 0 , dest .capacity ());
266266 }
267267 if (!approximateTangents && targetNumBuffers == 3 ) {
268- FloatBuffer dest = mt .getBuffer (VertexBuffer .Type .Tangent );
268+ FloatBuffer dest = mt .getBuffer (GlVertexBuffer .Type .Tangent );
269269 dest .rewind ();
270270 dest .put (tmpTanArray , 0 , dest .capacity ());
271271 }
272272 }
273273
274274 private void mergeMorphTargets (int targetNumBuffers , float weight , MorphTarget t , boolean init ) {
275275 if (targetNumBuffers >= 1 ) {
276- mergeTargetBuffer (tmpPosArray , weight , t .getBuffer (VertexBuffer .Type .Position ), init );
276+ mergeTargetBuffer (tmpPosArray , weight , t .getBuffer (GlVertexBuffer .Type .Position ), init );
277277 }
278278 if (targetNumBuffers >= 2 ) {
279- mergeTargetBuffer (tmpNormArray , weight , t .getBuffer (VertexBuffer .Type .Normal ), init );
279+ mergeTargetBuffer (tmpNormArray , weight , t .getBuffer (GlVertexBuffer .Type .Normal ), init );
280280 }
281281 if (!approximateTangents && targetNumBuffers == 3 ) {
282- mergeTargetBuffer (tmpTanArray , weight , t .getBuffer (VertexBuffer .Type .Tangent ), init );
282+ mergeTargetBuffer (tmpTanArray , weight , t .getBuffer (GlVertexBuffer .Type .Tangent ), init );
283283 }
284284 }
285285
@@ -306,8 +306,8 @@ private void mergeTargetBuffer(float[] array, float weight, FloatBuffer src, boo
306306 }
307307
308308 private void activateBuffer (Mesh mesh , int idx , int start , FloatBuffer b ) {
309- VertexBuffer .Type t = bufferTypes [start + idx ];
310- VertexBuffer vb = mesh .getBuffer (t );
309+ GlVertexBuffer .Type t = bufferTypes [start + idx ];
310+ GlVertexBuffer vb = mesh .getBuffer (t );
311311 // only set the buffer if it's different
312312 if (vb == null || vb .getData () != b ) {
313313 mesh .setBuffer (t , 3 , b );
@@ -324,30 +324,30 @@ private float[] ensureCapacity(float[] tmpArray, int size) {
324324 private MorphTarget initCpuMorphTarget (Geometry geom ) {
325325 MorphTarget res = new MorphTarget ();
326326 MorphTarget mt = geom .getMesh ().getMorphTargets ()[0 ];
327- FloatBuffer b = mt .getBuffer (VertexBuffer .Type .Position );
327+ FloatBuffer b = mt .getBuffer (GlVertexBuffer .Type .Position );
328328 if (b != null ) {
329- res .setBuffer (VertexBuffer .Type .Position , BufferUtils .createFloatBuffer (b .capacity ()));
329+ res .setBuffer (GlVertexBuffer .Type .Position , BufferUtils .createFloatBuffer (b .capacity ()));
330330 }
331- b = mt .getBuffer (VertexBuffer .Type .Normal );
331+ b = mt .getBuffer (GlVertexBuffer .Type .Normal );
332332 if (b != null ) {
333- res .setBuffer (VertexBuffer .Type .Normal , BufferUtils .createFloatBuffer (b .capacity ()));
333+ res .setBuffer (GlVertexBuffer .Type .Normal , BufferUtils .createFloatBuffer (b .capacity ()));
334334 }
335335 if (!approximateTangents ) {
336- b = mt .getBuffer (VertexBuffer .Type .Tangent );
336+ b = mt .getBuffer (GlVertexBuffer .Type .Tangent );
337337 if (b != null ) {
338- res .setBuffer (VertexBuffer .Type .Tangent , BufferUtils .createFloatBuffer (b .capacity ()));
338+ res .setBuffer (GlVertexBuffer .Type .Tangent , BufferUtils .createFloatBuffer (b .capacity ()));
339339 }
340340 }
341341 return res ;
342342 }
343343
344344 private int getTargetNumBuffers (MorphTarget morphTarget ) {
345345 int num = 0 ;
346- if (morphTarget .getBuffer (VertexBuffer .Type .Position ) != null ) num ++;
347- if (morphTarget .getBuffer (VertexBuffer .Type .Normal ) != null ) num ++;
346+ if (morphTarget .getBuffer (GlVertexBuffer .Type .Position ) != null ) num ++;
347+ if (morphTarget .getBuffer (GlVertexBuffer .Type .Normal ) != null ) num ++;
348348
349349 // if tangents are not needed we don't count the tangent buffer
350- if (!approximateTangents && morphTarget .getBuffer (VertexBuffer .Type .Tangent ) != null ) {
350+ if (!approximateTangents && morphTarget .getBuffer (GlVertexBuffer .Type .Tangent ) != null ) {
351351 num ++;
352352 }
353353 return num ;
@@ -366,10 +366,10 @@ private int getTargetNumBuffers(MorphTarget morphTarget) {
366366 */
367367 private int getRemainingBuffers (Mesh mesh , Renderer renderer ) {
368368 int nbUsedBuffers = 0 ;
369- for (VertexBuffer vb : mesh .getBufferList ().getArray ()) {
370- boolean isMorphBuffer = vb .getBufferType ().ordinal () >= VertexBuffer .Type .MorphTarget0 .ordinal () && vb .getBufferType ().ordinal () <= VertexBuffer .Type .MorphTarget9 .ordinal ();
371- if (vb .getBufferType () == VertexBuffer .Type .Index || isMorphBuffer ) continue ;
372- if (vb .getUsage () != VertexBuffer .Usage .CpuOnly ) {
369+ for (GlVertexBuffer vb : mesh .getBufferList ().getArray ()) {
370+ boolean isMorphBuffer = vb .getBufferType ().ordinal () >= GlVertexBuffer .Type .MorphTarget0 .ordinal () && vb .getBufferType ().ordinal () <= GlVertexBuffer .Type .MorphTarget9 .ordinal ();
371+ if (vb .getBufferType () == GlVertexBuffer .Type .Index || isMorphBuffer ) continue ;
372+ if (vb .getUsage () != GlVertexBuffer .Usage .CpuOnly ) {
373373 nbUsedBuffers ++;
374374 }
375375 }
@@ -478,7 +478,7 @@ public void visit(Geometry geom) {
478478 // this code makes sure that if the mesh has no hardware skinning buffers hardware skinning won't be activated.
479479 // this is important, because if HW skinning is activated the shader will declare 2 additional useless attributes,
480480 // and we desperately need all the attributes we can find for Morph animation.
481- if (mesh .getBuffer (VertexBuffer .Type .HWBoneIndex ) == null && !geom .getLocalMatParamOverrides ().contains (nullNumberOfBones )) {
481+ if (mesh .getBuffer (GlVertexBuffer .Type .HWBoneIndex ) == null && !geom .getLocalMatParamOverrides ().contains (nullNumberOfBones )) {
482482 geom .addMatParamOverride (nullNumberOfBones );
483483 }
484484 }
0 commit comments