Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public Face(Direction direction, Color color)
 {
     Index = direction.Index;
      Name = direction.Name;
      Initial = direction.Initial;
      CenterPoint = Locations.Origin + direction.Normal * Cubie.Length * 1.5;
      Direction = direction;
      Color = color;
 }
 static Directions()
 {
     _all = new List<Direction>();
      All = _all;
      Up = NewDirectionInfo("Up", new Vector3D(0, 1, 0));
      Down = NewDirectionInfo("Down", new Vector3D(0, -1, 0));
      Front = NewDirectionInfo("Front", new Vector3D(0, 0, -1));
      Back = NewDirectionInfo("Back", new Vector3D(0, 0, 1));
      Right = NewDirectionInfo("Right", new Vector3D(1, 0, 0));
      Left = NewDirectionInfo("Left", new Vector3D(-1, 0, 0));
 }
Exemple #3
0
 public string Format(Direction direction)
 {
     return String.Format(_format, direction.Initial);
 }
Exemple #4
0
 private static Face NewFace(Direction direction, Color color)
 {
     var face = new Face(direction, color);
      _all.Add(face);
      return face;
 }
 private Direction RotateHelper(Direction direction, Angle angle)
 {
     var transform = TransformCalculator.GetRotationTransform(direction.Normal, angle.Degrees);
      var newNormal = transform.Transform(Normal);
      return Directions.GetDirection(newNormal);
 }
 private Direction CrossProductHelper(Direction direction)
 {
     var newNormal = Normal.Cross(direction.Normal);
      return Directions.GetDirection(newNormal);
 }
 public Direction Rotate(Direction direction, Angle angle)
 {
     return _rotations.Get(direction, angle);
 }
 public Direction CrossProduct(Direction direction)
 {
     return _crossProducts.Get(direction);
 }
Exemple #9
0
 private Location RotateHelper(Direction direction, Angle angle)
 {
     var transform = TransformCalculator.GetRotationTransform(direction.Normal, angle.Degrees);
      var newPoint = transform.Transform(Point);
      return Locations.GetLocation(newPoint);
 }
 private static Direction NewDirectionInfo(string name, Vector3D normal)
 {
     var directionInfo = new Direction(_all.Count, name, normal);
      _all.Add(directionInfo);
      return directionInfo;
 }