public Matrix4 CreateGuiProjectionMatrix(sd.Size dims) { Matrix4 ret = Matrix4.Identity; ret.Row0.X = 2.0f / (float)dims.Width; ret.Row1.Y = 2.0f / (float)dims.Height; return(ret); }
public Matrix4 CreateGuiViewMatrix(sd.Size dims, bool autoflip) { Matrix4 ret = Matrix4.Identity; ret.Row1.Y = -1.0f; ret.Row3.X = -(float)dims.Width * 0.5f; ret.Row3.Y = (float)dims.Height * 0.5f; if (autoflip) { if (_currRenderTarget == null) { } else { //flip as long as we're not a final render target ret.Row1.Y = 1.0f; ret.Row3.Y *= -1; } } return(ret); }
public unsafe void SetPipelineUniformMatrix(PipelineUniform uniform, ref Matrix4 mat, bool transpose) { fixed(Matrix4 *pMat = &mat) GL.UniformMatrix4((int)uniform.Sole.Opaque, 1, transpose, (float *)pMat); }
public unsafe void SetPipelineUniformMatrix(PipelineUniform uniform, Matrix4 mat, bool transpose) { GL.UniformMatrix4((int)uniform.Sole.Opaque, 1, transpose, (float *)&mat); }
public void PreMultiplyMatrix(Matrix4 value) { Top = value * Top; IsDirty = true; }
public void PostMultiplyMatrix(Matrix4 value) { Top = Top * value; IsDirty = true; }
public void Translate(float x, float y, float z) { PostMultiplyMatrix(Matrix4.CreateTranslation(x, y, z)); IsDirty = true; }
public void Translate(Vector3 trans) { PostMultiplyMatrix(Matrix4.CreateTranslation(trans)); IsDirty = true; }
/// <summary> /// Clears the matrix stack and loads the specified value /// </summary> public void Clear(Matrix4 value) { stack.Clear(); Top = value; IsDirty = true; }
public void RotateAxis(float x, float y, float z, float degrees) { PostMultiplyMatrix(Matrix4.CreateFromAxisAngle(new Vector3(x, y, z), MathHelper.DegreesToRadians(degrees))); IsDirty = true; }
public void Scale(float x, float y, float z) { PostMultiplyMatrix(Matrix4.CreateScale(x, y, z)); IsDirty = true; }
public void Scale(Vector2 scale) { PostMultiplyMatrix(Matrix4.CreateScale(scale.X, scale.Y, 1)); IsDirty = true; }
public void RotateAxis(Vector3 axisRotation, float angle) { PostMultiplyMatrix(Matrix4.CreateFromAxisAngle(axisRotation, angle)); IsDirty = true; }
public void Pop() { Top = stack.Pop(); IsDirty = true; }
public void LoadIdentity() { Top = Matrix4.Identity; IsDirty = true; }
public void LoadMatrix(Matrix4 value) { Top = value; IsDirty = true; }
public void RotateZ(float degrees) { PostMultiplyMatrix(Matrix4.CreateRotationZ(MathHelper.DegreesToRadians(degrees))); IsDirty = true; }
public MatrixStack(Matrix4 matrix) { LoadMatrix(matrix); }