Ejemplo n.º 1
0
        void AddAtom(PDBAtom atomData)
        {
            GameObject atom = new GameObject(atomData.elementType.ToString() + atomData.atomNumber, typeof(MetaballNode));

            atom.transform.SetParent(root);
            atom.transform.localPosition = pointCloudScale * atomData.localPosition;
            atom.GetComponent <MetaballNode>().baseRadius = blobSize * MoleculeUtility.SizeForElement(atomData.elementType);
        }
Ejemplo n.º 2
0
        void EmitAtom(PDBAtom atomData)
        {
            ParticleSystem.EmitParams particle = new ParticleSystem.EmitParams();

            particle.position      = scale * atomData.localPosition;
            particle.velocity      = Vector3.zero;
            particle.startLifetime = Mathf.Infinity;
            particle.startColor    = palette.ColorForElement(atomData.elementType);
            particle.startSize     = scale * atomSize * MoleculeUtility.SizeForElement(atomData.elementType);
            particle.randomSeed    = (uint)atomData.index;

            emitter.Emit(particle, 1);
        }