file: CustomShape3D.aus

class: CustomShape3D

[38:7] extends: MeshView

Wraps an AussomCustomShape3D (subclass of FXGL's abstract CustomShape3D) so Aussom code can build custom mesh-backed 3D shapes. CustomShape3D extends JavaFX MeshView, so the wrapper extends the fx Node base. Aussom users register an onCreateMesh callback that must return a Mesh AussomJavaObject (typically a TriangleMesh filled in from Aussom). After wiring the callback (and again whenever the inputs change) call updateMesh to apply it. Example: cs = new CustomShape3D(); cs.onCreateMesh(::buildMesh); cs.updateMesh(); cs.setPhongMaterial(redColor); public buildMesh() { m = aji.newObj("javafx.scene.shape.TriangleMesh"); // ...fill points / texCoords / faces via m... return m; } For the built-in CustomShape3D subclasses (Cuboid, Torus, Prism, Cylinder, Pyramid, Cone) the createMesh hook is internal; use those wrappers directly instead of subclassing this one.

Methods