Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: RaycastResult

[16:7] extends: FxObj

Wraps FXGL's RaycastResult (com.almasb.fxgl.physics.RaycastResult), the value returned by PhysicsWorld.raycast. Exposes the first non-ignored entity hit by the ray and the world-coordinate hit point. Both are optional — a miss returns RaycastResult.NONE.

Methods

  • RaycastResult ()

    Empty default constructor; populated by adopt.

  • adopt (object Ajo)

    Wraps an existing RaycastResult AussomJavaObject.

  • getEntity ()

    Returns the hit Entity wrapper, or null when nothing was hit.

  • getPoint ()

    Returns the hit Point2D AJO (JavaFX) in world coordinates, or null when nothing was hit.

  • NONE ()

    Returns the singleton NONE RaycastResult AJO.