Example #1
0
 public void SetParam(string ParamName, R3DMATRIX[] values)
 {
     Matrix[] m = new Matrix[values.Length];
     int index = 0;
     foreach (R3DMATRIX rm in values)
     {
         m[index] = rm.matrix;
     }
     effect.Parameters[ParamName].SetValue(m);
     m = null;
 }
Example #2
0
 public void SetParam(string ParamName, R3DMATRIX value)
 {
     effect.Parameters[ParamName].SetValue(value.matrix);
 }
Example #3
0
        public R3DMATRIX[] GetParamMatrixArray(string ParamName, int ArrayCount)
        {
            Matrix[] marray = effect.Parameters[ParamName].GetValueMatrixArray(ArrayCount);

            R3DMATRIX[] matrix = new R3DMATRIX[marray.Length];

            int index = 0;
            foreach (Matrix m in marray)
            {
                matrix[index] = R3DMATRIX.FromMatrix(m);
            }
            return matrix;
        }
Example #4
0
 internal void Rotate(R3DMATRIX RotationMatrix)
 {
     if (_type == CONST_REACTOR_PARTICLETYPE.Billboard)
     _emitter.myRotation = Quaternion.CreateFromRotationMatrix(RotationMatrix.matrix);
 }
Example #5
0
 public void SkyBox_SetReflectionMatrix(R3DMATRIX Matrix)
 {
     _reflection = Matrix.matrix;
     _reflected = true;
 }
Example #6
0
        //This is where we render our objects for the water reflections!
        public void Reflection(R3DMATRIX ReflectionMatrix)
        {
            try
            {
                // Set our reflection matrix for the atmosphere to draw itself flipped
                atmosphere.SkyBox_SetReflectionMatrix(ReflectionMatrix);
                // Render our Sky
                atmosphere.SkyBox_Render();
                // Reset the sky's matrix back to it's original
                atmosphere.SkyBox_ResetReflectionMatrix();

                // Landscape is different as scaling is baked in, instead we call SetReflectionMatrix and it will do the rest.
                //landscape.SetReflectionMatrix(ReflectionMatrix);
                //landscape.Render();
                //landscape.RenderGrass();
                //landscape.ResetReflectionMatrix();
                // Reset reflection matrix on the Landscape to draw as normal.

                // With any game objects, you want to get it's world matrix first, multiply the reflection, and set the matrix back to the game object.
                // The next time this is called, it will flip it back.
                //R3DMATRIX meshMatrix = mesh.GetMatrix();
                //mesh.SetMatrix(meshMatrix * ReflectionMatrix);
                //mesh.Render();
                //mesh.SetMatrix(meshMatrix);

            }
            catch (Exception e)
            {
            }
        }