Struct Material
Describes how an object should respond to collisions with other objects.
Implements
Inherited Members
Namespace: Unity.Physics
Assembly: Unity.Physics.dll
Syntax
public struct Material : IEquatable<Material>Fields
CustomTags
The custom tags set by the user.
Declaration
public byte CustomTagsField Value
| Type | Description | 
|---|---|
| byte | 
Default
(Immutable) A default material.
Declaration
public static readonly Material DefaultField Value
| Type | Description | 
|---|---|
| Material | 
Friction
The friction.
Declaration
public float FrictionField Value
| Type | Description | 
|---|---|
| float | 
FrictionCombinePolicy
The friction combine policy.
Declaration
public Material.CombinePolicy FrictionCombinePolicyField Value
| Type | Description | 
|---|---|
| Material.CombinePolicy | 
Restitution
The restitution.
Declaration
public float RestitutionField Value
| Type | Description | 
|---|---|
| float | 
RestitutionCombinePolicy
The restitution combine policy.
Declaration
public Material.CombinePolicy RestitutionCombinePolicyField Value
| Type | Description | 
|---|---|
| Material.CombinePolicy | 
Properties
CollisionResponse
Gets or sets the collision response.
Declaration
public CollisionResponsePolicy CollisionResponse { get; set; }Property Value
| Type | Description | 
|---|---|
| CollisionResponsePolicy | The collision response. | 
EnableMassFactors
Get or Set EnableMassFactors
Declaration
public bool EnableMassFactors { get; set; }Property Value
| Type | Description | 
|---|---|
| bool | If true, the object can have its inertia and mass overridden during solving. | 
EnableSurfaceVelocity
Get or Set EnableSurfaceVelocity.
Declaration
public bool EnableSurfaceVelocity { get; set; }Property Value
| Type | Description | 
|---|---|
| bool | If true, the object can apply a surface velocity to its contact points.. | 
Methods
Equals(Material)
Tests if this Material is considered equal to another.
Declaration
public bool Equals(Material other)Parameters
| Type | Name | Description | 
|---|---|---|
| Material | other | The material to compare to this object. | 
Returns
| Type | Description | 
|---|---|
| bool | True if the objects are considered equal, false if they are not. | 
GetCombinedFriction(Material, Material)
Get a combined friction value for a pair of materials. The combine policy with the highest value takes priority.
Declaration
public static float GetCombinedFriction(Material materialA, Material materialB)Parameters
| Type | Name | Description | 
|---|---|---|
| Material | materialA | The material a. | 
| Material | materialB | The material b. | 
Returns
| Type | Description | 
|---|---|
| float | The combined friction. | 
GetCombinedRestitution(Material, Material)
Get a combined restitution value for a pair of materials. The combine policy with the highest value takes priority.
Declaration
public static float GetCombinedRestitution(Material materialA, Material materialB)Parameters
| Type | Name | Description | 
|---|---|---|
| Material | materialA | The material a. | 
| Material | materialB | The material b. | 
Returns
| Type | Description | 
|---|---|
| float | The combined restitution. | 
GetHashCode()
Calculates a hash code for this object.
Declaration
public override int GetHashCode()Returns
| Type | Description | 
|---|---|
| int | A hash code for this object. |