Example #1
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);
        }
Example #2
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);
        }