Пример #1
0
        private void CreateAtomRCBB(int type, int start, int end, ArrayList atomLocationalist, Color c, Vector3 v, int order)
        {
            GameObject Atom;

            if (UIData.toggleClip)
            {
                Atom = Clip4RayCasting.CreateClip();
            }
            else
            {
                Atom = GameObject.CreatePrimitive(PrimitiveType.Plane);
            }

            float[] fLocation = atomLocationalist[start] as float[];
            Vector3 location  = new Vector3(fLocation[0], fLocation[1], fLocation[2]);

            Atom.transform.Translate(location);
            Atom.renderer.material.SetColor("_Color", c);
            MoleculeModel.atoms.Add(Atom);
            Atom.AddComponent("CameraFacingBillboard");
            Atom.GetComponent <CameraFacingBillboard>().cameraToLookAt = GameObject.Find("Camera").camera;
            Atom.transform.renderer.material.shader = Shader.Find("FvNano/Ball HyperBalls OpenGL");
            Atom.AddComponent("BallUpdateRC");
            BallUpdateRC comp = Atom.GetComponent <BallUpdateRC>();

            comp.rayon     = (float)(v[0]);
            comp.atomcolor = c;
            comp.number    = order;
            comp.enabled   = true;
            switch (type)
            {
            case 0: Atom.tag = "C"; break;

            case 1: Atom.tag = "N"; break;

            case 2: Atom.tag = "O"; break;

            case 3: Atom.tag = "S"; break;

            case 4: Atom.tag = "P"; break;

            case 5: Atom.tag = "H"; break;

            default: Atom.tag = "X"; break;
            }
        }
Пример #2
0
        private void CreateAtomRC(int type, int start, int end, ArrayList atomLocationalist, Color c, Vector3 v, int order)
        {
            GameObject Atom;

            Atom = GameObject.CreatePrimitive(PrimitiveType.Cube);
            float[] fLocation = atomLocationalist[start] as float[];
            Vector3 location  = new Vector3(fLocation[0], fLocation[1], fLocation[2]);

            Atom.transform.Translate(location);
            Atom.renderer.material.SetColor("_Color", c);
            MoleculeModel.atoms.Add(Atom);
            Atom.renderer.material.shader = Shader.Find("FvNano/Ball HyperBalls OpenGL");
            Atom.AddComponent("BallUpdateRC");
            BallUpdateRC comp = Atom.GetComponent <BallUpdateRC>();

            comp.rayon     = (float)(v[0]);
            comp.atomcolor = c;
            comp.number    = order;
            comp.enabled   = true;
            switch (type)
            {
            case 0: Atom.tag = "C"; break;

            case 1: Atom.tag = "N"; break;

            case 2: Atom.tag = "O"; break;

            case 3: Atom.tag = "S"; break;

            case 4: Atom.tag = "P"; break;

            case 5: Atom.tag = "H"; break;

            default: Atom.tag = "X"; break;
            }
        }