public MyPrefabConfigurationAlarm(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, MyModelsEnum modelLod0EnumOn, MyModelsEnum?modelLod1EnumOn, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                   SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag)
     : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, needsUpdate: true, requiresEnergy: false)
 {
     ModelLod0EnumOn = modelLod0EnumOn;
     ModelLod1EnumOn = modelLod1EnumOn;
 }
 public MyPrefabConfigurationAlarm(MyModelsEnum modelLod0Enum, MyModelsEnum? modelLod1Enum, MyModelsEnum modelLod0EnumOn, MyModelsEnum? modelLod1EnumOn, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
     SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag)
     : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, needsUpdate: true, requiresEnergy: false)
 {
     ModelLod0EnumOn = modelLod0EnumOn;
     ModelLod1EnumOn = modelLod1EnumOn;
 }    
 public MyPrefabConfigurationGenerator(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                       SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, float range, float rotatingVelocity = DEFAULT_ROTATING_VELOCITY, MyModelsEnum?modelCol = null,
                                       float explosionParticleEffectScale = 1)
     : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Generator, range, rotatingVelocity,
            MySoundCuesEnum.Amb3D_GenXstart, MySoundCuesEnum.Amb3D_GenXloop, MySoundCuesEnum.Amb3D_GenXend, modelCol, explosionParticleEffectScale : explosionParticleEffectScale)
 {
 }
Beispiel #4
0
        MyEntity addDebris(StringBuilder hudLabel, MyModelsEnum? lod0, MyModelsEnum? lod1, ref Vector3 currentPosition, Vector3 forward, MyMeshDrawTechnique? drawTechnique = null)
        {
            MyDebugDebris debugDebris = new MyDebugDebris();
            debugDebris.Init(hudLabel, lod0, lod1, drawTechnique);

            return addEntity(debugDebris, ref currentPosition, forward);
        }
        public void Init(StringBuilder hudLabelText, MyModelsEnum?modelLod0Enum, MyModelsEnum?modelLod1Enum,
                         Matrix localMatrix, MyMwcObjectBuilder_SmallShip_Ammo_TypesEnum ammoType, MyLargeShipGunBase parentObject)
        {
            base.Init(hudLabelText, modelLod0Enum, modelLod1Enum, parentObject, null, null);

            LocalMatrix = localMatrix;
            ((MyLargeShipGunBase)parentObject).InitializationBarrelMatrix = LocalMatrix;

            // Check for the dummy cubes for the muzzle flash positions:
            if (ModelLod0 != null)
            {
                // test for one value:
                StringBuilder sb = new StringBuilder();
                sb.Append(MyLargeShipWeaponsConstants.MUZZLE_FLASH_NAME_ONE);
                if (ModelLod0.Dummies.Count > 0)
                {
                    if (ModelLod0.Dummies.ContainsKey(sb.ToString()))
                    { // one muzzle flash value:
                        m_muzzleDummies.Add(ModelLod0.Dummies[sb.ToString()]);
                    }
                    else
                    {
                        // more muzzle flashes values:
                        int num = 0;
                        for (int i = 0; i < ModelLod0.Dummies.Count; ++i)
                        {
                            sb.Clear();
                            sb.Append(MyLargeShipWeaponsConstants.MUZZLE_FLASH_NAME_MODE);
                            sb.Append(i.ToString());

                            if (ModelLod0.Dummies.ContainsKey(sb.ToString()))
                            {
                                ++num;
                            }
                        }
                        for (int i = 0; i < ModelLod0.Dummies.Count; ++i)
                        {
                            sb.Clear();
                            sb.Append(MyLargeShipWeaponsConstants.MUZZLE_FLASH_NAME_MODE);
                            sb.Append(i.ToString());
                            if (ModelLod0.Dummies.ContainsKey(sb.ToString()))
                            {
                                m_muzzleDummies.Add(ModelLod0.Dummies[sb.ToString()]);
                            }
                        }
                    }
                }
            }

            //base.InitSpherePhysics(MyMaterialType.METAL, ModelLod0, 9999999.0f, 1.0f, MyConstants.COLLISION_LAYER_ALL, RigidBodyFlag.RBF_RBO_STATIC);
            if (this.Physics != null)
            {
                //this.Physics.Enabled = true;
                this.Physics.Update();
            }

            m_ammoType = ammoType;
            Save       = false;
            //NeedsUpdate = true; //No, barrel is updated from parent
        }
Beispiel #6
0
        /// <summary>
        /// Inits the specified hud label text.
        /// </summary>
        /// <param name="hudLabelText">The hud label text.</param>
        /// <param name="modelLod0Enum">The model lod0 enum.</param>
        /// <param name="modelLod1Enum">The model lod1 enum.</param>
        /// <param name="parentObject">The parent object.</param>
        /// <param name="scale">The scale.</param>
        /// <param name="objectBuilder">The object builder.</param>
        public override void Init(StringBuilder hudLabelText, MyModelsEnum?modelLod0Enum, MyModelsEnum?modelLod1Enum, MyEntity parentObject, float?scale, MyMwcObjectBuilder_Base objectBuilder, MyModelsEnum?modelCollision = null, Models.MyModelsEnum?modelLod2 = null)
        {
            Flags      |= EntityFlags.EditableInEditor;
            NeedsUpdate = true;

            base.Init(hudLabelText, modelLod0Enum, modelLod1Enum, null, scale, objectBuilder, modelCollision, modelLod2);
        }
Beispiel #7
0
 public MyPrefabConfigurationKinematic(MyModelsEnum modelBaseLod0Enum, MyModelsEnum?modelBaseLod1Enum,
                                       List <MyPrefabConfigurationKinematicPart> kinematicParts, MySoundCuesEnum?soundOpening, MySoundCuesEnum?soundLooping,
                                       MySoundCuesEnum?soundClosing, float openTime, float closeTime, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                       SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, MyModelsEnum?collisionModelEnum = null)
     : this(modelBaseLod0Enum, modelBaseLod1Enum, kinematicParts, soundOpening, soundLooping, soundClosing, openTime, closeTime,
            buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Default, collisionModelEnum)
 {
 }
 public MyPrefabConfigurationGenerator(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                       SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag, float range, float rotatingVelocity = DEFAULT_ROTATING_VELOCITY,
                                       MySoundCuesEnum?startRotatingCue   = MySoundCuesEnum.Amb3D_GenXstart, MySoundCuesEnum?looptRotatingCue = MySoundCuesEnum.Amb3D_GenXloop, MySoundCuesEnum?endRotatingCue = MySoundCuesEnum.Amb3D_GenXend, MyModelsEnum?modelCol = null,
                                       float explosionParticleEffectScale = 1)
     : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, minElectricCapacity : MyGameplayConstants.DEFAULT_MAX_ELECTRIC_CAPACITY, rotatingVelocity : rotatingVelocity, collisionModelEnum : modelCol,
            startRotatingCue : startRotatingCue, loopRotatingCue : looptRotatingCue, endRotatingCue : endRotatingCue, displayHud : true, explosionParticleEffectScale : explosionParticleEffectScale)
 {
     Range = range;
 }
        /// <summary>
        /// Creates new instance of prefab configuration without model
        /// </summary>
        /// <param name="buildType">Build type</param>
        /// <param name="categoryType">Category type</param>
        /// <param name="subCategoryType">Subcategory type</param>
        /// <param name="materialType">Material type</param>
        /// <param name="prefabTypeFlag">Prefab type flags</param>
        /// <param name="factionSpecific">To which faction is this prefab specific. Null if prefab is for all factions. Used for material (texture) set availability. </param>
        /// <param name="previewPointOfView">Indicates whether the preview image for this prefab should be from a different angle than normal. Use for flat objects that have incorrect default previews (such as signs). </param>
        protected MyPrefabConfiguration(
            BuildTypesEnum buildType,
            CategoryTypesEnum categoryType,
            SubCategoryTypesEnum? subCategoryType,
            MyMaterialType materialType,
            PrefabTypesFlagEnum prefabTypeFlag,
            MyMwcObjectBuilder_Prefab_AppearanceEnum? factionSpecific = null,
            bool needsUpdate = false,
            bool initPhysics = true,
            bool enabledInEditor = true,
            float rotatingVelocity = DEFAULT_ROTATING_VELOCITY,
            MySoundCuesEnum? startRotatingCue = null,
            MySoundCuesEnum? loopRotatingCue = null,
            MySoundCuesEnum? loopRotatingDamagedCue = null,
            MySoundCuesEnum? endRotatingCue = null,
            MyPreviewPointOfViewEnum previewPointOfView = MyPreviewPointOfViewEnum.Front,
            float minElectricCapacity = MyGameplayConstants.DEFAULT_MIN_ELECTRIC_CAPACITY,
            float maxElectricCapacity = MyGameplayConstants.DEFAULT_MAX_ELECTRIC_CAPACITY,
            MyExplosionTypeEnum explosionType = MyExplosionTypeEnum.SMALL_SHIP_EXPLOSION,
            float explosionRadiusMultiplier = 1.5f,
            float explosionDamageMultiplier = 1,
            float minSizeForExplosion = MyExplosionsConstants.MIN_OBJECT_SIZE_TO_CAUSE_EXPLOSION_AND_CREATE_DEBRIS,
            bool causesAlarm = false,
            bool requiresEnergy = false,
            float explosionParticleEffectScale = 1,
            bool displayHud = false)
        {
            //m_modelLod0Enum = null;
            m_modelLod1Enum = null;

            BuildType = buildType;
            CategoryType = categoryType;
            SubCategoryType = subCategoryType;
            MaterialType = materialType;
            PrefabTypeFlag = prefabTypeFlag;
            FactionSpecific = factionSpecific;
            EnabledInEditor = enabledInEditor;
            RotatingVelocity = rotatingVelocity;
            StartRotatingCue = startRotatingCue;
            LoopRotatingCue = loopRotatingCue;
            LoopRotatingDamagedCue = loopRotatingDamagedCue;
            EndRotatingCue = endRotatingCue;
            PreviewPointOfView = new MyPreviewPointOfView(previewPointOfView);
            MinElectricCapacity = minElectricCapacity;
            MaxElectricCapacity = maxElectricCapacity;
            NeedsUpdate = needsUpdate;
            InitPhysics = initPhysics;
            ExplosionType = explosionType;
            ExplosionRadiusMultiplier = explosionRadiusMultiplier;
            ExplosionDamage = explosionDamageMultiplier;
            ExplosionParticleEffectScale = explosionParticleEffectScale;
            MinSizeForExplosion = minSizeForExplosion;
            CausesAlarm = causesAlarm;
            RequiresEnergy = requiresEnergy;
            DisplayHud = displayHud;
        }
Beispiel #10
0
        void InitDebris(string hudLabelText, MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, MyMaterialType materialType, MyMwcObjectBuilder_LargeDebrisField objectBuilder, Matrix matrix)
        {
            StringBuilder hudLabelTextSb = (hudLabelText == null) ? null : new StringBuilder(hudLabelText);

            base.Init(hudLabelTextSb, modelLod0Enum, modelLod1Enum, null, null, objectBuilder);

            MyModel model = MyModels.GetModelOnlyData(modelLod0Enum);

            InitTrianglePhysics(materialType, 1.0f, model, null, enable: false);
            SetWorldMatrix(matrix);
        }
Beispiel #11
0
        public virtual void Init(StringBuilder hudLabelText, MyModelsEnum?modelEnum, MyMaterialType materialType,
                                 MyEntity parentObject, Vector3 position, Vector3 forwardVector, Vector3 upVector,
                                 MyMwcObjectBuilder_Base objectBuilder, MyModelsEnum?collisionModelEnum = null)
        {
            base.Init(hudLabelText, modelEnum, null, parentObject, null, objectBuilder, modelCollision: collisionModelEnum);
            this.LocalMatrix = Matrix.CreateWorld(position, forwardVector, upVector);
            //NeedsUpdate = true; //Smallship updates weapons manually
            CastShadows = false;

            PreloadTextures();
        }
Beispiel #12
0
        public float ZOffset;                                                        // z-offset from ship's dummy

        public void Init(StringBuilder hudLabelText, MyModelsEnum?modelEnum, MyMaterialType materialType,
                         MySmallShip parent, Vector3 position, Vector3 forwardVector, Vector3 upVector,
                         MyMwcObjectBuilder_Base objectBuilder)
        {
            base.Init(hudLabelText, modelEnum, materialType, parent, position, forwardVector, upVector, objectBuilder);

            Debug.Assert(objectBuilder is MyMwcObjectBuilder_SmallShip_Weapon);
            WeaponType = ((MyMwcObjectBuilder_SmallShip_Weapon)objectBuilder).WeaponType;
            //  Don't need to check frustum, because it's checked by this gun's parent
            m_frustumCheckBeforeDrawEnabled = false;
        }
Beispiel #13
0
 public MyPrefabConfigurationKinematicPart(int prefabId, MyModelsEnum modelMovingEnum, string open, string close, BuildTypesEnum buildType,
                                           CategoryTypesEnum categoryType, SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, DamageTypesEnum damageType, MyModelsEnum?modelLod1 = null, MyModelsEnum?collisionModelEnum = null)
     : base(modelMovingEnum, modelLod1, buildType, categoryType, subCategoryType, materialType,
            //0.5 because of door parts, to not take also second part
            PrefabTypesFlagEnum.Default, needsUpdate: true, explosionRadiusMultiplier: 0.5f, explosionDamage: 0.33f, collisionModelEnum: collisionModelEnum, explosionParticleEffectScale: 2.0f)
 {
     m_modelMovingEnum = modelMovingEnum;
     m_open            = open;
     m_close           = close;
     m_damageType      = damageType;
     PrefabId          = prefabId;
 }
 public MyPrefabConfigurationKinematicPart(int prefabId, MyModelsEnum modelMovingEnum, string open, string close, BuildTypesEnum buildType,
     CategoryTypesEnum categoryType, SubCategoryTypesEnum? subCategoryType, MyMaterialType materialType, DamageTypesEnum damageType, MyModelsEnum? modelLod1 = null, MyModelsEnum? collisionModelEnum = null)
     : base(modelMovingEnum, modelLod1, buildType, categoryType, subCategoryType, materialType,
                                                            //0.5 because of door parts, to not take also second part
            PrefabTypesFlagEnum.Default, needsUpdate: true, explosionRadiusMultiplier: 0.5f, explosionDamage: 0.33f, collisionModelEnum: collisionModelEnum, explosionParticleEffectScale: 2.0f)
 {
     m_modelMovingEnum = modelMovingEnum;
     m_open = open;
     m_close = close;
     m_damageType = damageType;
     PrefabId = prefabId;
 }
Beispiel #15
0
        private static void PreloadModel(MyModelsEnum?myModelsEnum)
        {
            if (myModelsEnum == null)
            {
                return;
            }

            MyModel model = MyModels.GetModelOnlyData(myModelsEnum.Value);

            model.LoadInDraw();
            model.PreloadTextures(Managers.LoadingMode.Immediate);
        }
Beispiel #16
0
 public MyPrefabConfigurationKinematic(MyModelsEnum modelBaseLod0Enum, MyModelsEnum?modelBaseLod1Enum,
                                       List <MyPrefabConfigurationKinematicPart> kinematicParts, MySoundCuesEnum?soundOpening, MySoundCuesEnum?soundLooping,
                                       MySoundCuesEnum?soundClosing, float openTime, float closeTime, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                       SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag, MyModelsEnum?collisionModelEnum = null)
     : base(modelBaseLod0Enum, modelBaseLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, collisionModelEnum: collisionModelEnum, displayHud: true)
 {
     m_openTime     = openTime;
     m_closeTime    = closeTime;
     KinematicParts = kinematicParts;
     m_soundOpening = soundOpening;
     m_soundLooping = soundLooping;
     m_soundClosing = soundClosing;
 }
Beispiel #17
0
        public MyPrefabConfigurationLargeShip(
            MyModelsEnum modelLod0Enum,
            MyModelsEnum?modelLod1Enum,
            BuildTypesEnum buildType,
            CategoryTypesEnum categoryType,
            SubCategoryTypesEnum?subCategoryType,
            MyMaterialType materialType,
            MyMwcObjectBuilder_Prefab_AppearanceEnum?factionSpecific = null,
            MyModelsEnum?collisionModelEnum   = null,
            MyExplosionTypeEnum explosionType = MyExplosionTypeEnum.BOMB_EXPLOSION,
            float particleScale = 1)

            : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.LargeShip, factionSpecific: factionSpecific, needsUpdate: true, collisionModelEnum: collisionModelEnum, explosionType: explosionType, explosionParticleEffectScale: particleScale)
        {
        }
Beispiel #18
0
        void InitDebris(string hudLabelText, MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, MyMaterialType materialType,
                        MyMwcObjectBuilder_SmallDebris objectBuilder, Matrix matrix, float mass)
        {
            StringBuilder hudLabelTextSb = (hudLabelText == null) ? null : new StringBuilder(hudLabelText);

            base.Init(hudLabelTextSb, modelLod0Enum, modelLod1Enum, null, null, objectBuilder);

            if (objectBuilder != null)
            {
                SetWorldMatrix(matrix);
            }

            if (mass > 0)
            {
                base.InitBoxPhysics(materialType, this.ModelLod0, mass, 0, MyConstants.COLLISION_LAYER_DEFAULT, RigidBodyFlag.RBF_DEFAULT);
                this.Physics.PlayCollisionCueEnabled = true;
            }
        }
 /// <summary>
 /// Creates new instance of prefab configuration
 /// </summary>
 /// <param name="modelLod0Enum">Model LOD0</param>
 /// <param name="modelLod1Enum">Model LOD2</param>
 /// <param name="buildType">Build type</param>
 /// <param name="categoryType">Category type</param>
 /// <param name="subCategoryType">Subcategory type</param>
 /// <param name="materialType">Material type</param>
 /// <param name="prefabTypeFlag">Prefab type flags</param>
 protected MyPrefabConfiguration(
     MyModelsEnum modelLod0Enum,
     MyModelsEnum? modelLod1Enum,
     BuildTypesEnum buildType,
     CategoryTypesEnum categoryType,
     SubCategoryTypesEnum? subCategoryType,
     MyMaterialType materialType,
     PrefabTypesFlagEnum prefabTypeFlag,
     MyModelsEnum? collisionModelEnum = null,
     MyMwcObjectBuilder_Prefab_AppearanceEnum? factionSpecific = null,
     bool needsUpdate = false,
     bool initPhysics = true,
     bool enabledInEditor = true,
     float rotatingVelocity = DEFAULT_ROTATING_VELOCITY,
     MySoundCuesEnum? startRotatingCue = null,
     MySoundCuesEnum? loopRotatingCue = null,
     MySoundCuesEnum? loopRotatingDamagedCue = null,
     MySoundCuesEnum? endRotatingCue = null,
     MyPreviewPointOfViewEnum previewAngle = MyPreviewPointOfViewEnum.Front,
     float minElectricCapacity = MyGameplayConstants.DEFAULT_MIN_ELECTRIC_CAPACITY,
     float maxElectricCapacity = MyGameplayConstants.DEFAULT_MAX_ELECTRIC_CAPACITY,
     MyExplosionTypeEnum explosionType = MyExplosionTypeEnum.SMALL_SHIP_EXPLOSION,
     float explosionRadiusMultiplier = 1,
     float explosionDamage = 1,
     float minSizeForExplosion = MyExplosionsConstants.MIN_OBJECT_SIZE_TO_CAUSE_EXPLOSION_AND_CREATE_DEBRIS,
     bool causesAlarm = false,
     bool requiresEnergy = false,
     float explosionParticleEffectScale = 1,
     bool displayHud = false)
     : this(buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, factionSpecific, needsUpdate, initPhysics, enabledInEditor, rotatingVelocity, 
     startRotatingCue, loopRotatingCue, loopRotatingDamagedCue, endRotatingCue,
     previewAngle, minElectricCapacity, maxElectricCapacity, explosionType, explosionRadiusMultiplier, explosionDamage, minSizeForExplosion, causesAlarm, requiresEnergy: requiresEnergy, explosionParticleEffectScale: explosionParticleEffectScale, displayHud: displayHud)
 {
     m_modelLod0Enum = modelLod0Enum;
     m_modelLod1Enum = modelLod1Enum;
     m_collisionModelEnum = collisionModelEnum;
 }
 /// <summary>
 /// Creates new instance of prefab configuration with default prefab type flags
 /// </summary>
 /// <param name="modelLod0Enum">Model LOD0</param>
 /// <param name="modelLod1Enum">Model LOD2</param>
 /// <param name="buildType">Build type</param>
 /// <param name="categoryType">Category type</param>
 /// <param name="subCategoryType">Subcategory type</param>
 /// <param name="materialType">Material type</param>
 /// <param name="factionSpecific">To which faction is this prefab specific. Null if prefab is for all factions. Used for material (texture) set availability. </param>     
 public MyPrefabConfiguration(
     MyModelsEnum modelLod0Enum,
     MyModelsEnum? modelLod1Enum,
     BuildTypesEnum buildType,
     CategoryTypesEnum categoryType,
     SubCategoryTypesEnum? subCategoryType,
     MyMaterialType materialType,
     MyMwcObjectBuilder_Prefab_AppearanceEnum? factionSpecific = null,
     MyModelsEnum? collisionModelEnum = null,
     bool needsUpdate = false,
     bool initPhysics = true,
     bool enabledInEditor = true,
     float rotatingVelocity = DEFAULT_ROTATING_VELOCITY,
     MySoundCuesEnum? startRotatingCue = null,
     MySoundCuesEnum? loopRotatingCue = null,
     MySoundCuesEnum? loopRotatingDamagedCue = null,
     MySoundCuesEnum? endRotatingCue = null,
     MyPreviewPointOfViewEnum previewAngle = MyPreviewPointOfViewEnum.Front,
     MyExplosionTypeEnum explosionType = MyExplosionTypeEnum.SMALL_SHIP_EXPLOSION,
     float explosionRadiusMultiplier = 1,
     float explosionDamageMultiplier = 1,
     float minSizeForExplosion = MyExplosionsConstants.MIN_OBJECT_SIZE_TO_CAUSE_EXPLOSION_AND_CREATE_DEBRIS,
     bool causesAlarm = false,
     bool requiresEnergy = false,
     float explosionParticleEffectScale = 1,
     bool displayHud = false)
     : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Default, collisionModelEnum, factionSpecific, needsUpdate, initPhysics, enabledInEditor, rotatingVelocity,
     startRotatingCue, loopRotatingCue, loopRotatingDamagedCue, endRotatingCue,
     previewAngle, explosionType: explosionType, explosionRadiusMultiplier: explosionRadiusMultiplier, explosionDamage: explosionDamageMultiplier, minSizeForExplosion: minSizeForExplosion, causesAlarm: causesAlarm, requiresEnergy: requiresEnergy, explosionParticleEffectScale: explosionParticleEffectScale, displayHud: displayHud)
 {
     System.Diagnostics.Debug.Assert(modelLod0Enum != modelLod1Enum, "LOD0 and LOD1 models are the same!");
     if (collisionModelEnum != null)
     {
         System.Diagnostics.Debug.Assert(modelLod0Enum != collisionModelEnum, "LOD0 and COL models are the same!");
         System.Diagnostics.Debug.Assert(modelLod1Enum != collisionModelEnum, "LOD1 and COL models are the same!");
     }
 }
Beispiel #21
0
        //  IMPORTANT: This class isn't realy inicialized by constructor, but by Start()
        //  So don't initialize members here, do it in Start()
        public virtual void Init(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, MyMaterialType materialType, float scale, List <MyRBElementDesc> collisionPrimitives, float mass)
        {
            MyPhysicsObjects physobj = MyPhysics.physicsSystem.GetPhysicsObjects();

            base.Init(null, modelLod0Enum, modelLod1Enum, null, scale, null);

            m_maxLifeTimeInMiliseconds = MyMwcUtils.GetRandomInt(MyExplosionsConstants.EXPLOSION_DEBRIS_LIVING_MIN_IN_MILISECONDS, MyExplosionsConstants.EXPLOSION_DEBRIS_LIVING_MAX_IN_MILISECONDS);
            m_randomizedDiffuseTextureColorMultiplier = MyMwcUtils.GetRandomFloat(0.4f, 0.6f);
            m_initialOrientation = Matrix.CreateRotationX(MyMwcUtils.GetRandomRadian()) * Matrix.CreateRotationY(MyMwcUtils.GetRandomRadian()) * Matrix.CreateRotationZ(MyMwcUtils.GetRandomRadian());

            // create physics
            this.Physics = new MyPhysicsBody(this, mass, 0)
            {
                MaterialType = materialType
            };

            for (int i = 0; i < collisionPrimitives.Count; i++)
            {
                MyRBSphereElement sphereEl = (MyRBSphereElement)physobj.CreateRBElement(collisionPrimitives[i]);
                //
                sphereEl.Radius *= scale;
                this.Physics.AddElement(sphereEl, true);
            }
        }
 public MyPrefabConfigurationFoundationFactory(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                               SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag, MyModelsEnum?collisionModelEnum = null)
     : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, needsUpdate: true, displayHud: true, collisionModelEnum: collisionModelEnum)
 {
 }
 public MyPrefabConfigurationFoundationFactory(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                               SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, MyModelsEnum?collisionModelEnum = null)
     : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.FoundationFactory, collisionModelEnum)
 {
 }
 public MyPrefabConfigurationAlarm(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, MyModelsEnum modelLod0EnumOn, MyModelsEnum?modelLod1EnumOn, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                   SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType)
     : this(modelLod0Enum, modelLod1Enum, modelLod0EnumOn, modelLod1EnumOn, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Alarm)
 {
 }
Beispiel #25
0
        public void Init(StringBuilder hudLabelText, MyMwcObjectBuilder_Drone droneBuilder, MyModelsEnum?modelCollision = null, MyModelsEnum?modelLod2 = null, float?scale = null)
        {
            var modelLod0Enum = GetModelLod0Enum(droneBuilder.DroneType);

            MyEntity owner = null;

            base.Init(hudLabelText, modelLod0Enum, null, owner, scale, droneBuilder, modelCollision, modelLod2);

            SetWorldMatrix(droneBuilder.PositionAndOrientation.GetMatrix());

            m_fired = false;

            m_shipTypeProperties = new MyShipTypeProperties();

            m_reflectorProperies = new MyReflectorConfig(this);

            Faction = droneBuilder.Faction;

            Save = true;

            m_function = MyDroneFunction.None;

            InitWeapons();

            InitEntityDetector();

            InitPhysics(droneBuilder.DroneType);

            InitAI();

            InitSpoiledHolograms();

            InitInventory(droneBuilder.Inventory);

            // back camera is turned off by default
            Config.BackCamera.SetOff();

            m_droneObjectBuilder = droneBuilder;

            UseProperties = new MyUseProperties(MyUseType.Solo, MyUseType.None, MyTextsWrapperEnum.NotificationYouCanTake);
            UseProperties.Init(MyUseType.Solo, MyUseType.None, 0, 1, false);

            HackingTool = new Tools.MyHackingTool(this, MySession.PlayerShip.HackingTool.HackingLevel);
        }
 public MyPrefabConfigurationScanner(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                     SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag)
     : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, needsUpdate: true, initPhysics: false, requiresEnergy: true)
 {
 }
 public MyPrefabConfigurationLight(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                   SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, MyLightPrefabTypeEnum type, PrefabTypesFlagEnum prefabTypesFlag, MyModelsEnum?collisionModelEnum = null)
     : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypesFlag, previewAngle: MyPreviewPointOfViewEnum.Bottom, needsUpdate: true, collisionModelEnum: collisionModelEnum)
 {
     LightType = type;
 }
 public MyPrefabConfigurationSecurityControlHUB(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                                SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, MyModelsEnum?collisionModelEnum = null)
     : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Default, collisionModelEnum)
 {
 }
Beispiel #29
0
 public MyStaticAsteroidModels(MyModelsEnum lod0, MyModelsEnum?lod1, MyModelsEnum?lod2)
 {
     LOD0 = lod0;
     LOD1 = lod1;
     LOD2 = lod2;
 }
 public MyPrefabConfigurationSecurityControlHUB(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                                SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag, MyModelsEnum?collisionModelEnum = null)
     : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, requiresEnergy: true, collisionModelEnum: collisionModelEnum, displayHud: true)
 {
 }
 public MyPrefabConfigurationCamera(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                    SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType, PrefabTypesFlagEnum prefabTypeFlag)
     : base(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, prefabTypeFlag, requiresEnergy: true)
 {
 }
 public MyPrefabConfigurationScanner(MyModelsEnum modelLod0Enum, MyModelsEnum?modelLod1Enum, BuildTypesEnum buildType, CategoryTypesEnum categoryType,
                                     SubCategoryTypesEnum?subCategoryType, MyMaterialType materialType)
     : this(modelLod0Enum, modelLod1Enum, buildType, categoryType, subCategoryType, materialType, PrefabTypesFlagEnum.Scanner)
 {
 }