コード例 #1
0
        public void MoveDirectionBased(Vector3d movement)
        {
            Vector3d toAdd = (Vector3d)(Quaternion.FromEulerAngles(0, (float)Mathmatics.ConvertToRadians(-Rotation.Y), 0) * (Vector3)movement);

            Position += toAdd;
        }
コード例 #2
0
        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);
        }