Class HUDShape

  • All Implemented Interfaces:
    Container

    public class HUDShape
    extends Group
    A Head Up Display (HUD) Shape for a client Shape using `inner size and Mv position` to be displayed on top in a Scene.

    Purpose of this class is to provide a convenient tool to create a HUD within Scene using a Mv-coordinates and size of a target shape within the tree w/o manually transforming them to Scene.

    Further, the client shape is wrapped in a layout group, not mutating it and hence allowing it for DAG usage.

    This instance determines initial size and position in Shape.validate(GL2ES2), having a valid target shape.

    • Constructor Detail

      • HUDShape

        public HUDShape​(Scene scene,
                        float clientWidth,
                        float clientHeight,
                        int renderModes,
                        Shape targetShape,
                        Shape clientShape)
        Ctor of HUDShape.

        Adjust HUD position using targetShape object Mv-space coordinates via moveToHUDPos(Vec3f) and moveHUDPos(Vec3f).

        Parameters:
        scene - the Scene top-level container
        clientWidth - width of this HUD in given targetShape object Mv-space, not scene.
        clientHeight - height of this HUD in given targetShape object Mv-space, not scene.
        renderModes - Graph's Region render modes, see create(..).
        targetShape - target Shape this HUD is put on top, used to resolve the Mv matrix for HUD size and position
        clientShape - client Shape to be presented in the HUD tip
      • HUDShape

        public HUDShape​(Scene scene,
                        float clientWidth,
                        float clientHeight,
                        com.jogamp.math.Vec4f backColor,
                        com.jogamp.math.Vec4f borderColor,
                        float borderThickness,
                        Padding padding,
                        int renderModes,
                        Shape targetShape,
                        Shape clientShape)
        Ctor of HUDShape.

        Adjust HUD position using targetShape object Mv-space coordinates via moveToHUDPos(Vec3f) and moveHUDPos(Vec3f).

        Parameters:
        scene - the Scene top-level container
        clientWidth - width of this HUD in given targetShape object Mv-space, not scene.
        clientHeight - height of this HUD in given targetShape object Mv-space, not scene.
        backColor - optional background color, will add a frame to this HUD if not null
        borderColor - optional border color, only used with backColor
        borderThickness - border thickness, only used with backColor
        padding - optional padding for the given clientShape for the internal wrapper group
        renderModes - Graph's Region render modes, see create(..).
        targetShape - target Shape this HUD is put on top, used to resolve the Mv matrix for HUD size and position
        clientShape - client Shape to be presented in the HUD tip
    • Method Detail

      • moveToHUDPos

        public HUDShape moveToHUDPos​(com.jogamp.math.Vec3f clientPos)
        Move to scaled HUD position with given clientPos in targetShape object Mv-space coordinates. See Shape.moveTo(Vec3f).
        See Also:
        moveHUDPos(Vec3f)
      • moveHUDPos

        public HUDShape moveHUDPos​(com.jogamp.math.Vec3f clientDelta)
        Move about scaled HUD position with given clientDelta in targetShape object Mv-space coordinates. See Shape.move(Vec3f).
        See Also:
        moveToHUDPos(Vec3f)
      • setClientSize

        public HUDShape setClientSize​(float clientWidth,
                                      float clientHeight)
        Sets the client Shape size of this HUD in given targetShape object Mv-space, not Scene.
      • getClientSize

        public com.jogamp.math.Vec2f getClientSize()
        Returns the client Shape size of this HUD in given targetShape object Mv-space, not Scene.
      • getClientPos

        public com.jogamp.math.Vec3f getClientPos()
        Returns the client Shape position of this HUD in given targetShape object Mv-space, not Scene.
      • getClientShape

        public Shape getClientShape()
        Returns the client Shape to be presented in the HUD tip
      • getTargetShape

        public Shape getTargetShape()
        Returns the target Shape this HUD is put on top, used to resolve the Mv matrix for HUD size and position
      • removeClient

        public Shape removeClient()
        Removed the user provided client Shape from this HUD.

        This allows the user to release its own passed client Shape back, e.g. before destruction.

        Parameters:
        tip - created tip Shape via #createTip(Scene, AABBox)
        Returns:
        the user provided client Shape