Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Feature Request: Reverse triangle winding order in SplinePathMeshBuilder
#1
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:
Code:
public bool ReverseWinding = false;

Add @ line 646 in SplinePathMeshBuilder:
Code:
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:
Code:
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;

Thanks!
Reply
#2
Hi,

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

Thanks

Jake
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Feature Request-move UI elements in SceneView spawnstorm 5 20 09-17-2022, 12:37 PM
Last Post: _Aka_
  Tutorial Request mythstified 7 9,284 10-11-2020, 07:17 PM
Last Post: _Aka_
  Idea for caps? (feature suggestion) hawken 1 3,076 03-23-2018, 11:34 AM
Last Post: _Aka_
  Feature request: SplineController.Position as inspector property syscrusher 4 7,974 01-19-2018, 06:00 AM
Last Post: syscrusher

Forum Jump: