29 #ifndef NVBLASTEXTDAMAGESHADERS_H 30 #define NVBLASTEXTDAMAGESHADERS_H 76 : damageDesc(desc), material(material_), accelerator(accelerator_) {}
114 const float damage = health > 0.f ? damageInHealth / health : 1.0f;
115 return damage > minDamageThreshold ? (damage < maxDamageThreshold ? damage : maxDamageThreshold) : 0.f;
277 #endif // NVBLASTEXTDAMAGESHADERS_H void NvBlastExtImpactSpreadSubgraphShader(NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *params)
NvBlastExtProgramParams(const void *desc, const void *material_=nullptr, NvBlastExtDamageAccelerator *accelerator_=nullptr)
Definition: NvBlastExtDamageShaders.h:75
void NvBlastExtCapsuleFalloffSubgraphShader(NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *params)
Definition: NvBlastTypes.h:491
float minDamageThreshold
min damage fraction threshold to be applied. Range [0, 1]. For example 0.1 filters all damage below 1...
Definition: NvBlastExtDamageShaders.h:99
float damage
normalized damage amount, range: [0, 1] (maximum health value to be reduced)
Definition: NvBlastExtDamageShaders.h:216
Definition: NvBlastExtDamageShaders.h:185
Definition: NvBlastExtDamageShaders.h:155
void NvBlastExtShearGraphShader(NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *params)
void NvBlastExtFalloffSubgraphShader(NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *params)
Definition: NvBlastDebugRender.h:56
Definition: NvBlastExtDamageShaders.h:73
float maxRadius
outer radius of damage action
Definition: NvBlastExtDamageShaders.h:132
const void * material
pointer to material
Definition: NvBlastExtDamageShaders.h:79
void NvBlastExtCapsuleFalloffGraphShader(NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *params)
NvBlastExtDamageAccelerator * NvBlastExtDamageAcceleratorCreate(const NvBlastAsset *asset, int type)
NvcVec3 position1
triangle point B position
Definition: NvBlastExtDamageShaders.h:218
void NvBlastExtFalloffGraphShader(NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *params)
float minRadius
inner radius of damage action
Definition: NvBlastExtDamageShaders.h:131
Definition: NvBlastExtDamageShaders.h:247
float minRadius
inner radius of damage action
Definition: NvBlastExtDamageShaders.h:192
void NvBlastExtTriangleIntersectionSubgraphShader(NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *params)
float maxDamageThreshold
max damage fraction threshold to be applied. Range [0, 1]. For example 0.8 won't allow more then 80% ...
Definition: NvBlastExtDamageShaders.h:100
float getNormalizedDamage(float damageInHealth) const
Definition: NvBlastExtDamageShaders.h:112
Definition: NvBlastExtDamageShaders.h:45
Definition: NvBlastExtDamageShaders.h:127
void NvBlastExtShearSubgraphShader(NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *params)
float maxRadius
outer radius of damage action
Definition: NvBlastExtDamageShaders.h:253
Definition: NvBlastExtDamageShaders.h:214
NvBlastExtDamageAccelerator * accelerator
Definition: NvBlastExtDamageShaders.h:80
#define NVBLAST_API
Definition: NvBlastPreprocessor.h:37
void NvBlastExtImpactSpreadGraphShader(NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *params)
float damage
normalized damage amount, range: [0, 1] (maximum health value to be reduced)
Definition: NvBlastExtDamageShaders.h:187
float minRadius
inner radius of damage action
Definition: NvBlastExtDamageShaders.h:160
float damage
normalized damage amount, range: [0, 1] (maximum health value to be reduced)
Definition: NvBlastExtDamageShaders.h:129
NvcVec3 position0
triangle point A position
Definition: NvBlastExtDamageShaders.h:217
float maxRadius
outer radius of damage action
Definition: NvBlastExtDamageShaders.h:193
float damage
normalized damage amount, range: [0, 1] (maximum health value to be reduced)
Definition: NvBlastExtDamageShaders.h:249
const void * damageDesc
array of damage descriptions
Definition: NvBlastExtDamageShaders.h:78
float minRadius
inner radius of damage action
Definition: NvBlastExtDamageShaders.h:252
NvcVec3 position2
triangle point C position
Definition: NvBlastExtDamageShaders.h:219
void NvBlastExtCutterGraphShader(NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *params)
Definition: NvBlastTypes.h:286
Definition: NvBlastTypes.h:468
float maxRadius
outer radius of damage action
Definition: NvBlastExtDamageShaders.h:161
Definition: NvBlastTypes.h:513
virtual Nv::Blast::DebugBuffer fillDebugRender(int depth=-1, bool segments=false)=0
NvBlastExtMaterial()
Definition: NvBlastExtDamageShaders.h:96
float health
health
Definition: NvBlastExtDamageShaders.h:98
void NvBlastExtTriangleIntersectionGraphShader(NvBlastFractureBuffers *commandBuffers, const NvBlastGraphShaderActor *actor, const void *params)
float damage
normalized damage amount, range: [0, 1] (maximum health value to be reduced)
Definition: NvBlastExtDamageShaders.h:157
Definition: NvCTypes.h:49
void NvBlastExtCutterSubgraphShader(NvBlastFractureBuffers *commandBuffers, const NvBlastSubgraphShaderActor *actor, const void *params)
Definition: NvBlastExtDamageShaders.h:94