public void MoveDirectionBased(Vector3d movement) { Vector3d toAdd = (Vector3d)(Quaternion.FromEulerAngles(0, (float)Mathmatics.ConvertToRadians(-Rotation.Y), 0) * (Vector3)movement); Position += toAdd; }
private void RecreateProjectionMatrix() { (int width, int height) = GameEngine.windowHandler.GetWindowDimensions(); float aspectRatio = (width * ViewPortSize.X) / (height * ViewPortSize.Y); projectionMatrix = IsPerspective ? Matrix4.CreatePerspectiveFieldOfView((float)Mathmatics.ConvertToRadians(FOV), aspectRatio, NearPlane, FarPlane) : Matrix4.CreateOrthographic((int)(width * ViewPortSize.X), (int)(height * ViewPortSize.Y), NearPlane, FarPlane); }