Exemplo n.º 1
0
    public NvBlastActor(NvBlastFamily family_, NvBlastActorDesc desc)
    {
        family = family_;

        var scratchSize = NvBlastFamilyGetRequiredScratchForCreateFirstActor(family.ptr, NvBlastWrapper.Log);
        var actor       = NvBlastFamilyCreateFirstActor(family.ptr, desc, NvBlastWrapper.GetScratch((int)scratchSize), NvBlastWrapper.Log);

        Initialize(actor);
    }
Exemplo n.º 2
0
    public NvBlastAsset(NvBlastAssetDesc desc)
    {
        var    scratchSize = NvBlastGetRequiredScratchForCreateAsset(desc, NvBlastWrapper.Log);
        var    assetSize   = NvBlastGetAssetMemorySize(desc, NvBlastWrapper.Log);
        IntPtr mem         = NvBlastWrapper.Alloc((long)assetSize);
        var    asset       = NvBlastCreateAsset(mem, desc, NvBlastWrapper.GetScratch((int)scratchSize), NvBlastWrapper.Log);

        Initialize(asset);
    }
Exemplo n.º 3
0
    public NvBlastFamily(NvBlastAsset asset_)
    {
        var    memSize = NvBlastAssetGetFamilyMemorySize(asset_.ptr, NvBlastWrapper.Log);
        IntPtr mem     = NvBlastWrapper.Alloc((long)memSize);

        asset = asset_;
        var family = NvBlastAssetCreateFamily(mem, asset.ptr, NvBlastWrapper.Log);

        Initialize(family);
    }
Exemplo n.º 4
0
    public UInt32 Split(NvBlastActorSplitEvent result, UInt32 newActorsMaxCount)
    {
        var    scratchSize    = NvBlastActorGetRequiredScratchForSplit(ptr, NvBlastWrapper.Log);
        UInt32 newActorsCount = NvBlastActorSplit(result, ptr, newActorsMaxCount, NvBlastWrapper.GetScratch((int)scratchSize), NvBlastWrapper.Log, null);

        if (result.deletedActor != IntPtr.Zero)
        {
            ResetPtr();
        }
        return(newActorsCount);
    }
 public static void ReorderAssetDescChunks(NvBlastAssetDesc assetDesc, uint[] chunkReorderMap)
 {
     System.IntPtr scratchPtr = NvBlastWrapper.GetScratch((int)(assetDesc.chunkCount * Marshal.SizeOf(typeof(NvBlastChunkDesc))));
     NvBlastReorderAssetDescChunks(assetDesc.chunkDescs, assetDesc.chunkCount, assetDesc.bondDescs, assetDesc.bondCount, chunkReorderMap, true, scratchPtr, System.UIntPtr.Zero);
 }