예제 #1
0
        public void Remove(ContactMaterial contactMaterial)
        {
            int index = -1;

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

            m_contactMaterials.Add(new ContactMaterialEntry()
            {
                ContactMaterial = contactMaterial
            });
        }
예제 #3
0
        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());
        }