Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
PhysicsMaterial Class Reference

#include <PhysicsMaterial.h>

Inheritance diagram for PhysicsMaterial:
SerializableObject RefTarget< PhysicsMaterial > PhysicsMaterialSimple

Public Types

using PhysicsMaterialResult = Result<Ref<PhysicsMaterial>>

Public Member Functions

 PhysicsMaterial ()=default
 Constructor.
virtual ~PhysicsMaterial () override=default
virtual const char * GetDebugName () const
virtual Color GetDebugColor () const
virtual void SaveBinaryState (StreamOut &inStream) const
 Saves the contents of the material in binary form to inStream.
Public Member Functions inherited from SerializableObject
virtual ~SerializableObject ()=default
 Destructor.
Public Member Functions inherited from RefTarget< PhysicsMaterial >
 RefTarget ()=default
 Constructor.
 ~RefTarget ()
 assert no one is referencing us
void SetEmbedded () const
RefTargetoperator= (const RefTarget &)
 Assignment operator.
uint32 GetRefCount () const
 Get current refcount of this object.
void AddRef () const
 Add or release a reference to this object.
void Release () const

Static Public Member Functions

static PhysicsMaterialResult sRestoreFromBinaryState (StreamIn &inStream)
 Creates a PhysicsMaterial of the correct type and restores its contents from the binary stream inStream.
Static Public Member Functions inherited from RefTarget< PhysicsMaterial >
static int sInternalGetRefCountOffset ()
 INTERNAL HELPER FUNCTION USED BY SERIALIZATION.

Static Public Attributes

static RefConst< PhysicsMaterialsDefault
 Default material that is used when a shape has no materials defined.

Protected Member Functions

 PhysicsMaterial (const PhysicsMaterial &)=default
 Don't allow copy constructing this base class, but allow derived classes to copy themselves.
PhysicsMaterialoperator= (const PhysicsMaterial &)=default
virtual void RestoreBinaryState (StreamIn &inStream)
 This function should not be called directly, it is used by sRestoreFromBinaryState.
Protected Member Functions inherited from SerializableObject
 SerializableObject ()=default
 Don't allow (copy) constructing this base class, but allow derived classes to (copy) construct themselves.
 SerializableObject (const SerializableObject &)=default
SerializableObjectoperator= (const SerializableObject &)=default

Additional Inherited Members

Protected Attributes inherited from RefTarget< PhysicsMaterial >
atomic< uint32mRefCount
 Current reference count.
Static Protected Attributes inherited from RefTarget< PhysicsMaterial >
static constexpr uint32 cEmbedded
 A large value that gets added to the refcount to mark the object as embedded.

Detailed Description

This structure describes the surface of (part of) a shape. You should inherit from it to define additional information that is interesting for the simulation. The 2 materials involved in a contact could be used to decide which sound or particle effects to play.

If you inherit from this material, don't forget to create a suitable default material in sDefault

Member Typedef Documentation

◆ PhysicsMaterialResult

Constructor & Destructor Documentation

◆ PhysicsMaterial() [1/2]

PhysicsMaterial::PhysicsMaterial ( )
default

Constructor.

◆ ~PhysicsMaterial()

virtual PhysicsMaterial::~PhysicsMaterial ( )
overridevirtualdefault

◆ PhysicsMaterial() [2/2]

PhysicsMaterial::PhysicsMaterial ( const PhysicsMaterial & )
protecteddefault

Don't allow copy constructing this base class, but allow derived classes to copy themselves.

Member Function Documentation

◆ GetDebugColor()

virtual Color PhysicsMaterial::GetDebugColor ( ) const
inlinevirtual

Reimplemented in PhysicsMaterialSimple.

◆ GetDebugName()

virtual const char * PhysicsMaterial::GetDebugName ( ) const
inlinevirtual

Reimplemented in PhysicsMaterialSimple.

◆ operator=()

PhysicsMaterial & PhysicsMaterial::operator= ( const PhysicsMaterial & )
protecteddefault

◆ RestoreBinaryState()

void PhysicsMaterial::RestoreBinaryState ( StreamIn & inStream)
protectedvirtual

This function should not be called directly, it is used by sRestoreFromBinaryState.

Reimplemented in PhysicsMaterialSimple.

◆ SaveBinaryState()

void PhysicsMaterial::SaveBinaryState ( StreamOut & inStream) const
virtual

Saves the contents of the material in binary form to inStream.

Reimplemented in PhysicsMaterialSimple.

◆ sRestoreFromBinaryState()

PhysicsMaterial::PhysicsMaterialResult PhysicsMaterial::sRestoreFromBinaryState ( StreamIn & inStream)
static

Creates a PhysicsMaterial of the correct type and restores its contents from the binary stream inStream.

Member Data Documentation

◆ sDefault

JPH_NAMESPACE_BEGIN RefConst< PhysicsMaterial > PhysicsMaterial::sDefault
static

Default material that is used when a shape has no materials defined.


The documentation for this class was generated from the following files: