mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
build 171027: bounding area calculation fixes, novice ui obstacle indicator, minor traction render enhancement, shadow calculations for tall enough platforms
This commit is contained in:
@@ -259,9 +259,9 @@ shape_node::convert( TSubModel const *Submodel ) {
|
||||
squareradius,
|
||||
glm::length2( vertex.position - m_data.area.center ) );
|
||||
}
|
||||
m_data.area.radius = std::max<float>(
|
||||
m_data.area.radius = std::max(
|
||||
m_data.area.radius,
|
||||
std::sqrt( squareradius ) );
|
||||
static_cast<float>( std::sqrt( squareradius ) ) );
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -497,5 +497,23 @@ basic_node::basic_node( scene::node_data const &Nodedata ) :
|
||||
std::numeric_limits<double>::max() );
|
||||
}
|
||||
|
||||
float const &
|
||||
basic_node::radius() {
|
||||
|
||||
if( m_area.radius == -1.0 ) {
|
||||
// calculate if needed
|
||||
radius_();
|
||||
}
|
||||
return m_area.radius;
|
||||
}
|
||||
|
||||
// radius() subclass details, calculates node's bounding radius
|
||||
// by default nodes are 'virtual don't extend from their center point
|
||||
void
|
||||
basic_node::radius_() {
|
||||
|
||||
m_area.radius = 0.f;
|
||||
}
|
||||
|
||||
} // editor
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user