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:
16
Track.cpp
16
Track.cpp
@@ -867,11 +867,11 @@ void TTrack::Load(cParser *parser, vector3 pOrigin)
|
||||
}
|
||||
|
||||
// calculate path location
|
||||
m_location = glm::dvec3{ (
|
||||
m_area.center = ( glm::dvec3{ (
|
||||
CurrentSegment()->FastGetPoint_0()
|
||||
+ CurrentSegment()->FastGetPoint( 0.5 )
|
||||
+ CurrentSegment()->FastGetPoint_1() )
|
||||
/ 3.0 };
|
||||
/ 3.0 } );
|
||||
}
|
||||
|
||||
// TODO: refactor this mess
|
||||
@@ -2821,6 +2821,18 @@ TTrack::endpoints() const {
|
||||
}
|
||||
}
|
||||
|
||||
// calculates path's bounding radius
|
||||
void
|
||||
TTrack::radius_() {
|
||||
|
||||
auto const points = endpoints();
|
||||
for( auto &point : points ) {
|
||||
m_area.radius = std::max(
|
||||
m_area.radius,
|
||||
static_cast<float>( glm::length( m_area.center - point ) ) ); // extra margin to prevent driven vehicle from flicking
|
||||
}
|
||||
}
|
||||
|
||||
void TTrack::MovedUp1(float const dh)
|
||||
{ // poprawienie przechyłki wymaga wydłużenia podsypki
|
||||
fTexHeight1 += dh;
|
||||
|
||||
Reference in New Issue
Block a user