示例#1
0
 private void UpdateViewProjectionBuffers()
 {
     projectionMatrix = camera.GetProjectionMatrix();
     viewMatrix = camera.GetViewMatrix();
 }
示例#2
0
 public MatricesBuffer(ref Matrix4x4 world, ref Matrix4x4 view, ref Matrix4x4 projection)
 {
     this.worldMatrix = world;
     this.viewMatrix = view;
     this.projectionMatrix = projection;
 }
示例#3
0
        internal void SetWorldMatrix(Matrix4x4 worldMatrix)
        {
            var worldTransposed = Matrix4x4.Transpose(worldMatrix);
            var viewTransposed = Matrix4x4.Transpose(viewMatrix);
            var projectionTransposed = Matrix4x4.Transpose(projectionMatrix);

            MatricesBuffer matricesBuffer = new MatricesBuffer(ref worldTransposed, ref viewTransposed, ref projectionTransposed);
            deviceContext.UpdateSubresource<MatricesBuffer>(ref matricesBuffer, this.worldViewProjectionMatrixBuffer);
            deviceContext.VertexShader.SetConstantBuffer(0, this.worldViewProjectionMatrixBuffer);
        }