Beispiel #1
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;
        }
Beispiel #2
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;
        }
Beispiel #3
0
        private void setupBox()
        {
            Vector3 longExtent = direction * length / 2.0f;

            centerOffset = longExtent;
            if (longExtent.x == 0)
            {
                longExtent.x = DELTA;
            }
            if (longExtent.y == 0)
            {
                longExtent.y = DELTA;
            }
            if (longExtent.z == 0)
            {
                longExtent.z = DELTA;
            }
            axisBox.setExtents(longExtent);
        }
Beispiel #4
0
        public void setRadius(float radius)
        {
            this.radius = radius;
            Vector3 extents = xAxis * radius + yAxis * radius;

            if (extents.x == 0)
            {
                extents.x = DELTA;
            }
            if (extents.y == 0)
            {
                extents.y = DELTA;
            }
            if (extents.z == 0)
            {
                extents.z = DELTA;
            }
            axisBox.setExtents(extents.absolute());
        }