Beispiel #1
0
        public static Material Get(EntityBase entity, int slot = 0)
        {
#if !(RELEASE && RELEASE_DISABLE_CHECKS)
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
#endif

            var ptr = NativeMaterialMethods.GetMaterial(entity.GetIEntity(), slot);
            return(TryGet(ptr));
        }
Beispiel #2
0
        public static void Set(EntityBase entity, Material mat, int slot = 0)
        {
#if !(RELEASE && RELEASE_DISABLE_CHECKS)
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
            if (mat == null)
            {
                throw new ArgumentNullException("mat");
            }
#endif

            NativeMaterialMethods.SetMaterial(entity.GetIEntity(), mat.Handle, slot);
        }
Beispiel #3
0
 public static void RemoveAll(EntityBase parent)
 {
     NativeEntityMethods.RemoveAllEntityLinks(parent.GetIEntity());
 }
Beispiel #4
0
 public static EntityLink Create(EntityBase parent, EntityBase slave, string linkName, Vec3?relativePos = null, Quat?relativeRot = null)
 {
     return(new EntityLink(NativeEntityMethods.AddEntityLink(parent.GetIEntity(), linkName, slave.Id, slave.GUID, relativeRot ?? Quat.Identity, relativePos ?? Vec3.Zero), parent));
 }
Beispiel #5
0
 public static void RemoveAll(EntityBase parent)
 {
     NativeEntityMethods.RemoveAllEntityLinks(parent.GetIEntity());
 }
Beispiel #6
0
 public static EntityLink Create(EntityBase parent, EntityBase slave, string linkName, Vec3? relativePos = null, Quat? relativeRot = null)
 {
     return new EntityLink(NativeEntityMethods.AddEntityLink(parent.GetIEntity(), linkName, slave.Id, relativeRot ?? Quat.Identity, relativePos ?? Vec3.Zero), parent);
 }
Beispiel #7
0
        public static void Set(EntityBase entity, Material mat, int slot = 0)
        {
            #if !(RELEASE && RELEASE_DISABLE_CHECKS)
            if (entity == null)
                throw new ArgumentNullException("entity");
            if (mat == null)
                throw new ArgumentNullException("mat");
            #endif

            NativeMaterialMethods.SetMaterial(entity.GetIEntity(), mat.Handle, slot);
        }
Beispiel #8
0
        public static Material Get(EntityBase entity, int slot = 0)
        {
            #if !(RELEASE && RELEASE_DISABLE_CHECKS)
            if (entity == null)
                throw new ArgumentNullException("entity");
            #endif

            var ptr = NativeMaterialMethods.GetMaterial(entity.GetIEntity(), slot);
            return TryGet(ptr);
        }