trackgen: fix mirrored right side barrier textures
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9352 30fe4595-0a0c-4342-8851-515496e4dcbd
This commit is contained in:
parent
a635893799
commit
f716a9500b
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -4476,10 +4476,10 @@ the Free Software Foundation; either version 2 of the License, or
|
|||
<attstr name="style" val="curb" />
|
||||
</section>
|
||||
<section name="Left Barrier">
|
||||
<attnum name="width" unit="m" val="0.25" />
|
||||
<attnum name="height" unit="m" val="1.0" />
|
||||
<attstr name="surface" val="barrier" />
|
||||
<attstr name="style" val="wall" />
|
||||
<attnum name="width" unit="m" val="0.0" />
|
||||
<attnum name="height" unit="m" val="2.0" />
|
||||
<attstr name="surface" val="test fence 1" />
|
||||
<attstr name="style" val="fence" />
|
||||
</section>
|
||||
<!--End of left part-->
|
||||
<!--Right part of segment-->
|
||||
|
@ -4494,10 +4494,10 @@ the Free Software Foundation; either version 2 of the License, or
|
|||
<attstr name="style" val="curb" />
|
||||
</section>
|
||||
<section name="Right Barrier">
|
||||
<attnum name="width" unit="m" val="0.25" />
|
||||
<attnum name="height" unit="m" val="1.0" />
|
||||
<attstr name="surface" val="barrier" />
|
||||
<attstr name="style" val="wall" />
|
||||
<attnum name="width" unit="m" val="0.0" />
|
||||
<attnum name="height" unit="m" val="2.0" />
|
||||
<attstr name="surface" val="test fence 1" />
|
||||
<attstr name="style" val="fence" />
|
||||
</section>
|
||||
<!--End of right part-->
|
||||
</section>
|
||||
|
|
|
@ -98,7 +98,7 @@ public:
|
|||
|
||||
//! Constructor.
|
||||
Application::Application()
|
||||
: GfApplication("TrackGen", "1.6.0.38", "Terrain generator for tracks")
|
||||
: GfApplication("TrackGen", "1.6.0.39", "Terrain generator for tracks")
|
||||
, HeightSteps(30)
|
||||
, Bump(false)
|
||||
, Raceline(false)
|
||||
|
|
|
@ -2062,23 +2062,23 @@ int InitScene(tTrack *Track, void *TrackHandle, bool bump, bool raceline, bool b
|
|||
case TR_FENCE:
|
||||
if (j == 0)
|
||||
{
|
||||
SETPOINT(texLen, 0, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z);
|
||||
SETPOINT(texLen, 1.0, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.0, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z);
|
||||
SETPOINT(-texLen, 1.0, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z + curBarrier->height);
|
||||
}
|
||||
break;
|
||||
case TR_WALL:
|
||||
switch (j)
|
||||
{
|
||||
case 0:
|
||||
SETPOINT(texLen, 0, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z);
|
||||
SETPOINT(texLen, 0.33, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z + curBarrier->height);
|
||||
SETPOINT(-texLen, 0, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z);
|
||||
SETPOINT(-texLen, 0.33, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z + curBarrier->height);
|
||||
break;
|
||||
case 1:
|
||||
trkpos.toStart = 0;
|
||||
trkpos.toRight = -curBarrier->width;
|
||||
RtTrackLocal2Global(&trkpos, &x, &y, TR_TORIGHT);
|
||||
SETPOINT(texLen, 0.33, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z + curBarrier->height);
|
||||
SETPOINT(texLen, 0.66, x, y, seg->vertex[TR_SR].z + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.33, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.66, x, y, seg->vertex[TR_SR].z + curBarrier->height);
|
||||
break;
|
||||
case 2:
|
||||
trkpos.toStart = 0;
|
||||
|
@ -2086,11 +2086,11 @@ int InitScene(tTrack *Track, void *TrackHandle, bool bump, bool raceline, bool b
|
|||
RtTrackLocal2Global(&trkpos, &x, &y, TR_TORIGHT);
|
||||
if ((mseg->prev->barrier[0]->style != TR_WALL) || (mseg->prev->barrier[0]->height != curBarrier->height) || (mseg->prev->barrier[0]->width != curBarrier->width) || startPolygonNeeded)
|
||||
{
|
||||
SETPOINT(texLen - curBarrier->width / curTexSize, 0.66, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z + curBarrier->height);
|
||||
SETPOINT(texLen - curBarrier->width / curTexSize, 1.00, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z);
|
||||
SETPOINT(-texLen - curBarrier->width / curTexSize, 0.66, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z + curBarrier->height);
|
||||
SETPOINT(-texLen - curBarrier->width / curTexSize, 1.00, seg->vertex[TR_SR].x, seg->vertex[TR_SR].y, seg->vertex[TR_SR].z);
|
||||
}
|
||||
SETPOINT(texLen, 0.66, x, y, seg->vertex[TR_SR].z + curBarrier->height);
|
||||
SETPOINT(texLen, 1.0, x, y, seg->vertex[TR_SR].z);
|
||||
SETPOINT(-texLen, 0.66, x, y, seg->vertex[TR_SR].z + curBarrier->height);
|
||||
SETPOINT(-texLen, 1.0, x, y, seg->vertex[TR_SR].z);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -2125,28 +2125,28 @@ int InitScene(tTrack *Track, void *TrackHandle, bool bump, bool raceline, bool b
|
|||
case TR_FENCE:
|
||||
if (j == 0)
|
||||
{
|
||||
SETPOINT(texLen, 0, x, y, curHeight);
|
||||
SETPOINT(texLen, 1.0, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 0, x, y, curHeight);
|
||||
SETPOINT(-texLen, 1.0, x, y, curHeight + curBarrier->height);
|
||||
}
|
||||
break;
|
||||
case TR_WALL:
|
||||
switch (j)
|
||||
{
|
||||
case 0:
|
||||
SETPOINT(texLen, 0.0, x, y, curHeight);
|
||||
SETPOINT(texLen, 0.33, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.0, x, y, curHeight);
|
||||
SETPOINT(-texLen, 0.33, x, y, curHeight + curBarrier->height);
|
||||
break;
|
||||
case 1:
|
||||
SETPOINT(texLen, 0.33, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.33, x, y, curHeight + curBarrier->height);
|
||||
trkpos.toRight = -curBarrier->width;
|
||||
RtTrackLocal2Global(&trkpos, &x, &y, TR_TORIGHT);
|
||||
SETPOINT(texLen, 0.66, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.66, x, y, curHeight + curBarrier->height);
|
||||
break;
|
||||
case 2:
|
||||
trkpos.toRight = -curBarrier->width;
|
||||
RtTrackLocal2Global(&trkpos, &x, &y, TR_TORIGHT);
|
||||
SETPOINT(texLen, 0.66, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(texLen, 1.0, x, y, curHeight);
|
||||
SETPOINT(-texLen, 0.66, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 1.0, x, y, curHeight);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -2188,28 +2188,28 @@ int InitScene(tTrack *Track, void *TrackHandle, bool bump, bool raceline, bool b
|
|||
case TR_FENCE:
|
||||
if (j == 0)
|
||||
{
|
||||
SETPOINT(texLen, 0.0, x, y, curHeight);
|
||||
SETPOINT(texLen, 1.0, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.0, x, y, curHeight);
|
||||
SETPOINT(-texLen, 1.0, x, y, curHeight + curBarrier->height);
|
||||
}
|
||||
break;
|
||||
case TR_WALL:
|
||||
switch (j)
|
||||
{
|
||||
case 0:
|
||||
SETPOINT(texLen, 0.0, x, y, curHeight);
|
||||
SETPOINT(texLen, 0.33, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.0, x, y, curHeight);
|
||||
SETPOINT(-texLen, 0.33, x, y, curHeight + curBarrier->height);
|
||||
break;
|
||||
case 1:
|
||||
SETPOINT(texLen, 0.33, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.33, x, y, curHeight + curBarrier->height);
|
||||
trkpos.toRight = -curBarrier->width;
|
||||
RtTrackLocal2Global(&trkpos, &x, &y, TR_TORIGHT);
|
||||
SETPOINT(texLen, 0.66, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.66, x, y, curHeight + curBarrier->height);
|
||||
break;
|
||||
case 2:
|
||||
trkpos.toRight = -curBarrier->width;
|
||||
RtTrackLocal2Global(&trkpos, &x, &y, TR_TORIGHT);
|
||||
SETPOINT(texLen, 0.66, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(texLen, 1.0, x, y, curHeight);
|
||||
SETPOINT(-texLen, 0.66, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 1.0, x, y, curHeight);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -2253,28 +2253,28 @@ int InitScene(tTrack *Track, void *TrackHandle, bool bump, bool raceline, bool b
|
|||
case TR_FENCE:
|
||||
if (j == 0)
|
||||
{
|
||||
SETPOINT(texLen, 0.0, x, y, curHeight);
|
||||
SETPOINT(texLen, 1.0, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.0, x, y, curHeight);
|
||||
SETPOINT(-texLen, 1.0, x, y, curHeight + curBarrier->height);
|
||||
}
|
||||
break;
|
||||
case TR_WALL:
|
||||
switch (j)
|
||||
{
|
||||
case 0:
|
||||
SETPOINT(texLen, 0.0, x, y, curHeight);
|
||||
SETPOINT(texLen, 0.33, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.0, x, y, curHeight);
|
||||
SETPOINT(-texLen, 0.33, x, y, curHeight + curBarrier->height);
|
||||
break;
|
||||
case 1:
|
||||
SETPOINT(texLen, 0.33, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.33, x, y, curHeight + curBarrier->height);
|
||||
trkpos.toRight = -curBarrier->width;
|
||||
RtTrackLocal2Global(&trkpos, &x, &y, TR_TORIGHT);
|
||||
SETPOINT(texLen, 0.66, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.66, x, y, curHeight + curBarrier->height);
|
||||
break;
|
||||
case 2:
|
||||
trkpos.toRight = -curBarrier->width;
|
||||
RtTrackLocal2Global(&trkpos, &x, &y, TR_TORIGHT);
|
||||
SETPOINT(texLen, 0.66, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(texLen, 1.0, x, y, curHeight);
|
||||
SETPOINT(-texLen, 0.66, x, y, curHeight + curBarrier->height);
|
||||
SETPOINT(-texLen, 1.0, x, y, curHeight);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -2302,30 +2302,30 @@ int InitScene(tTrack *Track, void *TrackHandle, bool bump, bool raceline, bool b
|
|||
case TR_FENCE:
|
||||
if (j == 0)
|
||||
{
|
||||
SETPOINT(texLen, 0.0, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z);
|
||||
SETPOINT(texLen, 1.0, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.0, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z);
|
||||
SETPOINT(-texLen, 1.0, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z + curBarrier->height);
|
||||
}
|
||||
break;
|
||||
case TR_WALL:
|
||||
switch (j)
|
||||
{
|
||||
case 0:
|
||||
SETPOINT(texLen, 0.0, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z);
|
||||
SETPOINT(texLen, 0.33, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.0, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z);
|
||||
SETPOINT(-texLen, 0.33, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z + curBarrier->height);
|
||||
break;
|
||||
case 1:
|
||||
SETPOINT(texLen, 0.33, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.33, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z + curBarrier->height);
|
||||
trkpos.toStart = ts;
|
||||
trkpos.toRight = -curBarrier->width;
|
||||
RtTrackLocal2Global(&trkpos, &x, &y, TR_TORIGHT);
|
||||
SETPOINT(texLen, 0.66, x, y, seg->vertex[TR_ER].z + curBarrier->height);
|
||||
SETPOINT(-texLen, 0.66, x, y, seg->vertex[TR_ER].z + curBarrier->height);
|
||||
break;
|
||||
case 2:
|
||||
trkpos.toStart = ts;
|
||||
trkpos.toRight = -curBarrier->width;
|
||||
RtTrackLocal2Global(&trkpos, &x, &y, TR_TORIGHT);
|
||||
SETPOINT(texLen, 0.66, x, y, seg->vertex[TR_ER].z + curBarrier->height);
|
||||
SETPOINT(texLen, 1.00, x, y, seg->vertex[TR_ER].z);
|
||||
SETPOINT(-texLen, 0.66, x, y, seg->vertex[TR_ER].z + curBarrier->height);
|
||||
SETPOINT(-texLen, 1.00, x, y, seg->vertex[TR_ER].z);
|
||||
{
|
||||
tTrackSeg *nextSide = mseg->next;
|
||||
while (nextSide->rside)
|
||||
|
@ -2333,8 +2333,8 @@ int InitScene(tTrack *Track, void *TrackHandle, bool bump, bool raceline, bool b
|
|||
const bool endPolygonNeeded = std::fabs(xprev - nextSide->vertex[TR_SR].x) > 0.001 || std::fabs(yprev - nextSide->vertex[TR_SR].y) > 0.001;
|
||||
if ((mseg->next->barrier[0]->style != TR_WALL) || (mseg->next->barrier[0]->height != curBarrier->height) || (mseg->next->barrier[0]->width != curBarrier->width) || endPolygonNeeded)
|
||||
{
|
||||
SETPOINT(texLen + curBarrier->width / curTexSize, 0.66, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z + curBarrier->height);
|
||||
SETPOINT(texLen + curBarrier->width / curTexSize, 1.00, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z);
|
||||
SETPOINT(-texLen + curBarrier->width / curTexSize, 0.66, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z + curBarrier->height);
|
||||
SETPOINT(-texLen + curBarrier->width / curTexSize, 1.00, seg->vertex[TR_ER].x, seg->vertex[TR_ER].y, seg->vertex[TR_ER].z);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue