RavEngine
Loading...
Searching...
No Matches
PxMPMMaterial.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29#ifndef PX_MPM_MATERIAL_H
30#define PX_MPM_MATERIAL_H
35#include "PxParticleMaterial.h"
36
37#if !PX_DOXYGEN
38namespace physx
39{
40#endif
41
46 {
47 enum Enum
48 {
49 eATTACHED = 1 << 0,
50 eNEO_HOOKEAN = 1 << 1,
51 eELASTIC = 1 << 2,
52 eSNOW = 1 << 3,
53 eSAND = 1 << 4,
54 eVON_MISES = 1 << 5
55 };
56 };
57
62 {
63 enum Enum
64 {
66 eSTICKY = 1 << 0,
67 eSLIPPERY = 1 << 1
68 };
69 };
70
75 {
76 enum Enum
77 {
78 eNONE = 0,
81 };
82 };
83 typedef PxFlags<PxMPMCuttingFlag::Enum,PxU16> PxMPMCuttingFlags;
84 PX_FLAGS_OPERATORS(PxMPMCuttingFlag::Enum,PxU16)
85
86 class PxScene;
87
94 {
95 public:
103 virtual void setStretchAndShearDamping(PxReal stretchAndShearDamping) = 0;
104
112 virtual PxReal getStretchAndShearDamping() const = 0;
113
114
122 virtual void setRotationalDamping(PxReal rotationalDamping) = 0;
123
131 virtual PxReal getRotationalDamping() const = 0;
132
133
141 virtual void setDensity(PxReal density) = 0;
142
150 virtual PxReal getDensity() const = 0;
151
152
160 virtual void setMaterialModel(PxMPMMaterialModel::Enum materialModel) = 0;
161
170
171
179 virtual void setCuttingFlags(PxMPMCuttingFlags cuttingFlags) = 0;
180
189
190
198 virtual void setSandFrictionAngle(PxReal sandFrictionAngle) = 0;
199
207 virtual PxReal getSandFrictionAngle() const = 0;
208
209
217 virtual void setYieldStress(PxReal yieldStress) = 0;
218
219
227 virtual PxReal getYieldStress() const = 0;
228
229
237 virtual void setIsPlastic(bool isPlastic) = 0;
238
246 virtual bool getIsPlastic() const = 0;
247
255 virtual void setYoungsModulus(PxReal young) = 0;
256
264 virtual PxReal getYoungsModulus() const = 0;
265
273 virtual void setPoissons(PxReal poisson) = 0;
274
281 virtual PxReal getPoissons() const = 0;
282
292 virtual void setHardening(PxReal hardening) = 0;
293
301 virtual PxReal getHardening() const = 0;
302
312 virtual void setCriticalCompression(PxReal criticalCompression) = 0;
313
321 virtual PxReal getCriticalCompression() const = 0;
322
332 virtual void setCriticalStretch(PxReal criticalStretch) = 0;
333
341 virtual PxReal getCriticalStretch() const = 0;
342
352 virtual void setTensileDamageSensitivity(PxReal tensileDamageSensitivity) = 0;
353
361 virtual PxReal getTensileDamageSensitivity() const = 0;
362
372 virtual void setCompressiveDamageSensitivity(PxReal compressiveDamageSensitivity) = 0;
373
381 virtual PxReal getCompressiveDamageSensitivity() const = 0;
382
392 virtual void setAttractiveForceResidual(PxReal attractiveForceResidual) = 0;
393
400 virtual PxReal getAttractiveForceResidual() const = 0;
401
402 virtual const char* getConcreteTypeName() const { return "PxMPMMaterial"; }
403
404 protected:
405 PX_INLINE PxMPMMaterial(PxType concreteType, PxBaseFlags baseFlags) : PxParticleMaterial(concreteType, baseFlags) {}
406 PX_INLINE PxMPMMaterial(PxBaseFlags baseFlags) : PxParticleMaterial(baseFlags) {}
407 virtual ~PxMPMMaterial() {}
408 virtual bool isKindOf(const char* name) const { return !::strcmp("PxMPMMaterial", name) || PxParticleMaterial::isKindOf(name); }
409 };
410
411#if !PX_DOXYGEN
412} // namespace physx
413#endif
414
416#endif
Material class to represent a set of MPM particle material properties.
Definition PxMPMMaterial.h:94
virtual PxReal getYieldStress() const =0
Retrieves the yield stress.
virtual PxReal getCriticalCompression() const =0
Retrieves the critical compression coefficient.
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition PxMPMMaterial.h:408
virtual PxReal getYoungsModulus() const =0
Retrieves the Young's modulus value.
virtual PxReal getHardening() const =0
Retrieves the hardening coefficient.
virtual void setStretchAndShearDamping(PxReal stretchAndShearDamping)=0
Sets stretch and shear damping which dampens stretch and shear motion of MPM bodies....
virtual void setHardening(PxReal hardening)=0
Sets material hardening coefficient.
virtual void setCriticalCompression(PxReal criticalCompression)=0
Sets material critical compression coefficient.
virtual void setCompressiveDamageSensitivity(PxReal compressiveDamageSensitivity)=0
Sets material compressive damage sensitivity coefficient.
virtual PxReal getPoissons() const =0
Retrieves the Poisson's ratio.
virtual void setTensileDamageSensitivity(PxReal tensileDamageSensitivity)=0
Sets material tensile damage sensitivity coefficient.
virtual void setPoissons(PxReal poisson)=0
Sets Poisson's ratio defines the body's volume preservation. Completely incompressible materials have...
virtual PxReal getCriticalStretch() const =0
Retrieves the critical stretch coefficient.
virtual void setCuttingFlags(PxMPMCuttingFlags cuttingFlags)=0
Sets the cutting flags which can enable damage tracking or thin blade support.
virtual PxMPMMaterialModel::Enum getMaterialModel() const =0
Retrieves the material model.
virtual PxReal getStretchAndShearDamping() const =0
Retrieves the stretch and shear damping.
virtual PxReal getTensileDamageSensitivity() const =0
Retrieves the tensile damage sensitivity coefficient.
virtual PxReal getCompressiveDamageSensitivity() const =0
Retrieves the compressive damage sensitivity coefficient.
virtual bool getIsPlastic() const =0
Returns true if material is plastic.
virtual void setYieldStress(PxReal yieldStress)=0
Sets the yield stress, only applied if the material model is set to Von Mises.
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition PxMPMMaterial.h:402
virtual void setYoungsModulus(PxReal young)=0
Sets Young's modulus which defines the body's stiffness.
virtual void setRotationalDamping(PxReal rotationalDamping)=0
Sets the rotational damping which dampens rotations of mpm bodies.
virtual void setDensity(PxReal density)=0
Sets density which influences the body's weight.
virtual PxReal getAttractiveForceResidual() const =0
Retrieves the attractive force residual coefficient.
virtual PxMPMCuttingFlags getCuttingFlags() const =0
Retrieves the cutting flags.
virtual void setAttractiveForceResidual(PxReal attractiveForceResidual)=0
Sets material attractive force residual coefficient.
virtual void setMaterialModel(PxMPMMaterialModel::Enum materialModel)=0
Sets the material model which influences interaction between MPM particles.
virtual void setSandFrictionAngle(PxReal sandFrictionAngle)=0
Sets the sand friction angle, only applied if the material model is set to sand.
virtual PxReal getSandFrictionAngle() const =0
Retrieves the sand friction angle.
virtual void setIsPlastic(bool isPlastic)=0
Set material to plastic.
virtual PxReal getDensity() const =0
Retrieves the density value.
virtual void setCriticalStretch(PxReal criticalStretch)=0
Sets material critical stretch coefficient.
virtual PxReal getRotationalDamping() const =0
Retrieves the rotational damping.
Material class to represent a set of particle material properties.
Definition PxParticleMaterial.h:50
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition PxParticleMaterial.h:144
#define PX_INLINE
Definition PxPreprocessor.h:320
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Optional MPM modes that improve the quality of fracture and/or cutting.
Definition PxMPMMaterial.h:75
Enum
Definition PxMPMMaterial.h:77
@ eENABLE_DAMAGE_TRACKING
A damage value will get updated on every particle to simulate material weakening to get more realisti...
Definition PxMPMMaterial.h:80
@ eNONE
No special processing to support cutting will be performed.
Definition PxMPMMaterial.h:78
@ eSUPPORT_THIN_BLADES
Special collision detection will be performed to improve support for blade like objects that are thin...
Definition PxMPMMaterial.h:79
MPM material models.
Definition PxMPMMaterial.h:46
Enum
Definition PxMPMMaterial.h:48
@ eSNOW
A corotaional cauchy strain based material model with strain limiting and hardening will be used.
Definition PxMPMMaterial.h:52
@ eVON_MISES
A von Mises material model will be used.
Definition PxMPMMaterial.h:54
@ eATTACHED
Marker to indicate that all particles with an attached material should be treated as attached to what...
Definition PxMPMMaterial.h:49
@ eSAND
A Ducker-Prager elastoplasticity material model will be used.
Definition PxMPMMaterial.h:53
@ eNEO_HOOKEAN
A Neo-Hookean material model will be used.
Definition PxMPMMaterial.h:50
@ eELASTIC
A corotaional cauchy strain based material model will be used.
Definition PxMPMMaterial.h:51
MPM surface types that influence interaction between particles and obstacles.
Definition PxMPMMaterial.h:62
Enum
Definition PxMPMMaterial.h:64
@ eSTICKY
Surface will always have friction in the tangential and the normal direction.
Definition PxMPMMaterial.h:66
@ eDEFAULT
Normal surface with friction in tangential direction.
Definition PxMPMMaterial.h:65
@ eSLIPPERY
Surface will not cause any friction.
Definition PxMPMMaterial.h:67