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


C# EntityCollidable.UpdateBoundingBoxForTransform方法代码示例

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


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

示例1: PrepareQueryObject

 private void PrepareQueryObject(EntityCollidable queryObject, ref Vector3 position)
 {
     RigidTransform transform;
     transform.Position = position;
     transform.Orientation = characterBody.Orientation;
     queryObject.UpdateBoundingBoxForTransform(ref transform, 0);
 }
开发者ID:EugenyN,项目名称:BEPUphysicsMG,代码行数:7,代码来源:StanceManager.cs

示例2: QueryContacts

        void QueryContacts(Vector3 position, EntityCollidable queryObject)
        {
            ClearContacts();

            //Update the position and orientation of the query object.
            RigidTransform transform;
            transform.Position = position;
            transform.Orientation = character.Body.Orientation;
            queryObject.UpdateBoundingBoxForTransform(ref transform, 0);

            foreach (var collidable in character.Body.CollisionInformation.OverlappedCollidables)
            {
                if (collidable.BoundingBox.Intersects(queryObject.BoundingBox))
                {
                    var pair = new CollidablePair(collidable, queryObject);
                    var pairHandler = NarrowPhaseHelper.GetPairHandler(ref pair);
                    if (pairHandler.CollisionRule == CollisionRule.Normal)
                    {
                        pairHandler.SuppressEvents = true;
                        pairHandler.UpdateCollision(0);
                        pairHandler.SuppressEvents = false;
                        foreach (var contact in pairHandler.Contacts)
                        {
                            //Must check per-contact collision rules, just in case
                            //the pair was actually a 'parent pair.'
                            if (contact.Pair.CollisionRule == CollisionRule.Normal)
                            {
                                ContactData contactData;
                                contactData.Position = contact.Contact.Position;
                                contactData.Normal = contact.Contact.Normal;
                                contactData.Id = contact.Contact.Id;
                                contactData.PenetrationDepth = contact.Contact.PenetrationDepth;
                                contacts.Add(contactData);
                            }
                        }
                    }
                    //TODO: It would be nice if this was a bit easier.
                    //Having to remember to clean up AND give it back is a bit weird, especially with the property-diving.
                    //No one would ever just guess this correctly.
                    //At least hide it behind a NarrowPhaseHelper function.
                    pairHandler.CleanUp();
                    pairHandler.Factory.GiveBack(pairHandler);
                }
            }

            CategorizeContacts(ref position);
        }
开发者ID:karrtmomil,项目名称:coms437_assignment2,代码行数:47,代码来源:QueryManager.cs


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