Photon Quantum 3.0.0

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Quantum.PhysicsMaterialData Struct Reference

Defines the settings for a physics body to resolve its collision when it is touching another body. More...

Public Member Functions

 PhysicsMaterialData (FP restitution, PhysicsCombineFunction restitutionCombine, FP frictionStatic, FP frictionDynamic, PhysicsCombineFunction frictionCombine)
 Creates a physics material data with custom values. More...
 

Static Public Member Functions

static PhysicsMaterialData GetDefaultPhysicsMaterialData ()
 Returns a PhysicsMaterialData with default values. The restituition is 0 and the friction is 0.6. The default combination mode is the PhysicsCombineFunction.Average for all functions. More...
 

Public Attributes

readonly PhysicsCombineFunction FrictionCombineFunction
 Define how the physics system calculates friction between two physics bodies, based on each collider’s friction. More...
 
readonly FP FrictionDynamic
 How much friction the collider has against another collider when they are not moving. More...
 
readonly FP FrictionStatic
 How much friction the collider has against another collider when they are moving and touching each other. More...
 
readonly FP Restitution
 Defines how much movement is restituted after a collision solver. It can be used to apply a bounciness behavior to the physics body. More...
 
readonly PhysicsCombineFunction RestitutionCombineFunction
 Define how the physics system calculates restitution for two physics bodies, based on each collider's restitution. More...
 

Static Public Attributes

const Int32 SIZE = sizeof(Int32) * 2 + FP.SIZE * 3
 Represents the size of a variable in bytes. More...
 

Detailed Description

Defines the settings for a physics body to resolve its collision when it is touching another body.

Constructor & Destructor Documentation

◆ PhysicsMaterialData()

Quantum.PhysicsMaterialData.PhysicsMaterialData ( FP  restitution,
PhysicsCombineFunction  restitutionCombine,
FP  frictionStatic,
FP  frictionDynamic,
PhysicsCombineFunction  frictionCombine 
)
inline

Creates a physics material data with custom values.

Parameters
restitutionHow much movement should be restituted after the collision resolution.
restitutionCombineThe combination mode for the restituition between two colliders.
frictionStaticHow much friction applied against two colliders in movement.
frictionDynamicHow much friction applied against two stopped colliders.
frictionCombineThe combination mode for the friction between two bodies.

Member Function Documentation

◆ GetDefaultPhysicsMaterialData()

static PhysicsMaterialData Quantum.PhysicsMaterialData.GetDefaultPhysicsMaterialData ( )
inlinestatic

Returns a PhysicsMaterialData with default values. The restituition is 0 and the friction is 0.6. The default combination mode is the PhysicsCombineFunction.Average for all functions.

Member Data Documentation

◆ SIZE

const Int32 Quantum.PhysicsMaterialData.SIZE = sizeof(Int32) * 2 + FP.SIZE * 3
static

Represents the size of a variable in bytes.

◆ RestitutionCombineFunction

readonly PhysicsCombineFunction Quantum.PhysicsMaterialData.RestitutionCombineFunction

Define how the physics system calculates restitution for two physics bodies, based on each collider's restitution.

◆ FrictionCombineFunction

readonly PhysicsCombineFunction Quantum.PhysicsMaterialData.FrictionCombineFunction

Define how the physics system calculates friction between two physics bodies, based on each collider’s friction.

◆ Restitution

readonly FP Quantum.PhysicsMaterialData.Restitution

Defines how much movement is restituted after a collision solver. It can be used to apply a bounciness behavior to the physics body.

◆ FrictionStatic

readonly FP Quantum.PhysicsMaterialData.FrictionStatic

How much friction the collider has against another collider when they are moving and touching each other.

◆ FrictionDynamic

readonly FP Quantum.PhysicsMaterialData.FrictionDynamic

How much friction the collider has against another collider when they are not moving.