本文整理汇总了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);
}
示例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);
}