コード例 #1
0
        public Light()
        {
            type       = TYPES.LIGHT;
            fov        = 360;
            intensity  = 1.0f;
            falloff    = ATTENUATION_TYPE.CONSTANT;
            light_type = LIGHT_TYPE.POINT;

            //Initialize new MeshVao
            meshVao                     = new GLMeshVao();
            meshVao.type                = TYPES.LIGHT;
            meshVao.vao                 = new Primitives.LineSegment(1, new Vector3(1.0f, 0.0f, 0.0f)).getVAO();
            meshVao.metaData            = new MeshMetaData();
            meshVao.metaData.batchcount = 2;
            meshVao.material            = Common.RenderState.activeResMgr.GLmaterials["lightMat"];
            instanceId                  = GLMeshBufferManager.addInstance(ref meshVao, this); // Add instance

            //Init projection Matrix
            lightProjectionMatrix = Matrix4.CreatePerspectiveFieldOfView(MathUtils.radians(90), 1.0f, 1.0f, 300f);

            //Init lightSpace Matrices
            lightSpaceMatrices = new Matrix4[6];
            for (int i = 0; i < 6; i++)
            {
                lightSpaceMatrices[i] = Matrix4.Identity * lightProjectionMatrix;
            }

            //Catch changes to MVector from the UI
            color = new MVector4(1.0f);
            color.PropertyChanged += catchPropertyChanged;
        }
コード例 #2
0
        //Add event handler to catch changes to the Vector property

        private void catchPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            MVector4 t = sender as MVector4;

            //Update struct
            strct.color.X  = t.X;
            strct.color.Y  = t.Y;
            strct.color.Z  = t.Z;
            update_changes = true;
        }
コード例 #3
0
ファイル: GMDL.cs プロジェクト: LongJohnCoder/NMSMV
 public Uniform(TkMaterialUniform un)
 {
     //Copy Attributes
     Name = un.Name;
     vec  = new MVector4(un.Values.x, un.Values.y, un.Values.z, un.Values.t);
 }
コード例 #4
0
ファイル: GMDL.cs プロジェクト: LongJohnCoder/NMSMV
 public Uniform(string name)
 {
     prefix = "";
     PName  = name;
     vec    = new MVector4(0.0f);
 }
コード例 #5
0
ファイル: GMDL.cs プロジェクト: LongJohnCoder/NMSMV
 public Uniform()
 {
     prefix = "";
     vec    = new MVector4(0.0f);
 }