Class FPCamera


  • public class FPCamera
    extends GameObject
    Represents a first person camera to walk around
    Author:
    Darius Dinger
    • Constructor Detail

      • FPCamera

        public FPCamera​(float x,
                        float y,
                        float z)
        Create new fp cam and grab mouse
        Parameters:
        x - Initial X position
        y - Initial Y position
        z - Initial Z position
    • Method Detail

      • onInit

        public void onInit()
        Description copied from class: GameObject
        This method gets called once in the GameObject life cycle. Even if the GameObject gets removed and readded, this method dont gets called again. Its like an additional constructor, except that its not gets called when the GameObject gets created, but when its first has to action.
        Overrides:
        onInit in class GameObject
      • onUpdate

        public void onUpdate()
        Description copied from class: GameObject
        This method gets called every frame before the render method. Here is place for the GameObject logic updates, e.g. input handling, physics, actions, ...
        Overrides:
        onUpdate in class GameObject
      • onRender

        public void onRender()
        Description copied from class: GameObject
        In this method the GameObject gets rendered onto the screen (if it has an graphical representation). Its primary used for MasterRenderer calls.
        Overrides:
        onRender in class GameObject
      • getCamera

        public Camera getCamera()
        Returns:
        Camera object that used by the first person camera
      • isWalking

        public boolean isWalking()
        Returns:
        Is the player currently walking
      • isSprinting

        public boolean isSprinting()
        Returns:
        Is the player currently sprinting