本文整理汇总了C#中MyStorageDataTypeFlags类的典型用法代码示例。如果您正苦于以下问题:C# MyStorageDataTypeFlags类的具体用法?C# MyStorageDataTypeFlags怎么用?C# MyStorageDataTypeFlags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MyStorageDataTypeFlags类属于命名空间,在下文中一共展示了MyStorageDataTypeFlags类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadRange
void ModAPI.Interfaces.IMyStorage.ReadRange(MyStorageDataCache target, MyStorageDataTypeFlags dataToRead, int lodIndex, Vector3I lodVoxelRangeMin, Vector3I lodVoxelRangeMax)
{
if ((uint)lodIndex >= (uint)MyCellCoord.MAX_LOD_COUNT)
return;
ReadRange(target, dataToRead, lodIndex, ref lodVoxelRangeMin, ref lodVoxelRangeMax);
}
示例2: ReadRange
void VRage.ModAPI.IMyStorage.ReadRange(MyStorageData target, MyStorageDataTypeFlags dataToRead, int lodIndex, Vector3I lodVoxelRangeMin, Vector3I lodVoxelRangeMax, ref MyVoxelRequestFlags requestFlags)
{
if ((uint)lodIndex >= (uint)MyCellCoord.MAX_LOD_COUNT)
return;
ReadRange(target, dataToRead, lodIndex, ref lodVoxelRangeMin, ref lodVoxelRangeMax, ref requestFlags);
}
示例3: VoxelWriteOp
public VoxelWriteOp(string voxelName, string data, MyStorageDataTypeFlags dataToWrite, Vector3I voxelRangeMin, Vector3I voxelRangeMax)
{
m_voxelName = voxelName;
m_data = data;
m_dataType = dataToWrite;
m_voxelMin = voxelRangeMin;
m_voxelMax = voxelRangeMax;
}
示例4: OnRangeChanged
protected internal void OnRangeChanged(Vector3I voxelRangeMin, Vector3I voxelRangeMax, MyStorageDataTypeFlags changedData)
{
if (RangeChanged != null)
{
m_compressedData = null;
this.ClampVoxelCoord(ref voxelRangeMin);
this.ClampVoxelCoord(ref voxelRangeMax);
RangeChanged(voxelRangeMin, voxelRangeMax, changedData);
}
}
示例5: 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();
}
示例6: AssertRangeIsInside
void IMyOctreeLeafNode.ReadRange(MyStorageData target, MyStorageDataTypeFlags types, ref Vector3I writeOffset, int lodIndex, ref Vector3I minInLod, ref Vector3I maxInLod, ref MyVoxelRequestFlags flags)
{
var lodShift = m_cell.Lod - lodIndex;
var leafMinInLod = m_cell.CoordInLod << lodShift;
var min = minInLod + leafMinInLod;
var max = maxInLod + leafMinInLod;
AssertRangeIsInside(lodIndex, ref min, ref max);
ProfilerShort.Begin("MyProviderLeaf.ReadRange");
MyVoxelDataRequest req = new MyVoxelDataRequest() {
Target = target,
Offset = writeOffset,
Lod = lodIndex,
minInLod = min,
maxInLod = max,
RequestFlags = flags,
RequestedData = types
};
m_provider.ReadRange(ref req);
flags = req.Flags;
ProfilerShort.End();
}
示例7: Voxelize
/// <summary>
/// For debugging/testing only! This can be very slow for large storage.
/// </summary>
public void Voxelize(MyStorageDataTypeFlags data)
{
var cache = new MyStorageDataCache();
cache.Resize(new Vector3I(LeafSizeInVoxels));
var leafCount = (Size / LeafSizeInVoxels);
Vector3I leaf = Vector3I.Zero;
var end = leafCount - 1;
for (var it = new Vector3I.RangeIterator(ref Vector3I.Zero, ref end);
it.IsValid();
it.GetNext(out leaf))
{
Debug.WriteLine("Processing {0} / {1}", leaf, end);
var min = leaf * LeafSizeInVoxels;
var max = min + (LeafSizeInVoxels - 1);
ReadRangeInternal(cache, ref Vector3I.Zero, data, 0, ref min, ref max);
WriteRangeInternal(cache, data, ref min, ref max);
}
OnRangeChanged(Vector3I.Zero, Size - 1, data);
}
示例8: WriteRangeInternal
protected abstract void WriteRangeInternal(MyStorageData source, MyStorageDataTypeFlags dataToWrite, ref Vector3I voxelRangeMin, ref Vector3I voxelRangeMax);
示例9: ReadRangeInternal
protected abstract void ReadRangeInternal(MyStorageData target, ref Vector3I targetWriteRange, MyStorageDataTypeFlags dataToRead, int lodIndex, ref Vector3I lodVoxelRangeMin, ref Vector3I lodVoxelRangeMax, ref MyVoxelRequestFlags requestFlags);
示例10: WriteRange
void VRage.ModAPI.IMyStorage.WriteRange(MyStorageData source, MyStorageDataTypeFlags dataToWrite, Vector3I voxelRangeMin, Vector3I voxelRangeMax)
{
WriteRange(source, dataToWrite, ref voxelRangeMin, ref voxelRangeMax);
}
示例11: ResetInternal
protected abstract void ResetInternal(MyStorageDataTypeFlags dataToReset);
示例12: 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++;
}
示例13: GetChunk
private void GetChunk(ref Vector3I coord, out VoxelChunk chunk, MyStorageDataTypeFlags required)
{
using (m_cacheLock.AcquireExclusiveUsing())
{
if (!m_cachedChunks.TryGetValue(coord, out chunk))
{
chunk = new VoxelChunk(coord);
var rangeStart = coord << VoxelChunk.SizeBits;
var rangeEnd = ((coord + 1) << VoxelChunk.SizeBits) - 1;
if (required != 0)
{
using (m_storageLock.AcquireSharedUsing())
ReadDatForChunk(chunk, required);
}
m_chunksbyAge.Enqueue(coord);
m_cachedChunks.Add(coord, chunk);
var bb = new BoundingBox(rangeStart, rangeEnd);
chunk.TreeProxy = m_cacheMap.AddProxy(ref bb, chunk, 0);
}
else if ((chunk.Cached & required) != required)
{
using (m_storageLock.AcquireSharedUsing())
ReadDatForChunk(chunk, required & ~chunk.Cached);
}
}
}
示例14: storage_RangeChangedPlanet
private void storage_RangeChangedPlanet(Vector3I minChanged, Vector3I maxChanged, MyStorageDataTypeFlags dataChanged)
{
ProfilerShort.Begin("MyVoxelMap::storage_RangeChanged");
Vector3I minSector = minChanged / PHYSICS_SECTOR_SIZE_METERS;
Vector3I maxSector = maxChanged/PHYSICS_SECTOR_SIZE_METERS;
Vector3I increment = m_storage.Size / (m_numCells+1);
for (var it = new Vector3I.RangeIterator(ref minSector, ref maxSector);
it.IsValid(); it.MoveNext())
{
MyVoxelPhysics voxelMap = CreatePhysicsShape(ref increment, ref it);
voxelMap.OnStorageChanged(minChanged, maxChanged, dataChanged);
}
if (Render is MyRenderComponentVoxelMap)
{
(Render as MyRenderComponentVoxelMap).InvalidateRange(minChanged, maxChanged);
}
ProfilerShort.End();
}
示例15: storage_RangeChanged
/// <param name="minVoxelChanged">Inclusive min.</param>
/// <param name="maxVoxelChanged">Inclusive max.</param>
private void storage_RangeChanged(Vector3I minChanged, Vector3I maxChanged, MyStorageDataTypeFlags changedData)
{
MyPrecalcComponent.AssertUpdateThread();
ProfilerShort.Begin("MyVoxelGeometry.storage_RangeChanged");
minChanged -= MyPrecalcComponent.InvalidatedRangeInflate;
maxChanged += MyPrecalcComponent.InvalidatedRangeInflate;
m_storage.ClampVoxelCoord(ref minChanged);
m_storage.ClampVoxelCoord(ref maxChanged);
var minCellChanged = minChanged >> MyVoxelConstants.GEOMETRY_CELL_SIZE_IN_VOXELS_BITS;
var maxCellChanged = maxChanged >> MyVoxelConstants.GEOMETRY_CELL_SIZE_IN_VOXELS_BITS;
using (m_lock.AcquireExclusiveUsing())
{
if (minCellChanged == Vector3I.Zero && maxCellChanged == m_cellsCount - 1)
{
m_cellsByCoordinate.Clear();
m_coordinateToMesh.Clear();
m_isEmptyCache.Reset();
}
else
{
MyCellCoord cell = new MyCellCoord();
cell.CoordInLod = minCellChanged;
for (var it = new Vector3I_RangeIterator(ref minCellChanged, ref maxCellChanged); it.IsValid(); it.GetNext(out cell.CoordInLod))
{
var key = cell.PackId64();
m_cellsByCoordinate.Remove(key);
m_coordinateToMesh.Remove(key);
SetEmpty(ref cell, false);
}
}
}
ProfilerShort.End();
}