From 92ae1673ab87f0ec1637a5fb964959da0e7e19b7 Mon Sep 17 00:00:00 2001 From: mbjornstk Date: Fri, 7 May 2010 00:22:23 +0000 Subject: [PATCH] Add back twisting trick every other circle (with fixed UV). Raise polycount. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5398 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/slip_stream.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/graphics/slip_stream.cpp b/src/graphics/slip_stream.cpp index d677c8ce2..ae6d2fdf8 100644 --- a/src/graphics/slip_stream.cpp +++ b/src/graphics/slip_stream.cpp @@ -105,9 +105,9 @@ void SlipStream::createMesh(const video::SMaterial &material) // The number of points for each circle. Since part of the slip stream // might be under the ground (esp. first and last segment), specify // which one is the first and last to be actually drawn. - const unsigned int num_segments = 7; + const unsigned int num_segments = 15; const unsigned int first_segment = 0; - const unsigned int last_segment = 6; + const unsigned int last_segment = 14; const float f = 2*M_PI/float(num_segments); scene::SMeshBuffer *buffer = new scene::SMeshBuffer(); buffer->Material = material; @@ -120,12 +120,13 @@ void SlipStream::createMesh(const video::SMaterial &material) video::S3DVertex v; // Offset every 2nd circle by one half segment to increase // the number of planes so it looks better. - v.Pos.X = sin(i*f)*radius[j]; - v.Pos.Y = -cos(i*f)*radius[j]; + v.Pos.X = sin((i+(j%2)*0.5f)*f)*radius[j]; + v.Pos.Y = -cos((i+(j%2)*0.5f)*f)*radius[j]; v.Pos.Z = distance[j]; v.Color = video::SColor(alphas[j], alphas[j], alphas[j], alphas[j]); v.TCoords.X = curr_distance/m_length; - v.TCoords.Y = (float)(i-first_segment)/(last_segment-first_segment); + v.TCoords.Y = (float)(i-first_segment)/(last_segment-first_segment) + + (j%2)*(.5f/num_segments); buffer->Vertices.push_back(v); } // for i