Komodo Engine
C PROJECT_LOGO=
Komodo.Core.Physics.PhysicsMaterial Class Reference

Set of parameters for a material in a physics system. More...

Public Member Functions

 PhysicsMaterial ([NotNull] string name)
 Creates a new physics material. Physics material names are unique identifiers. More...
 

Static Public Member Functions

static PhysicsMaterial GetPhysicsMaterial (string name)
 Provides the PhysicsMaterial instance for the given name. More...
 

Properties

float AngularDamping [get, set]
 AngularDamping defines how an object's angular veloctity is reduced over time with no interaction from other physics objects. More...
 
float AngularDampingLimit [get, set]
 AngularDampingLimit defines the threshold at which the angular velocity of an object will be clamped to 0 in all dimensions. More...
 
float LinearDampingLimit [get, set]
 LinearDampingLimit defines the threshold at which the linear velocity of an object will be clamped to 0 in all dimensions. More...
 
float Friction [get, set]
 Defines the frictional coefficient for objects that interact with this PhysicsMaterial. More...
 
float LinearDamping [get, set]
 LinearDamping defines how an object's linear veloctity is reduced over time with no interaction from other physics objects. More...
 
string Name [get, set]
 Unique identifier for the PhysicsMaterial. More...
 
float Restitution [get, set]
 Bounciness of the physics object. More...
 

Detailed Description

Set of parameters for a material in a physics system.

Constructor & Destructor Documentation

◆ PhysicsMaterial()

Komodo.Core.Physics.PhysicsMaterial.PhysicsMaterial ( [NotNull] string  name)

Creates a new physics material. Physics material names are unique identifiers.

Parameters
nameThe unique name for a physics material. If an existing name is provided, a System.ArgumentException is thrown.

Member Function Documentation

◆ GetPhysicsMaterial()

static PhysicsMaterial Komodo.Core.Physics.PhysicsMaterial.GetPhysicsMaterial ( string  name)
static

Provides the PhysicsMaterial instance for the given name.

Parameters
nameIdentifying name of the PhysicsMaterial.
Returns
PhysicsMaterial identified by the name. Returns null if named material does not exist.

Property Documentation

◆ AngularDamping

float Komodo.Core.Physics.PhysicsMaterial.AngularDamping
getset

AngularDamping defines how an object's angular veloctity is reduced over time with no interaction from other physics objects.

The higher the AngularDamping, the quicker angular velocity will drop over time. A value of 0 will provide no reduction in angular velocity over time.

◆ AngularDampingLimit

float Komodo.Core.Physics.PhysicsMaterial.AngularDampingLimit
getset

AngularDampingLimit defines the threshold at which the angular velocity of an object will be clamped to 0 in all dimensions.

The threshold is measured by the length of the angular velocity vector.

◆ Friction

float Komodo.Core.Physics.PhysicsMaterial.Friction
getset

Defines the frictional coefficient for objects that interact with this PhysicsMaterial.

◆ LinearDamping

float Komodo.Core.Physics.PhysicsMaterial.LinearDamping
getset

LinearDamping defines how an object's linear veloctity is reduced over time with no interaction from other physics objects.

The higher the LinearDamping, the quicker linear velocity will drop over time. A value of 0 will provide no reduction in linear velocity over time.

◆ LinearDampingLimit

float Komodo.Core.Physics.PhysicsMaterial.LinearDampingLimit
getset

LinearDampingLimit defines the threshold at which the linear velocity of an object will be clamped to 0 in all dimensions.

The threshold is measured by the length of the anglinearular velocity vector.

◆ Name

string Komodo.Core.Physics.PhysicsMaterial.Name
getset

Unique identifier for the PhysicsMaterial.

◆ Restitution

float Komodo.Core.Physics.PhysicsMaterial.Restitution
getset

Bounciness of the physics object.

A value of 0 simulates a completely inelastic collision. A value of 1 simulates a perfectly elastic collision. Values greater than 1 simulate collisions that are more elastic than perfect elasticity. A value of 2 will mean that the object bounces with a velocity twice that of when it collided.