Vortex Studio SDK Classes Documentation
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Vx::VxMaterial Class Reference

This class provides access to the methods that allow the user to specify all physical properties of a material used for realistic collision in Vortex. More...

#include <Vx/VxMaterial.h>

+ Inheritance diagram for Vx::VxMaterial:

Public Types

enum  IntegratedSlipDisplacement { kIntegratedSlipDisplacementNeutral, kIntegratedSlipDisplacementDeactivated, kIntegratedSlipDisplacementActivated, kIntegratedSlipDisplacementNever }
 Different possibilities for integrated slip displacement. More...
 
- Public Types inherited from Vx::VxMaterialBase
enum  FrictionAxis {
  kFrictionAxisLinearPrimary = 0, kFrictionAxisLinearSecondary, kFrictionAxisAngularNormal, kFrictionAxisAngularPrimary,
  kFrictionAxisAngularSecondary, kFrictionAxisCount, kFrictionAxisLinear
}
 Friction axis settings. More...
 
enum  FrictionModel {
  kFrictionModelBox, kFrictionModelScaledBox, kFrictionModelBoxProportionalLow, kFrictionModelBoxProportionalHigh,
  kFrictionModelScaledBoxFast, kFrictionModelNeutral, kFrictionModelNone
}
 Friction models available on each friction axis. More...
 
- Public Types inherited from Vx::VxBase
enum  Event { kEventDestroy = 0, kEventCreate, EVENT_NUM }
 

Public Member Functions

VXCORE_SYMBOL VxMaterial ()
 Default constructor.
 
virtual VXCORE_SYMBOL void dump (const char *inFileName) const override
 
virtual VXCORE_SYMBOL const char * getClassName () const override
 Returns the class name.
 
const VxArray
< VxContactMaterial * > & 
getContactMaterials () const
 Returns the list of contact materials of this material registered in the table.
 
size_t getIndex () const
 Returns the index for this VxMaterial.
 
IntegratedSlipDisplacement getIntegratedSlipDisplacement () const
 Returns the value of the integrated slip displacement parameter . More...
 
VXCORE_SYMBOL
VxPersistence::VxFile * 
getMaterialOrigin () const
 
VXCORE_SYMBOL std::string getMaterialOriginFilename () const
 
VXCORE_SYMBOL bool isRegisteredAsUsed () const
 Returns if the material is still registered as being used.
 
VXCORE_SYMBOL VxMaterialoperator= (const VxMaterial &inVal)
 Assignment operator. More...
 
VXCORE_SYMBOL void registerUsage (VxBase *iUser)
 Registers the specified object as using this material.
 
void setIntegratedSlipDisplacement (const IntegratedSlipDisplacement &iVal)
 If set to kIntegratedSlipDisplacementActivated, this enables contact matching between two successive simulation frames. More...
 
virtual VXCORE_SYMBOL void setName (const char *iName) override
 Sets the name for this VxMaterial.
 
VXCORE_SYMBOL void unregisterUsage (VxBase *iUser)
 De-registers the specified object as using this material.
 
- Public Member Functions inherited from Vx::VxMaterialBase
double getAdhesiveForce () const
 Returns the maximum adhesive force in the normal contact direction. More...
 
double getBoxFrictionForce (FrictionAxis axis) const
 Returns the maximum allowed friction force or torque for the specified friction axis. More...
 
double getCompliance () const
 Returns the compliance parameter value. More...
 
double getDamping () const
 Returns the damping parameter value. More...
 
double getFrictionCoefficient (FrictionAxis axis) const
 Returns the friction coefficient for the friction axis. More...
 
FrictionModel getFrictionModel (FrictionAxis axis) const
 Returns the friction model for this contact. More...
 
double getRestitution () const
 Sets the value of impact restitution, or bounciness. More...
 
double getRestitutionThreshold () const
 Sets the value of the normal incident contact velocity over which contacting objects are considered to be impacting each other. More...
 
double getSlide (FrictionAxis axis) const
 Returns the force relative velocity between constrained parts along or around the specified axis. More...
 
double getSlip (FrictionAxis axis) const
 Returns the slip parameter value for Z-axis friction. More...
 
double getStaticFrictionScale (FrictionAxis axis) const
 Returns the static friction force scaling factor. More...
 
void * getUserData () const
 Returns the contact material variable for storing user data.
 
bool isCompliant () const
 Returns if this contact is compliant or not. More...
 
VxMaterialBaseoperator= (const VxMaterialBase &inVal)
 
virtual void reset ()
 Initializes the contact parameters structure to default values. More...
 
void setAdhesiveForce (double param)
 Sets the maximum adhesive force in the normal contact direction for this contact type. More...
 
void setBoxFrictionForce (FrictionAxis axis, double maxForce)
 Sets the maximum allowed friction force or torque for the specified friction axis. More...
 
void setCompliance (double param)
 Sets the normal contact compliance parameter value. More...
 
void setDamping (double param)
 Sets the damping parameter value. More...
 
void setFrictionCoefficient (FrictionAxis axis, double coeff)
 Sets the friction coefficient for the friction axis. More...
 
void setFrictionModel (FrictionAxis axis, FrictionModel inModel)
 Sets the friction model for this contact. More...
 
void setRestitution (double param)
 Sets the impact restitution coefficient (bounciness) for this contact type. More...
 
void setRestitutionThreshold (double param)
 Sets the value of the normal incident contact velocity over which contacting objects are considered to be impacting each other. More...
 
void setSlide (FrictionAxis axis, double inSlide)
 Sets the force relative velocity between constrained parts along or around the specified axis. More...
 
void setSlip (FrictionAxis axis, double inSlip)
 Sets the slip parameter value for Z-axis friction. More...
 
void setStaticFrictionScale (FrictionAxis axis, double scale)
 Sets the static friction (stiction) force scaling factor. More...
 
void setUserData (void *data)
 Sets the contact material variable for storing user data.
 
- Public Member Functions inherited from Vx::VxBase
void addSubscriber (Event event, Subscriber *subscriber)
 
void addSubscriber (Subscriber *subscriber)
 
unsigned int getCreationIndex () const
 Access the creation index of the instance.
 
const char * getName () const
 Retrieves the name. More...
 
bool hasName () const
 
bool isSubscribed (Event event, Subscriber *subscriber) const
 
bool isSubscribed (Subscriber *subscriber) const
 
void removeSubscriber (Event event, Subscriber *subscriber)
 
void removeSubscriber (Subscriber *subscriber)
 
void setCombinedName (const char *base, const char *name, size_t i=0)
 Utility to set the name to a concatenate string = base_name_i.
 
- Public Member Functions inherited from Vx::VxRefCount
 VxRefCount (const VxRefCount &other)
 
VxRefCountoperator= (const VxRefCount &rhs)=delete
 Assignment operator must not be used.
 
VxRefCountoperator= (VxRefCount &&)=delete
 
void ref () const
 Increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
int referenceCount () const
 Return the number pointers currently referencing this object.
 
void unref () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
void unref_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Static Public Attributes

static const size_t INVALID_INDEX
 Special value for an index that is considered invalid.
 

Protected Member Functions

VXCORE_SYMBOL VxMaterial (const VxMaterial &inVal)
 
virtual VXCORE_SYMBOL ~VxMaterial ()
 Destructor protected for ref-counted objects.
 
VXCORE_SYMBOL void _addDependency (VxContactMaterial *iContact)
 
VXCORE_SYMBOL void _removeDependency (VxContactMaterial *iContact)
 
void _setIndex (size_t iIndex)
 
VXCORE_SYMBOL void _setMaterialOrigin (VxPersistence::VxFile *fileOrigin)
 
VXCORE_SYMBOL void _setMaterialOriginFilename (const std::string &filename)
 
VXCORE_SYMBOL void _updateDependecies ()
 
virtual VXCORE_SYMBOL void updateValue () override
 Called whenever a parameter value is changed in the VxMaterial.
 
- Protected Member Functions inherited from Vx::VxMaterialBase
 VxMaterialBase (const VxMaterialBase &inVal)
 
- Protected Member Functions inherited from Vx::VxBase
void setNameBase (const char *name)
 
void setVxName (const std::string &iName)
 

Protected Attributes

VxArray< VxContactMaterial * > mDependencies
 
size_t mIndex
 
IntegratedSlipDisplacement mIntegratedSlipDisplacement
 
VxPersistence::VxFile * mMaterialOrigin
 
std::string mMaterialOriginFilename
 
std::map< VxPointer< VxBase >
, int > 
mUsageReferencesList
 
- Protected Attributes inherited from Vx::VxMaterialBase
double boxMaxForce [5]
 
double compliance
 
double damping
 
double max_adhesive_force
 
FrictionModel model [5]
 
void * mUserData
 
double restitution
 
double sbCoefficient [5]
 
double slide [5]
 
double slip [5]
 
double staticFrictionScale [5]
 
double velThreshold
 

Friends

class VxMaterialTable
 
class VxPersistence::VxMaterialSection
 

Additional Inherited Members

- Static Public Member Functions inherited from Vx::VxBase
static Subscriber * getConstructorSubscriber ()
 Returns default static VxBase Subscriber that is be called each time an instance of VxBase is create.
 
static bool getEnableMemoryTracking ()
 
static Vx::VxArray< Vx::VxBase * > & getVxBaseList ()
 
static bool isVxBaseValid (VxBase *base)
 
static void setConstructorSubscriber (Subscriber *inSub)
 Sets a default static VxBase Subscriber that will be called each time an instance of VxBase is create.
 
static void setEnableMemoryTracking (bool enabled)
 
- Static Protected Member Functions inherited from Vx::VxBase
static void resetVxBaseCounter ()
 

Detailed Description

This class provides access to the methods that allow the user to specify all physical properties of a material used for realistic collision in Vortex.

The material will be used to produce a VxContactMaterial by combining the parameters of two VxMaterial objects.

See Also
VxContactMaterial
VxMaterialTable

Member Enumeration Documentation

Different possibilities for integrated slip displacement.

Use the kIntegratedSlipDisplacementActivated value to activate slip displacement detection. When merging materials with value kIntegratedSlipDisplacementNever set, slip displacement detection will not be activated.

See Also
VxContactMaterial::setIntegratedSlipDisplacement()
VxContactMaterial::getIntegratedSlipDisplacement()
Vx::VxMaterial::setIntegratedSlipDisplacement()
Vx::VxMaterial::getIntegratedSlipDisplacement()
Enumerator
kIntegratedSlipDisplacementNeutral 

Slip displacement is not taken into account in merging material.

This is the default.

kIntegratedSlipDisplacementDeactivated 

Slip displacement detection is not active.

kIntegratedSlipDisplacementActivated 

Slip displacement detection activated.

kIntegratedSlipDisplacementNever 

Slip displacement detection is never active (merging materials always results in kIntegratedSlipDisplacementDeactivated)

Member Function Documentation

IntegratedSlipDisplacement Vx::VxMaterial::getIntegratedSlipDisplacement ( ) const
inline
VXCORE_SYMBOL VxMaterial& Vx::VxMaterial::operator= ( const VxMaterial inVal)

Assignment operator.

This copies the parameters, but not the index or the dependencies.

void Vx::VxMaterial::setIntegratedSlipDisplacement ( const IntegratedSlipDisplacement iVal)
inline

If set to kIntegratedSlipDisplacementActivated, this enables contact matching between two successive simulation frames.

The matched contacts will be converted as position-based constraints instead of velocity-based, the lateral spring elongation being computed by integrating the displacement of the matched contact.

This is useful to avoid object's on a slope from sliding down slowly due to loss in standard velocity-based friction.