本文整理汇总了C#中Rotation类的典型用法代码示例。如果您正苦于以下问题:C# Rotation类的具体用法?C# Rotation怎么用?C# Rotation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Rotation类属于命名空间,在下文中一共展示了Rotation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Rotate
public bool Rotate(Rotation rotation)
{
int deltaX, deltaY;
Deck head = Decks.First();
if (IsShipRotatable())
{
GetRotationDirection(out deltaY, out deltaX);
for (int i = 1; i < Decks.Count; i++)
{
int newX = 0, newY = 0;
switch (rotation)
{
case Rotation.Left:
newX = head.X - deltaX * i;
newY = head.Y - deltaY * i;
break;
case Rotation.Right:
newX = head.X + deltaX * i;
newY = head.Y + deltaY * i;
break;
}
if (AreCoordinatesNotNegative(newX, newY))
{
Decks.ElementAt(i).X = newX;
Decks.ElementAt(i).Y = newY;
}
else
{
return false;
}
}
}
return true;
}
示例2: CreateRotation
static Rotation CreateRotation()
{
var rotation = new Rotation { Id = 2, Name = "TheRotation", RotationType = RotationTypes.Rotation1 };
var startTime = new DateTime(1, 1, 1, 7, 0, 0);
rotation.RotationShifts.Add(new RotationShift(TimeConstants.Weekday, startTime, startTime.AddHours(12).AddMinutes(-1)));
return rotation;
}
示例3: FromReader
public override void FromReader(IMinecraftDataReader reader)
{
Rotation = new Rotation(
reader.ReadFloat(),
reader.ReadFloat(),
reader.ReadFloat());
}
示例4: CanTurn
public void CanTurn(Rotation rotation)
{
var ant = new Ant(_initialDirection, _initialPosition);
var expectedDirection = _initialDirection.Rotate(rotation);
ant.Turn(rotation);
ant.Direction.Should().Be(expectedDirection);
}
示例5: ShipInstance
public ShipInstance(Position pos, Rotation r, Ship ship)
{
this.pos = pos;
this.rotation = r;
this.ship = ship;
this.sunken = false;
}
示例6: ReversePath
public static void ReversePath(Rotation[] path)
{
for (int i = 0; i < path.Length; i++)
{
path[i] = (Rotation)(((byte)path[i] + 2) % 4);
}
Array.Reverse(path);
}
示例7: X3DViewpoint
public X3DViewpoint (float? fieldOfView, Vector3? position,
Rotation orientation, Vector3? centerOfRotation)
{
this.FieldOfView = fieldOfView;
this.Position = position;
this.Orientation = orientation;
this.CenterOfRotation = centerOfRotation;
}
示例8: X3DTransform
public X3DTransform (X3DNode[] nodes,
Vector3? translation,
Rotation rotatio,
Vector3? scale) : base (nodes)
{
this.Translation = translation;
this.Rotation = rotatio;
this.Scale = scale;
}
示例9: SetRotation
private void SetRotation(Rotation rotation)
{
var prefabRotation = doorPrefab.transform.eulerAngles;
prefabRotation.y = RotationHelper.GetEulerAngle(rotation);
this.goReference.transform.eulerAngles = prefabRotation;
this.rotation = rotation;
}
示例10: Start
// Use this for initialization
void Start()
{
originalPos = transform.position;
originalPos.z = 0;
leashLength = 0.5f;
moveSpeed = 1.0f;
playerController = memoizer.GetMemoizedComponent<CharacterController>(gameObject);
rotateScript = memoizer.GetMemoizedComponent<Rotation>(GameObject.FindGameObjectWithTag("Sphere"));
}
示例11: SETItem
public SETItem(EditorItemSelection selectionManager)
: base(selectionManager)
{
Position = new Vertex();
Rotation = new Rotation();
Scale = new Vertex();
objdef = LevelData.ObjDefs[id];
bounds = objdef.GetBounds(this);
}
示例12: ApplyMove
// Apply a full move to the board
// This swaps CurrentPlayer
public bool ApplyMove(int xCoord, int yCoord, PieceColor color, Rotation r)
{
bool placed = this.PlacePieceAt(xCoord, yCoord, color);
if (placed)
{
this.DoRotation(r);
this.CurrentPlayer = (color == PieceColor.White) ? PieceColor.Black : PieceColor.White;
}
return placed;
}
示例13: Rotate
public float Rotate(Rotation rotation, float _Rotation)
{
if (rotation == Rotation.Left)
return RotateLeft(_Rotation);
if (rotation == Rotation.Right)
return RotateRight(_Rotation);
return 0;
}
示例14: Rotation
public Rotation(string name, double roll, double pitch, double yaw)
{
self = this;
self.name = name;
self.roll = roll;
self.pitch = pitch;
self.yaw = yaw;
self.r = new Matrix3();
r.from_euler(roll, pitch, yaw);
}
示例15: SpawnDoor
private void SpawnDoor(IntVector3 position, Rotation rotation)
{
if (this.goReference == null) {
PreloadPrefabs();
this.goReference = doorPrefab.Spawn();
this.goReference.transform.position = position.ToVector3();
SetRotation(rotation);
}
}