Exemplo n.º 1
0
        // Class constructor
        public Camera(float fieldOfView, float aspectRatio, float nearPlaneDistance,
            float farPlaneDistance, Vector3 target, Vector3 up, GameObject parent = null)
        {
            // Initialise attributes
            this.fieldOfView = fieldOfView;
            this.aspectRatio = aspectRatio;
            this.nearPlaneDistance = nearPlaneDistance;
            this.farPlaneDistance = farPlaneDistance;

            this.target = target;
            this.up = up;

            // init positions
            x = 0.0f;
            y = 30.0f;
            z = 160.0f;
        }
Exemplo n.º 2
0
        // Class constructor
        public GameObject(string fileName = "", ContentManager content = null,
            GameObject parent = null)
        {
            // load required model
            if (content != null)
            {
                model = content.Load<Model>(fileName);
            }

            // Approprioate starting values for world transform data
            scale = 0.0f;
            pitch = 0;
            yaw = 0;
            roll = 0;

            // Setting Fudge matrix
            fudgeMatrix = Matrix.Identity;
        }