From b3c35cf85b1fce07c3f8017bfdcc9dcaec93df1c Mon Sep 17 00:00:00 2001 From: iobyte Date: Mon, 1 Jul 2024 15:52:50 +0000 Subject: [PATCH] osggraph: fix acc loader when it finds bad traingles git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9468 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 103f70883cad6cd5ea8e1e3f090ea8b50a7fffe4 Former-commit-id: 41de3f3b7427b9b6ab6cbd62af6c422f338262d3 --- src/modules/graphic/osggraph/Loader/ReaderWriterACC.h | 2 +- src/tools/trackgen/track.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/graphic/osggraph/Loader/ReaderWriterACC.h b/src/modules/graphic/osggraph/Loader/ReaderWriterACC.h index a1568080a..b48006e4c 100644 --- a/src/modules/graphic/osggraph/Loader/ReaderWriterACC.h +++ b/src/modules/graphic/osggraph/Loader/ReaderWriterACC.h @@ -871,7 +871,7 @@ public: if (_refs.size() == 3) // degenerate triangle so give up { osg::notify(osg::WARN) << "osgDB SPEED DREAMS reader: detected degenerate surface!" << std::endl; - return false; + // TODO delete degenerate triangle } else // remove duplicate vertex and normal { diff --git a/src/tools/trackgen/track.cpp b/src/tools/trackgen/track.cpp index a8d34944e..25dc99af6 100644 --- a/src/tools/trackgen/track.cpp +++ b/src/tools/trackgen/track.cpp @@ -3283,6 +3283,8 @@ int InitScene(tTrack *Track, void *TrackHandle, bool bump, bool raceline, bool b x -= BR_WIDTH_0; + NEWDISPLIST(false, "S3Bg", 0); + SETPOINT(curTexElt, nbvert, 3, 1, x + BR_WIDTH_0, y, z + BR_HEIGHT_1); SETPOINT(curTexElt, nbvert, 3, 0, x, y, z + BR_HEIGHT_1); @@ -3293,7 +3295,7 @@ int InitScene(tTrack *Track, void *TrackHandle, bool bump, bool raceline, bool b y += BR_WIDTH_1; /* back to origin */ - NEWDISPLIST(false, "S3Bg", 0); + NEWDISPLIST(false, "S4Bg", 0); y2 += BR_WIDTH_1; @@ -3307,6 +3309,8 @@ int InitScene(tTrack *Track, void *TrackHandle, bool bump, bool raceline, bool b x2 += BR_WIDTH_0; + NEWDISPLIST(false, "S5Bg", 0); + SETPOINT(curTexElt, nbvert, 1, 1, x2, y2, z + BR_HEIGHT_1); SETPOINT(curTexElt, nbvert, 1, 0, x2, y2, z + BR_HEIGHT_2); @@ -3326,7 +3330,7 @@ int InitScene(tTrack *Track, void *TrackHandle, bool bump, bool raceline, bool b SETPOINT(curTexElt, nbvert, 4, 0, x2, y2, z + BR_HEIGHT_2); /* Middle on the bridge */ - CHECKDISPLIST2("pylon3", 4, "S4Bg", 2); + CHECKDISPLIST2("pylon3", 4, "S6Bg", 2); SETPOINT(curTexElt, nbvert, 0, 0, x2, y2, z + BR_HEIGHT_2); SETPOINT(curTexElt, nbvert, 1, 0, x, y, z + BR_HEIGHT_2);