本文整理汇总了C#中Vector3.IsBetween方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.IsBetween方法的具体用法?C# Vector3.IsBetween怎么用?C# Vector3.IsBetween使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3
的用法示例。
在下文中一共展示了Vector3.IsBetween方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsPointIn
public bool IsPointIn(Vector3 dot)
{
return dot.IsBetween(BBMin, BBMax);
}
示例2: FindPosCogerrence
public static Room FindPosCogerrence(Vector3 newPos, Room room)
{
if(room == null)
{
return EngineWorld.FindRoomByPosition(newPos);
}
if (room.Active && newPos.X.IsBetween(room.BBMin.X, room.BBMax.X, IB.aIbE) &&
newPos.Y.IsBetween(room.BBMin.Y, room.BBMax.Y, IB.aIbE))
{
if(newPos.Z.IsBetween(room.BBMin.Z, room.BBMax.Z, IB.aIbE))
{
return room;
}
else if(newPos.Z >= room.BBMax.Z)
{
var origSector = room.GetSectorRaw(newPos);
if(origSector.SectorAbove != null)
{
return origSector.SectorAbove.OwnerRoom.CheckFlip();
}
}
else if (newPos.Z < room.BBMin.Z)
{
var origSector = room.GetSectorRaw(newPos);
if (origSector.SectorBelow != null)
{
return origSector.SectorBelow.OwnerRoom.CheckFlip();
}
}
}
var newSector = room.GetSectorRaw(newPos);
if(newSector != null && newSector.PortalToRoom >= 0)
{
return EngineWorld.Rooms[newSector.PortalToRoom].CheckFlip();
}
foreach (var r in room.NearRoomList)
{
if(r.Active && newPos.IsBetween(r.BBMin, r.BBMax, IB.aIbE))
{
return r;
}
}
return EngineWorld.FindRoomByPosition(newPos);
}
示例3: FindRoomByPosition
public Room FindRoomByPosition(Vector3 pos)
{
return Rooms.FirstOrDefault(r => r.Active && pos.IsBetween(r.BBMin, r.BBMax, IB.aIbE));
}