public CameraComponent() { // OPENGL IS RIGHT HANDED // IN OPENGL THE POSITIVE Z IS TOWARDS YOU Position = new Vector3(0, 0, 0.0f); // THE NEGATIVE IS TO THE DEPTH Direction = CalculateEulerDirection(pitch, yaw); Up = new Vector3(0.0f, 1.0f, 0.0f); Speed = 0.15f; SpeedStep = 0.05f; viewMatrix = new Matrix4Uniform(ShaderUniformName.ViewMatrix); projectionMatrix = new Matrix4Uniform(ShaderUniformName.ProjectionMatrix); orthogonalMatrix = new Matrix4Uniform(ShaderUniformName.ProjectionMatrix); perspectiveMatrix = new Matrix4Uniform(ShaderUniformName.ProjectionMatrix); FOV = 90.0f; CreateMatrices(); EnablePerspective(); viewMatrix.Matrix = GetViewMatrix(); }
public TransformComponent() { worldMatrix = new Matrix4Uniform(ShaderUniformName.WorldMatrix); worldMatrix.Matrix = Matrix4.Identity; rotationMatrix = Matrix4.Identity; Scale = 1.0f; rotationAxis = new Vector3(0.0f, 1.0f, 0.0f); rotationAngle = 0.0f; Parent = null; }
public void EnableOrthogonal() { projectionMatrix = orthogonalMatrix; }
public void EnablePerspective() { projectionMatrix = perspectiveMatrix; }