コード例 #1
0
        /*
         * Sets starting position for robot.
         * Currently starting position is some random location in 0.5m at the beginning of coordinate plane.
         * Starting direction is directly to finish line. (180°)
         */
        public void PositionRobotAtStart()
        {
            // setting position in starting lane
            Vector3 position = RobotGeometry.GetPosition();

            position.Y = 0.20f;
            position.X = 0.25f;
            position.Z = (float)((new Random().NextDouble() * 2.5) + 0.25);

            // setting correct direction
            Matrix matrix = RobotGeometry.GetMatrixAbsolute();

            matrix.SetMatrixRotationY((float)Math.PI);

            RobotGeometry.SetMatrixAbsolute(matrix, false);
            RobotGeometry.SetPosition(position);
        }
コード例 #2
0
 public Vector3 GetPosition()
 {
     return(core.GetPosition());
 }