aboutsummaryrefslogtreecommitdiff
path: root/examples/UnityExample/Assets/Plugins/Blast/NvBlastExtShadersWrapper.cs
diff options
context:
space:
mode:
authorWISH\AndyBuchanan <[email protected]>2018-08-14 16:06:02 +0100
committerWISH\AndyBuchanan <[email protected]>2018-08-14 16:06:02 +0100
commit4bced2d73f61b440f81b3dff68e66cad5787d64d (patch)
treefd14e7b7bddc70868ebd2e8c6178d0183a40b1a9 /examples/UnityExample/Assets/Plugins/Blast/NvBlastExtShadersWrapper.cs
parentFixing line endings in buildtools/packman5/packman (diff)
downloadblast-4bced2d73f61b440f81b3dff68e66cad5787d64d.tar.xz
blast-4bced2d73f61b440f81b3dff68e66cad5787d64d.zip
Fixes to UnitySample to make it build & run. ( In Unity 2018.2 )
Diffstat (limited to 'examples/UnityExample/Assets/Plugins/Blast/NvBlastExtShadersWrapper.cs')
-rwxr-xr-xexamples/UnityExample/Assets/Plugins/Blast/NvBlastExtShadersWrapper.cs27
1 files changed, 12 insertions, 15 deletions
diff --git a/examples/UnityExample/Assets/Plugins/Blast/NvBlastExtShadersWrapper.cs b/examples/UnityExample/Assets/Plugins/Blast/NvBlastExtShadersWrapper.cs
index 21e208c..7b4c5d1 100755
--- a/examples/UnityExample/Assets/Plugins/Blast/NvBlastExtShadersWrapper.cs
+++ b/examples/UnityExample/Assets/Plugins/Blast/NvBlastExtShadersWrapper.cs
@@ -7,36 +7,33 @@ using UnityEngine;
[StructLayout(LayoutKind.Sequential)]
public class NvBlastExtRadialDamageDesc
{
- public float compressive; //!< compressive (radial) damage component
+ public float damage; //!< normalized damage amount, range: [0, 1] (maximum health value to be reduced)
public float p0;
public float p1;
public float p2;
- public float minRadius; //!< inner radius of damage action
+ public float minRadius; //!< inner radius of damage action
public float maxRadius; //!< outer radius of damage action
};
[StructLayout(LayoutKind.Sequential)]
public class NvBlastExtMaterial
{
- public float singleChunkThreshold; //!< subsupport chunks only take damage surpassing this value
- public float graphChunkThreshold; //!< support chunks only take damage surpassing this value
- public float bondTangentialThreshold; //!< bond only take damage surpassing this value
- public float bondNormalThreshold; //!< currently unused - forward damage propagation
- public float damageAttenuation; //!< factor of damage attenuation while forwarding
+ public float health; //!< health
+ public float minDamageThreshold; //!< min damage fraction threshold to be applied. Range [0, 1]. For example 0.1 filters all damage below 10% of health.
+ public float maxDamageThreshold; //!< max damage fraction threshold to be applied. Range [0, 1]. For example 0.8 won't allow more then 80% of health damage to be applied.
};
-
public static class NvBlastExtShadersWrapper
{
public const string DLL_NAME = "NvBlastExtShaders" + NvBlastWrapper.DLL_POSTFIX + "_" + NvBlastWrapper.DLL_PLATFORM;
#region Dll
[DllImport(DLL_NAME)]
- private static extern bool NvBlastExtDamageActorRadialFalloff(IntPtr actor, NvBlastFractureBuffers buffers, NvBlastExtRadialDamageDesc damageDescBuffer, UInt32 damageDescCount, NvBlastExtMaterial material, NvBlastWrapper.NvBlastLog logFn, NvBlastTimers timers);
- #endregion
+ public static extern void NvBlastExtFalloffGraphShader( NvBlastFractureBuffers buffers, NvBlastGraphShaderActor actor, NvBlastExtProgramParams p ); // System.IntPtr xparams
+
+ [DllImport(DLL_NAME)]
+ public static extern void NvBlastExtFalloffSubgraphShader( NvBlastFractureBuffers buffers, NvBlastSubgraphShaderActor actor, NvBlastExtProgramParams p ); // NvBlastExtProgramParams
+ #endregion
+
+}
- public static bool DamageRadialFalloff(this NvBlastActor actor, NvBlastFractureBuffers buffers, NvBlastExtRadialDamageDesc damageDescBuffer, UInt32 damageDescCount, NvBlastExtMaterial material)
- {
- return NvBlastExtDamageActorRadialFalloff(actor.ptr, buffers, damageDescBuffer, damageDescCount, material, NvBlastWrapper.Log, null);
- }
-} \ No newline at end of file