Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Cuboid

[15:7] extends: CustomShape3D

Wraps FXGL's Cuboid, a CustomShape3D subclass that mirrors JavaFX Box but with observable width / height / depth properties usable for animations and bindings. Add to a Group inside a fx.SubScene with a PerspectiveCamera to render.

Methods

  • Cuboid (double Width = 2.0, double Height = 2.0, double Depth = 2.0)

    Creates a new Cuboid.

    • @p Width is the X extent.
    • @p Height is the Y extent.
    • @p Depth is the Z extent.
  • getWidth ()

    Returns the cuboid width.

    • @r A double.
  • getHeight ()

    Returns the cuboid height.

    • @r A double.
  • getDepth ()

    Returns the cuboid depth.

    • @r A double.
  • setWidth (double W)

    Sets the cuboid width.

    • @p W is the new width.
    • @r this object
  • setHeight (double H)

    Sets the cuboid height.

    • @p H is the new height.
    • @r this object
  • setDepth (double D)

    Sets the cuboid depth.

    • @p D is the new depth.
    • @r this object
  • setMaterial (object MaterialObj)

    Sets the cuboid material (PhongMaterial).

    • @p MaterialObj is a Material wrapper.
    • @r this object
  • setPhongMaterial (object ColorObj)

    Sets a PhongMaterial directly from a Color, sparing the caller from constructing one explicitly.

    • @p ColorObj is a Color wrapper.
    • @r this object
  • getTranslation ()

    Returns the (x, y, z) translation as a Point3D AJO.

    • @r An AussomJavaObject around a Point3D.
  • setTranslation (double X, double Y, double Z)

    Sets the (x, y, z) translation in one call.

    • @p X is the X translation.
    • @p Y is the Y translation.
    • @p Z is the Z translation.
    • @r this object
  • getVertices ()

    Returns the mesh vertex list for direct deformation.

    • @r An AussomJavaObject around a List.
  • widthProperty ()

    Returns the width DoubleProperty for binding.

  • heightProperty ()

    Returns the height DoubleProperty for binding.

  • depthProperty ()

    Returns the depth DoubleProperty for binding.