void setOrthoShadowMatrix(Matrix4f modelMtx, GVRLight light)
    {
        GVROrthogonalCamera camera = (GVROrthogonalCamera) getCamera();
        if (camera == null)
        {
            return;
        }

        float w = camera.getRightClippingDistance() - camera.getLeftClippingDistance();
        float h = camera.getTopClippingDistance() - camera.getBottomClippingDistance();
        float near = camera.getNearClippingDistance();
        float far = camera.getFarClippingDistance();

        modelMtx.invert();
        modelMtx.get(mTempMtx);
        camera.setViewMatrix(mTempMtx);
        mShadowMatrix.setOrthoSymmetric(w, h, near, far);
        mShadowMatrix.mul(modelMtx);
        sBiasMatrix.mul(mShadowMatrix, mShadowMatrix);
        mShadowMatrix.getColumn(0, mTemp);
        light.setVec4("sm0", mTemp.x, mTemp.y, mTemp.z, mTemp.w);
        mShadowMatrix.getColumn(1, mTemp);
        light.setVec4("sm1", mTemp.x, mTemp.y, mTemp.z, mTemp.w);
        mShadowMatrix.getColumn(2, mTemp);
        light.setVec4("sm2", mTemp.x, mTemp.y, mTemp.z, mTemp.w);
        mShadowMatrix.getColumn(3, mTemp);
        light.setVec4("sm3", mTemp.x, mTemp.y, mTemp.z, mTemp.w);
    }
void setOrthoShadowMatrix ( Matrix4f modelMtx , GVRLight light ) { GVROrthogonalCamera camera = ( GVROrthogonalCamera ) getCamera ( ) ; if ( camera == null ) { return ; } float w = camera . getRightClippingDistance ( ) - camera . getLeftClippingDistance ( ) ; float h = camera . getTopClippingDistance ( ) - camera . getBottomClippingDistance ( ) ; float near = camera . getNearClippingDistance ( ) ; float far = camera . getFarClippingDistance ( ) ; modelMtx . invert ( ) ; modelMtx . get ( mTempMtx ) ; camera . setViewMatrix ( mTempMtx ) ; mShadowMatrix . setOrthoSymmetric ( w , h , near , far ) ; mShadowMatrix . mul ( modelMtx ) ; sBiasMatrix . mul ( mShadowMatrix , mShadowMatrix ) ; mShadowMatrix . getColumn ( 0 , mTemp ) ; light . setVec4 ( "sm0" , mTemp . x , mTemp . y , mTemp . z , mTemp . w ) ; mShadowMatrix . getColumn ( 1 , mTemp ) ; light . setVec4 ( "sm1" , mTemp . x , mTemp . y , mTemp . z , mTemp . w ) ; mShadowMatrix . getColumn ( 2 , mTemp ) ; light . setVec4 ( "sm2" , mTemp . x , mTemp . y , mTemp . z , mTemp . w ) ; mShadowMatrix . getColumn ( 3 , mTemp ) ; light . setVec4 ( "sm3" , mTemp . x , mTemp . y , mTemp . z , mTemp . w ) ; }
Sets the direct light shadow matrix for the light from the input model/view
matrix and the shadow camera projection matrix.
@param modelMtx  light model transform (to world coordinates)
@param light     direct light component to update