Example #1
0
 protected override void configVector(VectorGraphic vector)
 {
     base.configVector(vector);
     vector.maximumMagnitude = 1500f;
     vector.minimumMagnitude = 0.025f;
     vector.maxLength        = 4f;
     vector.minLength        = 0.5f;
     vector.maxWidth         = 0.2f;
     vector.minWidth         = 0.04f;
 }
Example #2
0
        protected VectorGraphic[] getVectors(int count)
        {
            GameObject obj;
            var        v = new VectorGraphic[count];

            for (int i = 0; i < count; i++)
            {
                obj       = new GameObject("PartModule Vector object");
                obj.layer = gameObject.layer;
                v [i]     = obj.AddComponent <VectorGraphic> ();
                configVector(v [i]);
            }
            return(v);
        }
Example #3
0
        void Awake()
        {
            /* layer change must be done before adding the Graphic components */
            GameObject obj = new GameObject("Translation Vector Object");

            obj.layer                   = gameObject.layer;
            obj.transform.parent        = transform;
            obj.transform.localPosition = Vector3.zero;
            transVector                 = obj.AddComponent <VectorGraphic> ();
            Color color = Color.green;

            color.a                      = 0.4f;
            transVector.color            = color;
            transVector.offset           = 0.6f;
            transVector.maxLength        = 3f;
            transVector.minLength        = 0.25f;
            transVector.maxWidth         = 0.16f;
            transVector.minWidth         = 0.05f;
            transVector.upperMagnitude   = 5;
            transVector.lowerMagnitude   = threshold;
            transVector.exponentialScale = true;

            obj                           = new GameObject("Torque Vector Object");
            obj.layer                     = gameObject.layer;
            obj.transform.parent          = transform;
            obj.transform.localPosition   = Vector3.zero;
            torqueVector                  = obj.AddComponent <VectorGraphic> ();
            color                         = XKCDColors.ReddishOrange;
            color.a                       = 0.6f;
            torqueVector.color            = color;
            torqueVector.offset           = 0.6f;
            torqueVector.maxLength        = 3f;
            torqueVector.minLength        = 0.25f;
            torqueVector.maxWidth         = 0.16f;
            torqueVector.minWidth         = 0.05f;
            torqueVector.upperMagnitude   = 5;
            torqueVector.lowerMagnitude   = threshold;
            torqueVector.exponentialScale = true;

            obj                         = new GameObject("Torque Circle Object");
            obj.layer                   = gameObject.layer;
            obj.transform.parent        = transform;
            obj.transform.localPosition = Vector3.zero;
            torqueCircle                = obj.AddComponent <CircularVectorGraphic> ();

            MoI = gameObject.AddComponent <MomentOfInertia> ();
        }
Example #4
0
        void Awake()
        {
            var obj = new GameObject ("DragForce Vector object");
            obj.layer = gameObject.layer;
            obj.transform.parent = gameObject.transform;
            obj.transform.localPosition = Vector3.zero;
            vector = obj.AddComponent<VectorGraphic> ();
            vector.upperMagnitude = 150;
            vector.maxLength = 2;
            vector.minLength = 0.25f;
            vector.maxWidth = 0.08f;
            vector.minWidth = 0.02f;
            vector.offset = 0.6f;

            vector.value = Vector3.zero;
            vector.enabled = true;
        }
Example #5
0
        void Awake()
        {
            var obj = new GameObject("DragForce Vector object");

            obj.layer                   = gameObject.layer;
            obj.transform.parent        = gameObject.transform;
            obj.transform.localPosition = Vector3.zero;
            vector = obj.AddComponent <VectorGraphic> ();
            vector.upperMagnitude = 150;
            vector.maxLength      = 2;
            vector.minLength      = 0.25f;
            vector.maxWidth       = 0.08f;
            vector.minWidth       = 0.02f;
            vector.offset         = 0.6f;

            vector.value   = Vector3.zero;
            vector.enabled = true;
        }
Example #6
0
 protected virtual void configVector(VectorGraphic vector)
 {
     vector.setColor(color);
 }
 protected void createVectors(int count)
 {
     GameObject obj;
     vectors = new VectorGraphic[count];
     for (int i = 0; i < count; i++) {
         obj = new GameObject ("PartModule Vector object");
         obj.layer = gameObject.layer;
         vectors [i] = obj.AddComponent<VectorGraphic> ();
         configVector(vectors [i]);
     }
 }
 protected virtual void configVector(VectorGraphic vector)
 {
     vector.setColor (color);
 }