@@ -377,7 +377,6 @@ void BSShape::drawSelection() const
377
377
if ( normalScale < 0 .1f )
378
378
normalScale = 0 .1f ;
379
379
380
-
381
380
if ( !extraData ) {
382
381
if ( n == " Bounding Sphere" ) {
383
382
auto sph = BoundSphere ( nif, idx );
@@ -417,25 +416,12 @@ void BSShape::drawSelection() const
417
416
}
418
417
}
419
418
420
- if ( !idxs.size () ) {
421
- glPopMatrix ();
422
- return ;
423
- }
424
-
425
419
#if 0
426
420
Vector3 pTrans = nif->get<Vector3>( nif->getIndex( pBlock, 1 ), "Translation" );
427
421
#endif
428
- auto iBSphere = nif->getIndex ( pBlock, " Bounding Sphere" );
429
- Vector3 pbvC = nif->get <Vector3>( nif->getIndex ( iBSphere, 0 , 2 ) );
430
- float pbvR = nif->get <float >( nif->getIndex ( iBSphere, 1 , 2 ) );
431
-
432
- if ( pbvR > 0.0 ) {
433
- scene->setGLColor ( 0 .0f , 1 .0f , 0 .0f , 0 .33f );
434
- scene->drawSphereSimple ( pbvC, pbvR, 72 );
435
- bindShape ();
436
- }
437
-
438
- glPopMatrix ();
422
+ BoundSphere sph ( nif, pBlock );
423
+ if ( sph.radius > 0 .0f )
424
+ Shape::drawBoundingSphere ( sph, FloatVector4 ( 0 .0f , 1 .0f , 0 .0f , 0 .33f ) );
439
425
440
426
for ( auto i : idxs ) {
441
427
// Transform compound
@@ -452,22 +438,17 @@ void BSShape::drawSelection() const
452
438
t.translation = bvC;
453
439
t.scale = scale;
454
440
455
- glPushMatrix ();
456
- glMultMatrix ( scene->view * t );
441
+ scene->loadModelViewMatrix ( scene->view .toMatrix4 () * t );
457
442
458
443
if ( bvR > 0.0 ) {
459
444
scene->setGLColor ( 1 .0f , 1 .0f , 1 .0f , 0 .33f );
460
445
scene->drawSphereSimple ( Vector3 ( 0 , 0 , 0 ), bvR, 72 );
461
- bindShape ();
462
446
}
463
-
464
- glPopMatrix ();
465
447
}
466
-
467
- glPushMatrix ();
468
- glMultMatrix ( viewTrans () );
469
448
}
470
449
450
+ bindShape ();
451
+
471
452
if ( n == " Vertex Data" || n == " Vertex" || n == " Vertices" ) {
472
453
int s = -1 ;
473
454
if ( (n == " Vertex Data" && p == " Vertex Data" )
0 commit comments