Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Torus

[15:7] extends: CustomShape3D

Wraps FXGL's Torus, a CustomShape3D donut-shaped primitive defined by an outer radius (from center to tube center), a tube radius (cross-section), and a division count that controls the tessellation.

Methods

  • Torus (double Radius = 0.6, double TubeRadius = 0.4, int NumDivisions = 64)

    Creates a new Torus.

    • @p Radius is the donut radius (center to tube center).
    • @p TubeRadius is the cross-section radius.
    • @p NumDivisions is the tessellation count.
  • getRadius ()

    Returns the outer radius.

    • @r A double.
  • getTubeRadius ()

    Returns the tube radius.

    • @r A double.
  • getNumDivisions ()

    Returns the tessellation division count.

    • @r An int.
  • setMaterial (object MaterialObj)

    Sets the material.

    • @p MaterialObj is a Material wrapper.
    • @r this object
  • setRadius (double R)

    Sets the outer radius.

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

    Sets the tube radius.

    • @p R is the new tube radius.
    • @r this object
  • setNumDivisions (int N)

    Sets the tessellation division count.

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

    Returns the radius DoubleProperty for binding.

  • tubeRadiusProperty ()

    Returns the tube-radius 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.