Beispiel #1
0
        /// <summary>
        /// Création et construction d'un niveau de labyrinthe.
        /// </summary>
        /// <param name="id">Numéro de niveau.</param>
        public MazeLevel(int id)
            : base(null)
        {
            _levelId    = id;
            _groupWalls = new YnGroup3D(this);
            Add(_groupWalls);

            _groupItems = new YnGroup3D(this);
            Add(_groupItems);

            _startPosition = Vector3.Zero;
        }
Beispiel #2
0
        public string ValidatePosition(YnGroup3D group)
        {
            _colliderName     = String.Empty;
            _validDirection.X = 0;
            _validDirection.Y = 0;
            _validDirection.Z = 0;

            ApplyTransformToNextPosition(Camera.Position, Camera.Yaw, ref _nextDirection, ref _nextPosition);

            _nppBSphere.Center = _nextPosition;
            _nppBSphere.Radius = Camera.BoundingRadius;

            int size = group.Count;
            int i    = 0;

            while (i < size && _colliderName == String.Empty)
            {
                if (_nppBSphere.Contains(group[i].BoundingBox) != ContainmentType.Disjoint)
                {
                    _colliderName = group[i].Name;
                }
                i++;
            }

            var valid = _colliderName == string.Empty;

#if DEBUG
            if (Wallthrough)
            {
                valid = true;
            }
#endif
            if (valid)
            {
                Camera.Position = _nextPosition;
            }

            return(_colliderName);
        }