Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Pyramid

[20:7] extends: Prism

Wraps FXGL's Pyramid, a Prism subclass with a configurable polygonal base. The default base is a triangle (3 divisions) with the top radius collapsed to zero, producing the classic tetrahedral pyramid; raise NumDivisions for a square pyramid (4), pentagonal (5), and so on. Pyramid inherits the full Prism surface (bottomRadius, topRadius, height, numDivisions). A non-zero TopRadius produces a frustum.

Methods

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

    Creates a new Pyramid.

    • @p BottomRadius is the base radius (center to base vertex).
    • @p TopRadius is the upper radius (default 0.0 collapses the top to a point); use a positive value for a frustum.
    • @p Height is the pyramid height.
    • @p NumDivisions is the base side count (3 for triangular, 4 for square, 5 for pentagonal, etc.).
  • adopt (object Ajo)

    Wraps an existing Pyramid AussomJavaObject.

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

    Returns the base radius.

  • getTopRadius ()

    Returns the top radius.

  • getHeight ()

    Returns the height.

  • getNumDivisions ()

    Returns the base side count.

  • setBottomRadius (double R)

    Sets the base radius.

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

    Sets the top radius.

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

    Sets the pyramid height.

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

    Sets the base side count.

    • @p N is the new count (clamped to a minimum of 3).
    • @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.

  • setMaterial (object MaterialObj)

    Sets the pyramid material.

    • @p MaterialObj is a Material wrapper.
    • @r this object
  • 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 as a Point3D AJO.

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

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

  • getVertices ()

    Returns the mesh vertex list for direct deformation.