public override void sampleAt(TrackSegment4 trackSegment, float t) { base.sampleAt(trackSegment, t); Vector3 normal = trackSegment.getNormal(t); Vector3 trackPivot = base.getTrackPivot(trackSegment.getPoint(t, 0), normal); Vector3 tangentPoint = trackSegment.getTangentPoint(t); Vector3 normalized = Vector3.Cross(normal, tangentPoint).normalized; Vector3 middlePoint = trackPivot + normalized * base.trackWidth / 2f; Vector3 middlePoint2 = trackPivot - normalized * base.trackWidth / 2f; Vector3 vector = trackPivot + normal * getCenterPointOffsetY(); if (useAlternativeTrackStyle(trackSegment)) { centerBoxExtruder.extrude(trackPivot + normal * base.trackWidth / 3f, tangentPoint, normal); } else { centerTubeExtruder.extrude(trackPivot, tangentPoint, normal); } leftTubeExtruder.extrude(middlePoint, tangentPoint, normal); rightTubeExtruder.extrude(middlePoint2, tangentPoint, normal); collisionMeshExtruder.extrude(trackPivot, tangentPoint, normal); if (liftExtruder1 != null) { liftExtruder1.setUV(14, 14); liftExtruder1.extrude(vector - (normal * 0.23f), tangentPoint, normal); } }
public override void sampleAt(TrackSegment4 trackSegment, float t) { base.sampleAt(trackSegment, t); var normal = trackSegment.getNormal(t); var trackPivot = getTrackPivot(trackSegment.getPoint(t), normal); var tangentPoint = trackSegment.getTangentPoint(t); var normalized = Vector3.Cross(normal, tangentPoint).normalized; var middlePoint = trackPivot + normalized * trackWidth / 2f; var middlePoint2 = trackPivot - normalized * trackWidth / 2f; var vector = trackPivot + normal * getCenterPointOffsetY(); centerTubeExtruder.extrude(vector, tangentPoint, normal); leftTubeExtruder.extrude(middlePoint, tangentPoint, normal); rightTubeExtruder.extrude(middlePoint2, tangentPoint, normal); collisionMeshExtruder.extrude(trackPivot, tangentPoint, normal); foreach (Extruder liftExtruder in this.liftExtruders) { liftExtruder.extrude(vector - normal * (0.06713f + chainLiftHeight / 2f), tangentPoint, normal); } }