[orx-mesh-generators] fix side generator configuration
This commit is contained in:
@@ -132,9 +132,21 @@ fun GeneratorBuffer.extrudeShape(
|
|||||||
scale: Double = 1.0,
|
scale: Double = 1.0,
|
||||||
frontCap: Boolean = true,
|
frontCap: Boolean = true,
|
||||||
backCap: Boolean = true,
|
backCap: Boolean = true,
|
||||||
distanceTolerance: Double = 0.5
|
sides: Boolean = true
|
||||||
) {
|
) {
|
||||||
extrudeShape(baseTriangles, contours, -length / 2.0, length / 2.0, scale, scale, frontCap = frontCap, backCap = backCap, distanceTolerance = distanceTolerance, flipNormals = false, writer = this::write)
|
extrudeShape(
|
||||||
|
baseTriangles = baseTriangles,
|
||||||
|
contours = contours,
|
||||||
|
front = -length / 2.0,
|
||||||
|
back = length / 2.0,
|
||||||
|
frontScale = scale,
|
||||||
|
backScale = scale,
|
||||||
|
frontCap = frontCap,
|
||||||
|
backCap = backCap,
|
||||||
|
sides = sides,
|
||||||
|
flipNormals = false,
|
||||||
|
writer = this::write
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun GeneratorBuffer.extrudeShape(
|
fun GeneratorBuffer.extrudeShape(
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ fun extrudeShape(baseTriangles: List<Vector2>, contours: List<List<Vector2>>, fr
|
|||||||
frontCap: Boolean = true,
|
frontCap: Boolean = true,
|
||||||
backCap: Boolean = true,
|
backCap: Boolean = true,
|
||||||
sides: Boolean = true,
|
sides: Boolean = true,
|
||||||
distanceTolerance: Double = 0.5,
|
|
||||||
flipNormals: Boolean = false, writer: VertexWriter) {
|
flipNormals: Boolean = false, writer: VertexWriter) {
|
||||||
|
|
||||||
val depth = back - front
|
val depth = back - front
|
||||||
@@ -142,8 +141,19 @@ fun extrudeShape(shape: Shape,
|
|||||||
val baseTriangles = triangulate(shape, distanceTolerance)
|
val baseTriangles = triangulate(shape, distanceTolerance)
|
||||||
val points = shape.contours.map { it.adaptivePositions(distanceTolerance) }
|
val points = shape.contours.map { it.adaptivePositions(distanceTolerance) }
|
||||||
|
|
||||||
extrudeShape(baseTriangles, points, front, back, frontScale, backScale, sides, frontCap, backCap, distanceTolerance,
|
extrudeShape(
|
||||||
flipNormals, writer)
|
baseTriangles = baseTriangles,
|
||||||
|
contours = points,
|
||||||
|
front = front,
|
||||||
|
back = back,
|
||||||
|
frontScale = frontScale,
|
||||||
|
backScale = backScale,
|
||||||
|
frontCap = frontCap,
|
||||||
|
backCap = backCap,
|
||||||
|
sides = sides,
|
||||||
|
flipNormals = flipNormals,
|
||||||
|
writer = writer
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun extrudeShapes(shapes: List<Shape>,
|
fun extrudeShapes(shapes: List<Shape>,
|
||||||
@@ -157,7 +167,19 @@ fun extrudeShapes(shapes: List<Shape>,
|
|||||||
distanceTolerance: Double = 0.5,
|
distanceTolerance: Double = 0.5,
|
||||||
flipNormals: Boolean = false, writer: VertexWriter) {
|
flipNormals: Boolean = false, writer: VertexWriter) {
|
||||||
shapes.forEach {
|
shapes.forEach {
|
||||||
extrudeShape(it, front, back, frontScale, backScale, frontCap, backCap, sides, distanceTolerance, flipNormals, writer)
|
extrudeShape(
|
||||||
|
shape = it,
|
||||||
|
front = front,
|
||||||
|
back = back,
|
||||||
|
frontScale = frontScale,
|
||||||
|
backScale = backScale,
|
||||||
|
frontCap = frontCap,
|
||||||
|
backCap = backCap,
|
||||||
|
sides = sides,
|
||||||
|
distanceTolerance = distanceTolerance,
|
||||||
|
flipNormals = flipNormals,
|
||||||
|
writer = writer
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user