Example #1
0
 public Axis(Vector3 direction, float length, Color color)
 {
     selected       = false;
     this.color     = color;
     this.direction = direction;
     this.length    = length;
     axisBox        = new Box3();
     Vector3[] axes = axisBox.getAxes();
     axes[0] = Vector3.Right;
     axes[1] = Vector3.Up;
     axes[2] = Vector3.Forward;
     setupBox();
 }
Example #2
0
 public RotationAxis(Vector3 xAxis, Vector3 yAxis, Vector3 eulerAxis, float radius, Color color)
 {
     this.eulerAxis = eulerAxis;
     axisBox        = new Box3();
     Vector3[] axes = axisBox.getAxes();
     axes[0]    = Vector3.Right;
     axes[1]    = Vector3.Up;
     axes[2]    = Vector3.Forward;
     selected   = false;
     this.color = color;
     this.xAxis = xAxis;
     this.yAxis = yAxis;
     setRadius(radius);
 }
Example #3
0
        public RotateTool(String name, MovableObject movable, float radius)
        {
            this.name    = name;
            this.movable = movable;
            xAxis        = new RotationAxis(Vector3.Backward, Vector3.Up, ROLL, radius, new Color(1.0f, 0.0f, 0.0f));
            yAxis        = new RotationAxis(Vector3.Backward, Vector3.Right, YAW, radius, new Color(0.0f, 0.0f, 1.0f));
            zAxis        = new RotationAxis(Vector3.Right, Vector3.Up, PITCH, radius, new Color(0.0f, 1.0f, 0.0f));
            //Bounding box
            Vector3[] axes = boundingBox.getAxes();
            axes[0] = Vector3.Right;
            axes[1] = Vector3.Up;
            axes[2] = Vector3.Forward;
            Vector3 boundsExtents = new Vector3(radius, radius, radius);

            boundingBox.setExtents(boundsExtents);
            Visible = false;
        }
Example #4
0
        public MoveTool(String name, MovableObject movable, float startingLength)
        {
            this.movable = movable;
            this.name    = name;
            xAxisBox     = new Axis(Vector3.Right, startingLength, new Color(1.0f, 0.0f, 0.0f));
            yAxisBox     = new Axis(Vector3.Up, startingLength, new Color(0.0f, 0.0f, 1.0f));
            zAxisBox     = new Axis(Vector3.Backward, startingLength, new Color(0.0f, 1.0f, 0.0f));
            xzAxisBox    = new Axis(Vector3.Right + Vector3.Backward, startingLength / DOUBLE_AXIS_SCALE, new Color(1.0f, 0.0f, 1.0f));
            //xzAxisBox.Enabled = false;
            xyAxisBox = new Axis(Vector3.Right + Vector3.Up, startingLength / DOUBLE_AXIS_SCALE, new Color(1.0f, 0.0f, 1.0f));
            //xyAxisBox.Enabled = false;
            yzAxisBox = new Axis(Vector3.Up + Vector3.Backward, startingLength / DOUBLE_AXIS_SCALE, new Color(1.0f, 0.0f, 1.0f));
            //yzAxisBox.Enabled = false;

            //Bounding box
            Vector3[] axes = boundingBox.getAxes();
            axes[0] = Vector3.Right;
            axes[1] = Vector3.Up;
            axes[2] = Vector3.Forward;
            Vector3 boundsExtents = new Vector3(startingLength / 2.0f, startingLength / 2.0f, startingLength / 2.0f);

            boundingBox.setExtents(boundsExtents);
            Visible = false;
        }