* fix group entities name position with origin key used
This commit is contained in:
parent
9643c53990
commit
a13ad776b4
|
|
@ -675,6 +675,7 @@ namespace std
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// this is only correct for radiant 2d views matrices
|
||||||
inline bool aabb_fits_view( const AABB& aabb, const Matrix4& modelview, const Matrix4& viewport, int ratio ){
|
inline bool aabb_fits_view( const AABB& aabb, const Matrix4& modelview, const Matrix4& viewport, int ratio ){
|
||||||
const AABB transformed_bounds = aabb_for_oriented_aabb(
|
const AABB transformed_bounds = aabb_for_oriented_aabb(
|
||||||
AABB( aabb.origin, Vector3( std::max( aabb.extents[0], 8.f ), std::max( aabb.extents[1], 8.f ), std::max( aabb.extents[2], 8.f ) ) ),
|
AABB( aabb.origin, Vector3( std::max( aabb.extents[0], 8.f ), std::max( aabb.extents[1], 8.f ), std::max( aabb.extents[2], 8.f ) ) ),
|
||||||
|
|
|
||||||
|
|
@ -368,17 +368,14 @@ void renderSolid( Renderer& renderer, const VolumeTest& volume, const Matrix4& l
|
||||||
if ( m_renderName.excluded_not()
|
if ( m_renderName.excluded_not()
|
||||||
&& ( selected || childSelected || ( g_showNames && ( volume.fill() || aabb_fits_view( childBounds, volume.GetModelview(), volume.GetViewport(), g_showNamesRatio ) ) ) ) ) {
|
&& ( selected || childSelected || ( g_showNames && ( volume.fill() || aabb_fits_view( childBounds, volume.GetModelview(), volume.GetViewport(), g_showNamesRatio ) ) ) ) ) {
|
||||||
// draw models as usual
|
// draw models as usual
|
||||||
if ( !isModel() ) {
|
if ( isModel() ) {
|
||||||
// don't draw the name for worldspawn
|
m_renderName.render( renderer, volume, localToWorld, selected, childSelected );
|
||||||
// if ( !strcmp( m_entity.getEntityClass().name(), "worldspawn" ) ) {
|
}
|
||||||
// return;
|
else{
|
||||||
// }
|
// place name in the middle of the "children cloud"
|
||||||
|
m_name_origin = extents_valid( childBounds.extents.x() )? childBounds.origin : vector4_to_vector3( localToWorld.t() );
|
||||||
// place name in the middle of the "children cloud"
|
m_renderName.render( renderer, volume, g_matrix4_identity, selected, childSelected );
|
||||||
m_name_origin = childBounds.origin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_renderName.render( renderer, volume, localToWorld, selected, childSelected );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -160,9 +160,9 @@ void renderSolid( Renderer& renderer, const VolumeTest& volume, const Matrix4& l
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// place name in the middle of the "children cloud"
|
// place name in the middle of the "children cloud"
|
||||||
m_name_origin = childBounds.origin;
|
m_name_origin = extents_valid( childBounds.extents.x() )? childBounds.origin : vector4_to_vector3( localToWorld.t() );
|
||||||
|
|
||||||
m_renderName.render( renderer, volume, localToWorld, selected, childSelected );
|
m_renderName.render( renderer, volume, g_matrix4_identity, selected, childSelected );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user