Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Feature Request: Reverse triangle winding order in SplinePathMeshBuilder
Hi there,

I'd like to make a feature request to add "Reverse Winding" to the triangle generation routine of SplinePathMeshBuilder.

This helps with creating meshes where the inside surface can be rendered and used with Mesh Colliders, instead of the outside surface. This is useful, for example, when you're extruding a tube for the player to travel inside of.

I can currently easily modify the Curvy code to accomodate this but I'd rather not have to re-modify Curvy code after each update, and I think this might prove useful to other users of Curvy as well.

Here's how I achieved Reverse Winding in code:

Add property at the top of SplinePathMeshBuilder:
public bool ReverseWinding = false;

Add @ line 646 in SplinePathMeshBuilder:
int[] indexOffset = ReverseWinding ? new int[] {0,2,1,3,5,4} : new int[] {0,1,2,3,4,5};

Replace the for loops @ lines 653 and 675:
mTris[triIndex + indexOffset[0]] = vtSegN+ev;
mTris[triIndex + indexOffset[1]] = vtSegN1+ev;
mTris[triIndex + indexOffset[2]] = vtSegN1 +1+ev;
mTris[triIndex + indexOffset[3]] = vtSegN1 + 1+ev;
mTris[triIndex + indexOffset[4]] = vtSegN + 1+ev;
mTris[triIndex + indexOffset[5]] = vtSegN+ev;


this will be added as an option to the new MeshBuilder!



Possibly Related Threads…
Thread Author Replies Views Last Post
  Tutorial Request mythstified 7 6,450 10-11-2020, 07:17 PM
Last Post: _Aka_
  Idea for caps? (feature suggestion) hawken 1 2,209 03-23-2018, 11:34 AM
Last Post: _Aka_
  Feature request: SplineController.Position as inspector property syscrusher 4 6,013 01-19-2018, 06:00 AM
Last Post: syscrusher
  UI Text move backwards/reverse along Spline Cloov 4 6,764 12-18-2016, 11:56 AM
Last Post: Jake

Forum Jump: