Fix clipping controls for ThreeCanvas
This commit is contained in:
parent
da0f4c0ff0
commit
15ac3545b5
@ -116,7 +116,7 @@ public fun PropertyEditor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CloseButton(editorPropertyState != EditorPropertyState.Defined){
|
CloseButton(editorPropertyState != EditorPropertyState.Defined) {
|
||||||
rootMeta.remove(name)
|
rootMeta.remove(name)
|
||||||
update()
|
update()
|
||||||
}
|
}
|
||||||
|
@ -155,9 +155,10 @@ public class ThreeCanvas(
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Clipping planes
|
//Clipping planes
|
||||||
options.useProperty(Canvas3DOptions::clipping) { clipping ->
|
options.useProperty(Canvas3DOptions::clipping) { clipping: PointScheme ->
|
||||||
if (!clipping.meta.isEmpty()) {
|
if (clipping.meta.isEmpty()) {
|
||||||
renderer.localClippingEnabled = true
|
renderer.clippingPlanes = emptyArray()
|
||||||
|
} else {
|
||||||
boundingBox?.let { boundingBox ->
|
boundingBox?.let { boundingBox ->
|
||||||
val xClippingPlane = clipping.x?.let {
|
val xClippingPlane = clipping.x?.let {
|
||||||
val absoluteValue = boundingBox.min.x + (boundingBox.max.x - boundingBox.min.x) * it
|
val absoluteValue = boundingBox.min.x + (boundingBox.max.x - boundingBox.min.x) * it
|
||||||
@ -175,8 +176,6 @@ public class ThreeCanvas(
|
|||||||
renderer.clippingPlanes =
|
renderer.clippingPlanes =
|
||||||
listOfNotNull(xClippingPlane, yClippingPlane, zClippingPlane).toTypedArray()
|
listOfNotNull(xClippingPlane, yClippingPlane, zClippingPlane).toTypedArray()
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
renderer.localClippingEnabled = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user