private void Move(Vector2 _inputDirection) { Vector3 _forward = Vector3.Transform(new Vector3(0, 0, 1), rotation); Vector3 _right = Vector3.Normalize(Vector3.Cross(_forward, new Vector3(0, 1, 0))); Vector3 _moveDirection = _right * _inputDirection.X + _forward * _inputDirection.Y; position += _moveDirection * moveSpeed; ServerSend.PlayerPosition(this); ServerSend.PlayerRotation(this); }
void Move(Vector2 direction) { Vector3 forward = Vector3.Transform(new Vector3(0, 0, 1), rotation); Vector3 right = Vector3.Normalize(Vector3.Cross(forward, new Vector3(0, 1, 0))); Vector3 moveDirection = direction.X * right + direction.Y * forward; position += moveDirection * moveSpeed; ServerSend.PlayerPosition(this); ServerSend.PlayerRotation(this); }