Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Prism

[15:7] extends: CustomShape3D

Wraps FXGL's Prism, a CustomShape3D subclass that produces an N-sided prism (triangular at 3 divisions, square at 4, etc.). Configurable bottom radius, top radius (for a frustum effect), height, and division count.

Methods

  • Prism (double BottomRadius = 1.0, double TopRadius = 1.0, double Height = 2.0, int NumDivisions = 3)

    Creates a new Prism.

    • @p BottomRadius is the lower-face radius.
    • @p TopRadius is the upper-face radius.
    • @p Height is the prism height.
    • @p NumDivisions is the side count (3 for triangular, 4 for square, etc).
  • adopt (object Ajo)

    Wraps an existing Prism AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a Prism.
    • @r A new Prism wrapper.
  • getBottomRadius ()

    Returns the bottom radius.

    • @r A double.
  • getTopRadius ()

    Returns the top radius.

    • @r A double.
  • getHeight ()

    Returns the height.

    • @r A double.
  • setMaterial (object MaterialObj)

    Sets the material.

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

    Returns the side count.

  • setBottomRadius (double R)

    Sets the lower-face radius.

    • @p R is the new radius.
    • @r this object
  • setTopRadius (double R)

    Sets the upper-face radius.

    • @p R is the new radius.
    • @r this object
  • setHeight (double H)

    Sets the prism height.

    • @p H is the new height.
    • @r this object
  • setNumDivisions (int N)

    Sets the prism side count.

    • @p N is the new side count.
    • @r this object
  • bottomRadiusProperty ()

    Returns the bottom-radius DoubleProperty for binding.

  • topRadiusProperty ()

    Returns the top-radius DoubleProperty for binding.

  • heightProperty ()

    Returns the height DoubleProperty for binding.

  • numDivisionsProperty ()

    Returns the divisions IntegerProperty for binding.

  • setPhongMaterial (object ColorObj)

    Sets a PhongMaterial directly from a Color.

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

    Returns the (x, y, z) translation.

  • setTranslation (double X, double Y, double Z)

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

  • getVertices ()

    Returns the mesh vertex list.