Main Page Class List Class Members

NvBlastExtAuthoringPatternGenerator.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2016-2020 NVIDIA Corporation. All rights reserved.
27
28
29 #ifndef NVBLASTEXTAUTHORINGPATTERNGENERATOR_H
30 #define NVBLASTEXTAUTHORINGPATTERNGENERATOR_H
31
32 #include "NvBlastGlobals.h"
33
34 namespace Nv
35 {
36 namespace Blast
37 {
38 typedef float (*RNG_CALLBACK)(void);
39
40 struct PatternDescriptor
41 {
42 RNG_CALLBACK RNG = nullptr;
43
44 uint32_t interiorMaterialId = 1000;
45 };
46
47 struct UniformPatternDesc : public PatternDescriptor
48 {
49 uint32_t cellsCount = 2;
50
51 float radiusMin = 0.0f;
52 float radiusMax = 1.0f;
53 float radiusDistr = 1.0f;
54
55 float debrisRadiusMult = 1.0f;
56 };
57
58 struct BeamPatternDesc : public PatternDescriptor
59 {
60 uint32_t cellsCount;
61
62 float radiusMin;
63 float radiusMax;
64 };
65
66 struct RegularRadialPatternDesc : public PatternDescriptor
67 {
68 float radiusMin = 0.0f;
69 float radiusMax = 1.0f;
70
71 uint32_t radialSteps = 3;
72 uint32_t angularSteps = 8;
73
74 float aperture = .0f;
75
76 float angularNoiseAmplitude = 0.0f;
77
78 float radialNoiseAmplitude = 0.0f;
79 float radialNoiseFrequency = 0.0f;
80
81 float debrisRadiusMult = 1.0f;
82 };
83
84
85 struct DamagePattern
86 {
90 float activationRadius;
91 float angle; // For cone shape activation
92 enum ActivationDistanceType
93 {
94 Point = 0,
95 Line,
96 Cone
97 };
98 ActivationDistanceType activationType = Point;
99 // ----------------------------------------------
100
101
102 uint32_t cellsCount;
103 class Mesh** cellsMeshes = nullptr;
104
105 virtual void release() = 0;
106 };
107
108 class PatternGenerator
109 {
110 public:
111 virtual DamagePattern* generateUniformPattern(const UniformPatternDesc* desc) = 0;
112 virtual DamagePattern* generateBeamPattern(const BeamPatternDesc* desc) = 0;
113 virtual DamagePattern* generateRegularRadialPattern(const RegularRadialPatternDesc* desc) = 0;
114
115
116 virtual DamagePattern* generateVoronoiPattern(uint32_t pointCount, const NvcVec3* points, int32_t interiorMaterialId) = 0;
117 virtual void release() = 0;
118 };
119
120 NVBLAST_API void savePatternToObj(DamagePattern* pattern);
121
122 } // namespace Blast
123 } // namespace Nv
124
125
126 #endif // ifndef NVBLASTEXTAUTHORINGMESHCLEANER_H
Nv::Blast::savePatternToObj
NVBLAST_API void savePatternToObj(DamagePattern *pattern)
Nv::Blast::BeamPatternDesc::radiusMax
float radiusMax
Definition: NvBlastExtAuthoringPatternGenerator.h:63
Nv::Blast::UniformPatternDesc
Definition: NvBlastExtAuthoringPatternGenerator.h:47
Nv::Blast::BeamPatternDesc::radiusMin
float radiusMin
Definition: NvBlastExtAuthoringPatternGenerator.h:62
Nv::Blast::BeamPatternDesc::cellsCount
uint32_t cellsCount
Definition: NvBlastExtAuthoringPatternGenerator.h:60
Nv::Blast::Mesh
Definition: NvBlastExtAuthoringMesh.h:42
NvBlastGlobals.h
Nv::Blast::RegularRadialPatternDesc
Definition: NvBlastExtAuthoringPatternGenerator.h:66
Nv::Blast::PatternDescriptor::RNG
RNG_CALLBACK RNG
Definition: NvBlastExtAuthoringPatternGenerator.h:42
Nv::Blast::BeamPatternDesc
Definition: NvBlastExtAuthoringPatternGenerator.h:58
Nv::Blast::DamagePattern
Definition: NvBlastExtAuthoringPatternGenerator.h:85
Nv::Blast::DamagePattern::activationRadius
float activationRadius
Definition: NvBlastExtAuthoringPatternGenerator.h:90
Nv::Blast::DamagePattern::Line
Definition: NvBlastExtAuthoringPatternGenerator.h:95
NVBLAST_API
#define NVBLAST_API
Definition: NvBlastPreprocessor.h:37
Nv::Blast::PatternGenerator
Definition: NvBlastExtAuthoringPatternGenerator.h:108
Nv::Blast::DamagePattern::ActivationDistanceType
ActivationDistanceType
Definition: NvBlastExtAuthoringPatternGenerator.h:92
Nv::Blast::DamagePattern::angle
float angle
Definition: NvBlastExtAuthoringPatternGenerator.h:91
Nv::Blast::PatternDescriptor::interiorMaterialId
uint32_t interiorMaterialId
Definition: NvBlastExtAuthoringPatternGenerator.h:44
Nv
Definition: NvBlastArray.h:37
NvcVec3
Definition: NvCTypes.h:49
Nv::Blast::PatternDescriptor
Definition: NvBlastExtAuthoringPatternGenerator.h:40
Nv::Blast::RNG_CALLBACK
float(* RNG_CALLBACK)(void)
Definition: NvBlastExtAuthoringPatternGenerator.h:38
Nv::Blast::DamagePattern::cellsCount
uint32_t cellsCount
Definition: NvBlastExtAuthoringPatternGenerator.h:102