当前位置: 首页>>代码示例>>C#>>正文


C# HkWorld.UnmarkForWrite方法代码示例

本文整理汇总了C#中HkWorld.UnmarkForWrite方法的典型用法代码示例。如果您正苦于以下问题:C# HkWorld.UnmarkForWrite方法的具体用法?C# HkWorld.UnmarkForWrite怎么用?C# HkWorld.UnmarkForWrite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HkWorld的用法示例。


在下文中一共展示了HkWorld.UnmarkForWrite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StepWorld

 private static void StepWorld(HkWorld world)
 {
     world.ExecutePendingCriticalOperations();
     
     world.UnmarkForWrite();
     world.StepSimulation(VRage.Game.MyEngineConstants.PHYSICS_STEP_SIZE_IN_SECONDS * MyFakes.SIMULATION_SPEED);
     world.StepSimulation(VRage.Game.MyEngineConstants.PHYSICS_STEP_SIZE_IN_SECONDS * MyFakes.SIMULATION_SPEED);
     world.MarkForWrite();
 }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:9,代码来源:MyPhysics.cs

示例2: LoadData

        public override void LoadData()
        {
            if (!HkBaseSystem.DestructionEnabled)
            {
                MyLog.Default.WriteLine("Havok Destruction is not availiable in this build.");
                throw new System.InvalidOperationException("Havok Destruction is not availiable in this build.");
            }

            if (Static != null)
            {
                MyLog.Default.WriteLine("Destruction data was not freed. Unloading now...");
                //throw new System.InvalidOperationException("Destruction data was not freed");
                UnloadData();
            }
            Static = this;
            BlockShapePool = new MyBlockShapePool();

            TemporaryWorld = new HkWorld(true, 50000, MyPhysics.RestingVelocity, MyFakes.ENABLE_HAVOK_MULTITHREADING, 4);
            TemporaryWorld.MarkForWrite();
            TemporaryWorld.DestructionWorld = new HkdWorld(TemporaryWorld);
            TemporaryWorld.UnmarkForWrite();
            Storage = new HkDestructionStorage(TemporaryWorld.DestructionWorld);

            // pre-fracture cube blocks
            {
                foreach (var groupName in MyDefinitionManager.Static.GetDefinitionPairNames())
                {
                    var group = MyDefinitionManager.Static.GetDefinitionGroup(groupName);

                    if (group.Large != null)
                    {
                        var model = MyModels.GetModel(group.Large.Model);
                        if (model == null)
                            continue;

                        bool isGenerated = group.Large.IsGeneratedBlock && (group.Large.GeneratedBlockType == GENERATED_BLOCK_TYPE_PILLAR);
                        if (!MyFakes.LAZY_LOAD_DESTRUCTION || (model != null && model.HavokBreakableShapes != null)) //reload materials
                            LoadModelDestruction(group.Large.Model, group.Large, isGenerated, group.Large.Size * (MyDefinitionManager.Static.GetCubeSize(group.Large.CubeSize)));
                       
                       foreach(var progress in group.Large.BuildProgressModels)
                       {
                           model = MyModels.GetModel(progress.File);
                           if (model == null)
                               continue;

                           if (!MyFakes.LAZY_LOAD_DESTRUCTION || (model != null && model.HavokBreakableShapes != null)) //reload materials
                               LoadModelDestruction(progress.File, group.Large, isGenerated, group.Large.Size * (MyDefinitionManager.Static.GetCubeSize(group.Large.CubeSize)));
                       }
                        
                        
                        if (MyFakes.CHANGE_BLOCK_CONVEX_RADIUS)
                        {
                            if (model != null && model.HavokBreakableShapes != null)
                            {
                                var shape = model.HavokBreakableShapes[0].GetShape();
                                if(shape.ShapeType != HkShapeType.Sphere && shape.ShapeType != HkShapeType.Capsule)
                                    SetConvexRadius(model.HavokBreakableShapes[0], MyDestructionConstants.LARGE_GRID_CONVEX_RADIUS);
                            }
                        }
                    }

                    if (group.Small != null)
                    {
                        var model = MyModels.GetModel(group.Small.Model);
                        if (model == null)
                            continue;
                        bool isGenerated = group.Small.IsGeneratedBlock && (group.Small.GeneratedBlockType == GENERATED_BLOCK_TYPE_PILLAR);
                        if (!MyFakes.LAZY_LOAD_DESTRUCTION || (model != null && model.HavokBreakableShapes != null)) //reload materials
                            LoadModelDestruction(group.Small.Model, group.Small, isGenerated, group.Small.Size * (MyDefinitionManager.Static.GetCubeSize(group.Small.CubeSize)));

                        foreach (var progress in group.Small.BuildProgressModels)
                        {
                            model = MyModels.GetModel(progress.File);
                            if (model == null)
                                continue;
                            if (!MyFakes.LAZY_LOAD_DESTRUCTION || (model != null && model.HavokBreakableShapes != null)) //reload materials
                                LoadModelDestruction(progress.File, group.Small, isGenerated, group.Large.Size * (MyDefinitionManager.Static.GetCubeSize(group.Large.CubeSize)));
                        }

                        if (MyFakes.CHANGE_BLOCK_CONVEX_RADIUS)
                        {
                            if (model != null && model.HavokBreakableShapes != null)
                            {
                                var shape = model.HavokBreakableShapes[0].GetShape();
                                if (shape.ShapeType != HkShapeType.Sphere && shape.ShapeType != HkShapeType.Capsule)
                                    SetConvexRadius(model.HavokBreakableShapes[0], MyDestructionConstants.LARGE_GRID_CONVEX_RADIUS);
                            }
                        }
                    }
                }
                if (!MyFakes.LAZY_LOAD_DESTRUCTION)
                    BlockShapePool.Preallocate();
            }

            foreach (var enviroment in MyDefinitionManager.Static.GetEnvironmentItemDefinitions())
            {
                LoadModelDestruction(enviroment.Model, enviroment, false, Vector3.One, false, true);
            }
        }
开发者ID:austusross,项目名称:SpaceEngineers,代码行数:99,代码来源:MyDestructionData.cs

示例3: StepWorld

 private static void StepWorld(HkWorld world)
 {
     world.UnmarkForWrite();
     world.StepSimulation(MyEngineConstants.PHYSICS_STEP_SIZE_IN_SECONDS * MyFakes.SIMULATION_SPEED);
     world.StepSimulation(MyEngineConstants.PHYSICS_STEP_SIZE_IN_SECONDS * MyFakes.SIMULATION_SPEED);
     world.MarkForWrite();
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:7,代码来源:MyPhysics.cs


注:本文中的HkWorld.UnmarkForWrite方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。