Struct Material
Describes how an object should respond to collisions with other objects.
Inherited Members
Namespace: Unity.Physics
Syntax
public struct Material : IEquatable<Material>
Fields
CustomTags
The custom tags set by the user.
Declaration
public byte CustomTags
Field Value
Type | Description |
---|---|
Byte |
Default
(Immutable) A default material.
Declaration
public static readonly Material Default
Field Value
Type | Description |
---|---|
Material |
Friction
The friction.
Declaration
public float Friction
Field Value
Type | Description |
---|---|
Single |
FrictionCombinePolicy
The friction combine policy.
Declaration
public Material.CombinePolicy FrictionCombinePolicy
Field Value
Type | Description |
---|---|
Material.CombinePolicy |
Restitution
The restitution.
Declaration
public float Restitution
Field Value
Type | Description |
---|---|
Single |
RestitutionCombinePolicy
The restitution combine policy.
Declaration
public Material.CombinePolicy RestitutionCombinePolicy
Field 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 |
---|---|
Boolean | 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 |
---|---|
Boolean | 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 |
---|---|
Boolean | True if the objects are considered equal, false if they are not. |
Implements
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 |
---|---|
Single | 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 |
---|---|
Single | The combined restitution. |
GetHashCode()
Calculates a hash code for this object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code for this object. |