• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# BroadPhaseEntries.BroadPhaseEntry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中BEPUphysics.BroadPhaseEntries.BroadPhaseEntry的典型用法代码示例。如果您正苦于以下问题:C# BroadPhaseEntry类的具体用法?C# BroadPhaseEntry怎么用?C# BroadPhaseEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BroadPhaseEntry类属于BEPUphysics.BroadPhaseEntries命名空间,在下文中一共展示了BroadPhaseEntry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {

            instancedMesh = entryA as InstancedMesh;
            convex = entryB as ConvexCollidable;

            if (instancedMesh == null || convex == null)
            {
                instancedMesh = entryB as InstancedMesh;
                convex = entryA as ConvexCollidable;

                if (instancedMesh == null || convex == null)
                    throw new Exception("Inappropriate types used to initialize pair.");
            }            
            
            //Contact normal goes from A to B.
            broadPhaseOverlap.entryA = convex;
            broadPhaseOverlap.entryB = instancedMesh;

            UpdateMaterialProperties(convex.entity != null ? convex.entity.material : null, instancedMesh.material);


            base.Initialize(entryA, entryB);



  

        }
开发者ID:Indiefreaks,项目名称:igf,代码行数:34,代码来源:InstancedMeshPairHandler.cs


示例2: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {

            mobileMesh = entryA as MobileMeshCollidable;
            convex = entryB as ConvexCollidable;

            if (mobileMesh == null || convex == null)
            {
                mobileMesh = entryB as MobileMeshCollidable;
                convex = entryA as ConvexCollidable;

                if (mobileMesh == null || convex == null)
                    throw new ArgumentException("Inappropriate types used to initialize pair.");
            }


            //Contact normal goes from A to B.
            broadPhaseOverlap.entryA = convex;
            broadPhaseOverlap.entryB = mobileMesh;

            //It's possible that the convex does not have an entity if it is a proxy for a non-entity collidable.
            //Similarly, the mesh could be a query object.
            UpdateMaterialProperties(convex.entity != null ? convex.entity.material : null, mobileMesh.entity != null ? mobileMesh.entity.material : null);


            base.Initialize(entryA, entryB);

        }
开发者ID:dsmo7206,项目名称:Lemma,代码行数:33,代码来源:MobileMeshPairHandler.cs


示例3: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {

            terrain = entryA as Terrain;
            convex = entryB as ConvexCollidable;

            if (terrain == null || convex == null)
            {
                terrain = entryB as Terrain;
                convex = entryA as ConvexCollidable;

                if (terrain == null || convex == null)
                    throw new ArgumentException("Inappropriate types used to initialize pair.");
            }

            //Contact normal goes from A to B.
            broadPhaseOverlap.entryA = convex;
            broadPhaseOverlap.entryB = terrain;

            UpdateMaterialProperties(convex.entity != null ? convex.entity.material : null, terrain.material);

            base.Initialize(entryA, entryB);




        }
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:32,代码来源:TerrainPairHandler.cs


示例4: Remove

 public override void Remove(BroadPhaseEntry entry)
 {
     base.Remove(entry);
     entriesX.Remove(entry);
     entriesY.Remove(entry);
     entriesZ.Remove(entry);
 }
开发者ID:Indiefreaks,项目名称:igf,代码行数:7,代码来源:SortAndSweep3D.cs


示例5: Add

        /// <summary>
        /// Adds an entry to the broad phase.
        /// </summary>
        /// <param name="entry">Entry to add.</param>
        public override void Add(BroadPhaseEntry entry)
        {
            base.Add(entry);
            //Entities do not set up their own bounding box before getting stuck in here.  If they're all zeroed out, the tree will be horrible.
            Vector3 offset;
            Vector3.Subtract(ref entry.boundingBox.Max, ref entry.boundingBox.Min, out offset);
            if (offset.X * offset.Y * offset.Z == 0)
                entry.UpdateBoundingBox();
            //binary search for the approximately correct location.  This helps prevent large first-frame sort times.
            int minIndex = 0; //inclusive
            int maxIndex = entries.Count; //exclusive
            int index = 0;
            while (maxIndex - minIndex > 0)
            {
                index = (maxIndex + minIndex) / 2;
                if (entries.Elements[index].boundingBox.Min.X > entry.boundingBox.Min.X)
                    maxIndex = index;
                else if (entries.Elements[index].boundingBox.Min.X < entry.boundingBox.Min.X)
                    minIndex = ++index;
                else
                    break; //Found an equal value!

            }
            entries.Insert(index, entry);
        }
开发者ID:karrtmomil,项目名称:coms437_assignment2,代码行数:29,代码来源:SortAndSweep1D.cs


示例6: IgnoreThis

 public bool IgnoreThis(BroadPhaseEntry entry)
 {
     if (entry is EntityCollidable && ((EntityCollidable)entry).Entity == Entity)
     {
         return false;
     }
     return Collision.ShouldCollide(entry);
 }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:8,代码来源:WheelStepUpConstraint.cs


示例7: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {

            //Child initialization is responsible for setting up the entries.
            //Child initialization is responsible for setting up the manifold, if any.
            manifoldConstraintGroup.Initialize(EntityA, EntityB);

            base.Initialize(entryA, entryB);
        }
开发者ID:dsmo7206,项目名称:Lemma,代码行数:14,代码来源:GroupPairHandler.cs


示例8: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {
            compoundInfoB = entryB as CompoundCollidable;
            if (compoundInfoB == null)
            {
                throw new ArgumentException("Inappropriate types used to initialize pair.");
            }

            base.Initialize(entryA, entryB);
        }
开发者ID:Anomalous-Software,项目名称:BEPUPhysics,代码行数:15,代码来源:CompoundPairHandler.cs


示例9: DontLandOnPlanes

 public bool DontLandOnPlanes(BroadPhaseEntry bpe)
 {
     if (bpe is EntityCollidable)
     {
         EntityCollidable ec = bpe as EntityCollidable;
         if (ec.Entity != null && (ec.Entity.Tag is PlayerEntity || ec.Entity.Tag is PlaneEntity))
         {
             return false;
         }
     }
     return true;
 }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:12,代码来源:WingsItem.cs


示例10: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {
            //Child initialization is responsible for setting up the entries.

            ContactManifold.Initialize(CollidableA, CollidableB);
            ContactConstraint.Initialize(EntityA, EntityB, this);

            base.Initialize(entryA, entryB);



        }
开发者ID:Anomalous-Software,项目名称:BEPUPhysics,代码行数:17,代码来源:StandardPairHandler.cs


示例11: Initialize

 public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
 {
     base.Initialize(entryA, entryB);
     convex = entryA as ConvexCollidable;
     if (convex == null)
     {
         convex = entryB as ConvexCollidable;
         if (convex == null)
         {
             throw new ArgumentException("Incorrect types passed to pair handler.");
         }
     }
 }
开发者ID:Anomalous-Software,项目名称:BEPUPhysics,代码行数:13,代码来源:DetectorVolumeConvexPairHandler.cs


示例12: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {
            mesh = entryA as InstancedMesh;
            if (mesh == null)
            {
                mesh = entryB as InstancedMesh; 
                if (mesh == null)
                {
                    throw new ArgumentException("Inappropriate types used to initialize pair.");
                }
            }

            base.Initialize(entryA, entryB);
        }
开发者ID:Anomalous-Software,项目名称:BEPUPhysics,代码行数:19,代码来源:CompoundInstancedMeshPairHandler.cs


示例13: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {
            convexInfo = entryA as ConvexCollidable;
            if (convexInfo == null)
            {
                convexInfo = entryB as ConvexCollidable;
                if (convexInfo == null)
                {
                    throw new Exception("Inappropriate types used to initialize pair.");
                }
            }

            base.Initialize(entryA, entryB);
        }
开发者ID:Indiefreaks,项目名称:igf,代码行数:19,代码来源:StaticGroupConvexPairHandler.cs


示例14: Add

        public override void Add(BroadPhaseEntry entry)
        {
            base.Add(entry);
            //binary search for the approximately correct location.  This helps prevent large first-frame sort times.
            //X Axis:
            int minIndex = 0; //inclusive
            int maxIndex = entriesX.Count; //exclusive
            int index = 0;
            while (maxIndex - minIndex > 0)
            {
                index = (maxIndex + minIndex) / 2;
                if (entriesX.Elements[index].boundingBox.Min.X > entry.boundingBox.Min.X)
                    maxIndex = index;
                else if (entriesX.Elements[index].boundingBox.Min.X < entry.boundingBox.Min.X)
                    minIndex = ++index;
                else
                    break; //Found an equal value!
            }
            entriesX.Insert(index, entry);

            //Y Axis:
            minIndex = 0; //inclusive
            maxIndex = entriesY.Count; //exclusive
            while (maxIndex - minIndex > 0)
            {
                index = (maxIndex + minIndex) / 2;
                if (entriesY.Elements[index].boundingBox.Min.Y > entry.boundingBox.Min.Y)
                    maxIndex = index;
                else if (entriesY.Elements[index].boundingBox.Min.Y < entry.boundingBox.Min.Y)
                    minIndex = ++index;
                else
                    break; //Found an equal value!
            }
            entriesY.Insert(index, entry);

            //Z Axis:
            minIndex = 0; //inclusive
            maxIndex = entriesZ.Count; //exclusive
            while (maxIndex - minIndex > 0)
            {
                index = (maxIndex + minIndex) / 2;
                if (entriesZ.Elements[index].boundingBox.Min.Z > entry.boundingBox.Min.Z)
                    maxIndex = index;
                else if (entriesZ.Elements[index].boundingBox.Min.Z < entry.boundingBox.Min.Z)
                    minIndex = ++index;
                else
                    break; //Found an equal value!
            }
            entriesZ.Insert(index, entry);
        }
开发者ID:Indiefreaks,项目名称:igf,代码行数:50,代码来源:SortAndSweep3D.cs


示例15: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {
            //Other member of the pair is initialized by the child.
            staticGroup = entryA as StaticGroup;
            if (staticGroup == null)
            {
                staticGroup = entryB as StaticGroup;
                if (staticGroup == null)
                {
                    throw new Exception("Inappropriate types used to initialize pair.");
                }
            }

            base.Initialize(entryA, entryB);
        }
开发者ID:Indiefreaks,项目名称:igf,代码行数:20,代码来源:StaticGroupPairHandler.cs


示例16: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {
            //Other member of the pair is initialized by the child.
            mobileMesh = entryA as MobileMeshCollidable;
            if (mobileMesh == null)
            {
                mobileMesh = entryB as MobileMeshCollidable;
                if (mobileMesh == null)
                {
                    throw new ArgumentException("Inappropriate types used to initialize pair.");
                }
            }

            base.Initialize(entryA, entryB);
        }
开发者ID:EugenyN,项目名称:BEPUphysicsMG,代码行数:20,代码来源:MobileMeshMeshPairHandler.cs


示例17: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {
            mesh = entryA as MobileMeshCollidable;
            if (mesh == null)
            {
                mesh = entryB as MobileMeshCollidable;
                if (mesh == null)
                {
                    throw new Exception("Inappropriate types used to initialize pair.");
                }
            }


            base.Initialize(entryA, entryB);
        }
开发者ID:Indiefreaks,项目名称:igf,代码行数:20,代码来源:CompoundMobileMeshPairHandler.cs


示例18: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {
            terrain = entryA as Terrain;
            if (terrain == null)
            {

                terrain = entryB as Terrain;
                if (terrain == null)
                {
                    throw new ArgumentException("Inappropriate types used to initialize pair.");
                }
            }

            base.Initialize(entryA, entryB);
        }
开发者ID:EugenyN,项目名称:BEPUphysicsMG,代码行数:20,代码来源:CompoundTerrainPairHandler.cs


示例19: Initialize

        ///<summary>
        /// Initializes the pair handler.
        ///</summary>
        ///<param name="entryA">First entry in the pair.</param>
        ///<param name="entryB">Second entry in the pair.</param>
        public override void Initialize(BroadPhaseEntry entryA, BroadPhaseEntry entryB)
        {
            //Other member of the pair is initialized by the child.
            compoundInfo = entryA as CompoundCollidable;
            if (compoundInfo == null)
            {
                compoundInfo = entryB as CompoundCollidable;
                if (compoundInfo == null)
                {
                    throw new Exception("Inappropriate types used to initialize pair.");
                }
            }

            base.Initialize(entryA, entryB);
        }
开发者ID:Indiefreaks,项目名称:igf,代码行数:20,代码来源:CompoundGroupPairHandler.cs


示例20: Test

        public bool Test(BroadPhaseEntry test)
        {
            // TODO: P2: We want to be able to bash objects and terrain to create dust, decals, sounds, smash crates, etc.
            bool isFoe = false;

            EntityCollidable ec = test as EntityCollidable;
            if (ec != null &&
                ec.Entity != null &&
                ec.Entity.Tag != null)
            {
                int viewedActorId = (int)(ec.Entity.Tag);
                isFoe = mLookForPlayers ? GameResources.ActorManager.IsPlayer(viewedActorId) :
                    GameResources.ActorManager.IsMob(viewedActorId);
            }

            return isFoe;
        }
开发者ID:Tengato,项目名称:Mechadrone1,代码行数:17,代码来源:BashSkill.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BroadPhaseEntries.Collidable类代码示例发布时间:2022-05-24
下一篇:
C# BEPUphysics.Space类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap