Ejemplo n.º 1
0
        public void Remove(ContactMaterial contactMaterial)
        {
            int index = -1;

            while ((index = Array.FindIndex(ContactMaterials, cm => { return(cm == contactMaterial); })) >= 0)
            {
                m_contactMaterials.RemoveAt(index);
            }
        }
Ejemplo n.º 2
0
        public void Add(ContactMaterial contactMaterial)
        {
            if (contactMaterial == null || ContactMaterials.Contains(contactMaterial))
            {
                return;
            }

            m_contactMaterials.Add(new ContactMaterialEntry()
            {
                ContactMaterial = contactMaterial
            });
        }
        protected override bool Initialize()
        {
            RemoveNullEntries();

            foreach (var entry in m_contactMaterials)
            {
                ContactMaterial contactMaterial = entry.ContactMaterial.GetInitialized <ContactMaterial>();
                if (contactMaterial != null && contactMaterial.Native != null)
                {
                    GetSimulation().getMaterialManager().add(contactMaterial.Native);
                }
            }
            return(base.Initialize());
        }