Class Camera

  • All Implemented Interfaces:
    be.yildizgames.common.gameobject.Deletable, be.yildizgames.common.gameobject.Movable, be.yildizgames.common.util.Registerable, RayProvider
    Direct Known Subclasses:
    DummyCamera

    public abstract class Camera
    extends be.yildizgames.common.util.BaseRegisterable
    implements be.yildizgames.common.gameobject.Movable, RayProvider
    Physical camera representation, contains basic operations to set the position, direction,... to use more precise behavior, see camera behaviors.
    Author:
    Grégory Van den Borre
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Camera.Compositor
      Possible compositor.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Camera​(String name)
      Simple constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      be.yildizgames.common.gameobject.Movable getInternal()  
      be.yildizgames.common.geometry.Point3D getOffset()  
      be.yildizgames.common.geometry.Point3D getRelativePosition()  
      abstract be.yildizgames.common.geometry.Point3D getTargetPosition()  
      abstract void initOrigin()
      The targetNode will move around the camera.
      abstract void initTarget()
      The camera will follow the targetNode.
      abstract void removeListener​(LensFlare listener)
      Remove a camera listener from this camera.
      abstract void rotate​(float yaw, float pitch)  
      abstract void rotateTarget​(float yaw, float pitch)  
      abstract void setAspectRatio​(float ratio)  
      void setDirection​(be.yildizgames.common.geometry.Point3D direction)  
      abstract Camera setFarClip​(int far)
      An object further than the provided value will not be rendered.
      abstract Camera setNearClip​(int near)
      An object closer than the provided value will not be rendered.
      void setOffset​(be.yildizgames.common.geometry.Point3D offset)
      Set a new position offset to apply when the position is relative to another.
      void setRelativePosition​(be.yildizgames.common.geometry.Point3D position)  
      void setTargetPosition​(float x, float y, float z)  
      abstract void setTargetPosition​(be.yildizgames.common.geometry.Point3D target)
      Set the camera targetNode position.
      • Methods inherited from class be.yildizgames.common.util.BaseRegisterable

        equals, getName, hashCode, toString
      • Methods inherited from interface be.yildizgames.common.gameobject.Deletable

        delete
      • Methods inherited from interface be.yildizgames.common.gameobject.Movable

        addChild, addOptionalChild, attachTo, attachToOptional, detachFromParent, getAbsoluteDirection, getAbsolutePosition, getDirection, getPosition, removeChild, setDirection, setPosition, setPosition
    • Constructor Detail

      • Camera

        protected Camera​(String name)
        Simple constructor.
        Parameters:
        name - Camera unique name.
    • Method Detail

      • setFarClip

        public abstract Camera setFarClip​(int far)
        An object further than the provided value will not be rendered.
        Parameters:
        far - Maximum rendering distance.
        Returns:
        This object for chaining.
      • setNearClip

        public abstract Camera setNearClip​(int near)
        An object closer than the provided value will not be rendered.
        Parameters:
        near - Minimum rendering distance.
        Returns:
        This object for chaining.
      • setDirection

        public final void setDirection​(be.yildizgames.common.geometry.Point3D direction)
        Specified by:
        setDirection in interface be.yildizgames.common.gameobject.Movable
      • getInternal

        public final be.yildizgames.common.gameobject.Movable getInternal()
        Specified by:
        getInternal in interface be.yildizgames.common.gameobject.Movable
      • setTargetPosition

        public abstract void setTargetPosition​(be.yildizgames.common.geometry.Point3D target)
        Set the camera targetNode position.
        Parameters:
        target - Camera targetNode position value.
      • setTargetPosition

        public final void setTargetPosition​(float x,
                                            float y,
                                            float z)
      • rotateTarget

        public abstract void rotateTarget​(float yaw,
                                          float pitch)
      • removeListener

        public abstract void removeListener​(LensFlare listener)
        Remove a camera listener from this camera.
        Parameters:
        listener - Listener to remove.
      • getOffset

        public final be.yildizgames.common.geometry.Point3D getOffset()
        Returns:
        The camera offset.
      • setOffset

        public final void setOffset​(be.yildizgames.common.geometry.Point3D offset)
        Set a new position offset to apply when the position is relative to another.
        Parameters:
        offset - Offset to set.
      • setAspectRatio

        public abstract void setAspectRatio​(float ratio)
      • getTargetPosition

        public abstract be.yildizgames.common.geometry.Point3D getTargetPosition()
      • setRelativePosition

        public void setRelativePosition​(be.yildizgames.common.geometry.Point3D position)
      • getRelativePosition

        public be.yildizgames.common.geometry.Point3D getRelativePosition()
      • initOrigin

        public abstract void initOrigin()
        The targetNode will move around the camera.
      • initTarget

        public abstract void initTarget()
        The camera will follow the targetNode.
      • rotate

        public abstract void rotate​(float yaw,
                                    float pitch)