| 5 | |
| 6 | |
| 7 | CcpMath::AxisAlignedBox Tr2MaterialBoundsAdjustment::AdjustBounds( const CcpMath::AxisAlignedBox& box ) const |
| 8 | { |
| 9 | auto bounds = box; |
| 10 | bounds.Scale( maxLocalScale ); |
| 11 | bounds.Grow( maxLocalDisplacement ); |
| 12 | if( rotatesVertices ) |
| 13 | { |
| 14 | float radius = 0; |
| 15 | bounds.EnumerateVertices( [&radius]( const Vector3& vtx ) { |
| 16 | radius = std::max( radius, LengthSq( vtx ) ); |
| 17 | } ); |
| 18 | radius = sqrt( radius ); |
| 19 | bounds = CcpMath::AxisAlignedBox( CcpMath::Sphere( Vector3( 0, 0, 0 ), radius ) ); |
| 20 | } |
| 21 | return bounds; |
| 22 | } |
| 23 | |
| 24 | |
| 25 | #if BLUE_WITH_PYTHON |
no test coverage detected