本文整理汇总了C#中Vector3I.IsInsideInclusive方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3I.IsInsideInclusive方法的具体用法?C# Vector3I.IsInsideInclusive怎么用?C# Vector3I.IsInsideInclusive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3I
的用法示例。
在下文中一共展示了Vector3I.IsInsideInclusive方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssertRangeIsInside
private void AssertRangeIsInside(int lodIndex, ref Vector3I globalMin, ref Vector3I globalMax)
{
var leafMinInLod = m_leafMin >> lodIndex;
var leafMaxInLod = m_leafMax >> lodIndex;
Debug.Assert(globalMin.IsInsideInclusive(ref leafMinInLod, ref leafMaxInLod));
Debug.Assert(globalMax.IsInsideInclusive(ref leafMinInLod, ref leafMaxInLod));
}
示例2: AssertRangeIsInside
private void AssertRangeIsInside(int lodIndex, ref Vector3I globalMin, ref Vector3I globalMax)
{
Debug.Assert(m_cell.Lod >= lodIndex);
var lodShift = m_cell.Lod - lodIndex;
var lodSize = 1 << lodShift;
var leafMinInLod = m_cell.CoordInLod << lodShift;
var leafMaxInLod = leafMinInLod + (lodSize - 1);
Debug.Assert(globalMin.IsInsideInclusive(ref leafMinInLod, ref leafMaxInLod));
Debug.Assert(globalMax.IsInsideInclusive(ref leafMinInLod, ref leafMaxInLod));
}
示例3: OnStorageChanged
public void OnStorageChanged(Vector3I minChanged, Vector3I maxChanged, MyStorageDataTypeFlags dataChanged)
{
ProfilerShort.Begin("MyVoxelMap::storage_RangeChanged");
minChanged = Vector3I.Clamp(minChanged, m_storageMin, m_storageMax);
maxChanged = Vector3I.Clamp(maxChanged, m_storageMin, m_storageMax);
Debug.Assert(minChanged.IsInsideInclusive(ref m_storageMin, ref m_storageMax) &&
maxChanged.IsInsideInclusive(ref m_storageMin, ref m_storageMax));
// Physics doesn't care about materials, just shape of things.
if ((dataChanged & MyStorageDataTypeFlags.Content) != 0 &&
Physics != null)
{
Physics.InvalidateRange(minChanged, maxChanged);
}
ProfilerShort.End();
}
示例4: ReadLod
public void ReadLod(MyStorageData target, MyStorageDataTypeFlags dataTypes, ref Vector3I targetOffset, int lodIndex, ref Vector3I min, ref Vector3I max)
{
Debug.Assert(min.IsInsideInclusive(Vector3I.Zero, MaxVector >> lodIndex)
&& max.IsInsideInclusive(Vector3I.Zero, MaxVector >> lodIndex));
//using (Lock.AcquireSharedUsing())
{
if (lodIndex > MaxLod)
UpdateLodData(lodIndex);
if (dataTypes.Requests(MyStorageDataTypeEnum.Content))
{
ReadLod(target, MyStorageDataTypeEnum.Content, Content, targetOffset, lodIndex, min, max);
}
if (dataTypes.Requests(MyStorageDataTypeEnum.Material))
{
ReadLod(target, MyStorageDataTypeEnum.Material, Material, targetOffset, lodIndex, min, max);
}
}
HitCount++;
}
示例5: GetDivideIndex
private int GetDivideIndex(ref Vector3I renderCellCoord)
{
// TODO: Optimize
int divideIndex = 0;
if (m_lodDivisions > 1)
{
BoundingBoxD lodAabb = m_boundingBoxes.GetAabb(m_boundingBoxes.GetRoot());
Vector3I test = Vector3I.Round(lodAabb.Size / (double)MyVoxelCoordSystems.RenderCellSizeInMeters(m_lod));
//Vector3I lodSizeMinusOne = m_parentClipmap.LodSizeMinusOne(m_lod);
//Vector3I lodSize = lodSizeMinusOne + Vector3I.One;
Vector3I lodSize = test;
Vector3I lodSizeMinusOne = test - 1;
Vector3I lodDivision = Vector3I.One * (m_lodDivisions - 1);
var cellIterator = new Vector3I.RangeIterator(ref Vector3I.Zero, ref lodDivision);
for (; cellIterator.IsValid(); cellIterator.MoveNext())
{
Vector3I currentDivision = cellIterator.Current;
Vector3I min = currentDivision * lodSize / m_lodDivisions;
Vector3I max = (currentDivision + Vector3I.One) * lodSize / m_lodDivisions;
if (renderCellCoord.IsInsideInclusive(ref min, ref max))
break;
}
Debug.Assert(cellIterator.IsValid(), "Valid division index not found!");
Vector3I foundCell = cellIterator.Current;
divideIndex = GetDivideIndexFromMergeCell(ref foundCell);
}
return divideIndex;
}
示例6: storage_RangeChanged
/// <summary>
/// Invalidates voxel cache
/// </summary>
/// <param name="minChanged">Inclusive min</param>
/// <param name="maxChanged">Inclusive max</param>
private void storage_RangeChanged(Vector3I minChanged, Vector3I maxChanged, MyStorageDataTypeFlags dataChanged)
{
ProfilerShort.Begin("MyVoxelMap::storage_RangeChanged");
Debug.Assert(minChanged.IsInsideInclusive(ref m_storageMin, ref m_storageMax) &&
maxChanged.IsInsideInclusive(ref m_storageMin, ref m_storageMax));
// Physics doesn't care about materials, just shape of things.
if ((dataChanged & MyStorageDataTypeFlags.Content) != 0 &&
Physics != null)
{
Physics.InvalidateRange(minChanged, maxChanged);
}
if (Render is MyRenderComponentVoxelMap)
{
(Render as MyRenderComponentVoxelMap).InvalidateRange(minChanged, maxChanged);
}
ContentChanged = true;
ProfilerShort.End();
}