Class ShadowBox

    • Constructor Detail

      • ShadowBox

        public ShadowBox()
    • Method Detail

      • setViewCamera

        public void setViewCamera​(Camera viewCamera)
        Set camera to align shadow map to view frustuum
        Parameters:
        viewCamera - Camera to align to
      • getLightDirection

        public javax.vecmath.Vector3f getLightDirection()
        Read/Writeable vector of the light/shadow direction (most likely inverted lightposition)
        Returns:
        Read/Writeable vector of the light/shadow direction
      • 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()
        Updates the bounds of the shadow box based on the light direction and the camera's view frustum, to make sure that the box covers the smallest area possible while still ensuring that everything inside the camera's view (within a certain range) will cast shadows.
        Overrides:
        onUpdate in class GameObject
      • getCenter

        protected javax.vecmath.Vector3f getCenter()
        Calculates the center of the "view cuboid" in light space first, and then converts this to world space using the inverse light's view matrix.
        Returns:
        The center of the "view cuboid" in world space.
      • getWidth

        protected float getWidth()
        Returns:
        The width of the "view cuboid" (orthographic projection area).
      • getHeight

        protected float getHeight()
        Returns:
        The height of the "view cuboid" (orthographic projection area).
      • getLength

        protected float getLength()
        Returns:
        The length of the "view cuboid" (orthographic projection area).
      • 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