mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 16:19:19 +02:00
Tracks width smooth change and no "include file" info in log
This commit is contained in:
12
Track.cpp
12
Track.cpp
@@ -2604,7 +2604,9 @@ void
|
|||||||
TTrack::create_track_rail_profile( gfx::vertex_array &Right, gfx::vertex_array &Left ) {
|
TTrack::create_track_rail_profile( gfx::vertex_array &Right, gfx::vertex_array &Left ) {
|
||||||
|
|
||||||
auto const fHTW { 0.5f * std::abs( fTrackWidth ) };
|
auto const fHTW { 0.5f * std::abs( fTrackWidth ) };
|
||||||
|
float const fHTW2{((iTrapezoid & 2) != 0 ? // ten bit oznacza, że istnieje odpowiednie pNext
|
||||||
|
0.5f * std::fabs(trNext->fTrackWidth) : // połowa rozstawu/nawierzchni
|
||||||
|
fHTW)};
|
||||||
float
|
float
|
||||||
roll1{ 0.f },
|
roll1{ 0.f },
|
||||||
roll2{ 0.f };
|
roll2{ 0.f };
|
||||||
@@ -2660,8 +2662,8 @@ TTrack::create_track_rail_profile( gfx::vertex_array &Right, gfx::vertex_array &
|
|||||||
// trapez albo przechyłki, to oddzielne punkty na końcu
|
// trapez albo przechyłki, to oddzielne punkty na końcu
|
||||||
Right[ pointcount + i ] = {
|
Right[ pointcount + i ] = {
|
||||||
// position
|
// position
|
||||||
{( fHTW + szyna[ i ].position.x ) * cos2 + szyna[ i ].position.y * sin2,
|
{( fHTW2 + szyna[ i ].position.x ) * cos2 + szyna[ i ].position.y * sin2,
|
||||||
-( fHTW + szyna[ i ].position.x ) * sin2 + szyna[ i ].position.y * cos2,
|
-( fHTW2 + szyna[ i ].position.x ) * sin2 + szyna[ i ].position.y * cos2,
|
||||||
szyna[ i ].position.z},
|
szyna[ i ].position.z},
|
||||||
// normal
|
// normal
|
||||||
{ szyna[ i ].normal.x * cos2 + szyna[ i ].normal.y * sin2,
|
{ szyna[ i ].normal.x * cos2 + szyna[ i ].normal.y * sin2,
|
||||||
@@ -2673,8 +2675,8 @@ TTrack::create_track_rail_profile( gfx::vertex_array &Right, gfx::vertex_array &
|
|||||||
|
|
||||||
Left[ pointcount * 2 - 1 - i ] = {
|
Left[ pointcount * 2 - 1 - i ] = {
|
||||||
// position
|
// position
|
||||||
{(-fHTW - szyna[ i ].position.x ) * cos2 + szyna[ i ].position.y * sin2,
|
{(-fHTW2 - szyna[ i ].position.x ) * cos2 + szyna[ i ].position.y * sin2,
|
||||||
-(-fHTW - szyna[ i ].position.x ) * sin2 + szyna[ i ].position.y * cos2,
|
-(-fHTW2 - szyna[ i ].position.x ) * sin2 + szyna[ i ].position.y * cos2,
|
||||||
szyna[ i ].position.z},
|
szyna[ i ].position.z},
|
||||||
// normal
|
// normal
|
||||||
{-szyna[ i ].normal.x * cos2 + szyna[ i ].normal.y * sin2,
|
{-szyna[ i ].normal.x * cos2 + szyna[ i ].normal.y * sin2,
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ std::string cParser::readToken( bool ToLower, const char *Break ) {
|
|||||||
if (false == contains(includefile, "_ter.scm"))
|
if (false == contains(includefile, "_ter.scm"))
|
||||||
{
|
{
|
||||||
if (Global.ParserLogIncludes)
|
if (Global.ParserLogIncludes)
|
||||||
WriteLog("including: " + includefile);
|
//WriteLog("including: " + includefile);
|
||||||
mIncludeParser = std::make_shared<cParser>( includefile, buffer_FILE, mPath, LoadTraction, readParameters( *this ) );
|
mIncludeParser = std::make_shared<cParser>( includefile, buffer_FILE, mPath, LoadTraction, readParameters( *this ) );
|
||||||
mIncludeParser->allowRandomIncludes = allowRandomIncludes;
|
mIncludeParser->allowRandomIncludes = allowRandomIncludes;
|
||||||
mIncludeParser->autoclear( m_autoclear );
|
mIncludeParser->autoclear( m_autoclear );
|
||||||
@@ -302,7 +302,7 @@ std::string cParser::readToken( bool ToLower, const char *Break ) {
|
|||||||
if (false == contains(includefile, "_ter.scm"))
|
if (false == contains(includefile, "_ter.scm"))
|
||||||
{
|
{
|
||||||
if (Global.ParserLogIncludes)
|
if (Global.ParserLogIncludes)
|
||||||
WriteLog("including: " + includefile);
|
//WriteLog("including: " + includefile);
|
||||||
mIncludeParser = std::make_shared<cParser>(
|
mIncludeParser = std::make_shared<cParser>(
|
||||||
includefile, buffer_FILE, mPath, LoadTraction, readParameters(includeparser));
|
includefile, buffer_FILE, mPath, LoadTraction, readParameters(includeparser));
|
||||||
mIncludeParser->allowRandomIncludes = allowRandomIncludes;
|
mIncludeParser->allowRandomIncludes = allowRandomIncludes;
|
||||||
|
|||||||
Reference in New Issue
Block a user