> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksentityphysicssettings.md).

# Class ksEntityPhysicsSettings

Namespace: [KS.Reactor.Client.Unity](/reactor/api-reference/ks.reactor.client.unity.md)\
Assembly: KSUnity-Source.dll

PhysX settings common to static, kinematic, and dynamic entities. These values may be set on a scene or entity. A value of -1f, or 0 for iteration values, means that the value should be inherited. If set on an [ksEntityComponent](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksentitycomponent.md) component then the value will be inherited from the room [ksPhysicsSettings](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksphysicssettings.md) component. If set on a [ksPhysicsSettings](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksphysicssettings.md) component, then the default values will be used.

```csharp
[Serializable]
public class ksEntityPhysicsSettings
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) â† [ksEntityPhysicsSettings](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksentityphysicssettings.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Constructors

### ksEntityPhysicsSettings(float, float, float, float, float, int, int, ksRigidBodyModes) <a href="#ks_reactor_client_unity_ksentityphysicssettings__ctor_system_single_system_single_system_single_syst" id="ks_reactor_client_unity_ksentityphysicssettings__ctor_system_single_system_single_system_single_syst"></a>

Constructor

```csharp
public ksEntityPhysicsSettings(float sleepThreshold = 0.005, float contactOffset = 0.01, float maxLinearSpeed = 1000, float maxAngularSpeed = 50000, float maxDepenetrationSpeed = 1000, int positionIterations = 6, int velocityIterations = 1, ksRigidBodyModes type = ksRigidBodyModes.RIGID_BODY_3D)
```

#### Parameters

`sleepThreshold` [float](https://learn.microsoft.com/dotnet/api/system.single)

The mass-normalized energy threshold, below which objects start going to sleep.

`contactOffset` [float](https://learn.microsoft.com/dotnet/api/system.single)

Contact offset value of all colliders on this entity.

`maxLinearSpeed` [float](https://learn.microsoft.com/dotnet/api/system.single)

The maximimum linear speed of the entity.

`maxAngularSpeed` [float](https://learn.microsoft.com/dotnet/api/system.single)

The maximimum angular speed of the entity measured in degrees per second.

`maxDepenetrationSpeed` [float](https://learn.microsoft.com/dotnet/api/system.single)

Maximum speed of a rigidbody when moving out of penetrating state.

`positionIterations` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Determines how accurately Rigidbody joints and collision contacts are resolved.

`velocityIterations` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Determines how how accurately entity collision contacts are resolved.

`type` [ksRigidBodyModes](/reactor/api-reference/ks.reactor/ks.reactor.ksrigidbodymodes.md)

Rigid body type.

## Fields

### ContactOffset <a href="#ks_reactor_client_unity_ksentityphysicssettings_contactoffset" id="ks_reactor_client_unity_ksentityphysicssettings_contactoffset"></a>

Contact offset value of all colliders on this entity.

```csharp
[Tooltip("Contact offset value of all colliders on this entity. (Unchecked = Use default room settings)")]
[Min(-1)]
public float ContactOffset
```

#### Field Value

[float](https://learn.microsoft.com/dotnet/api/system.single)

### MaxAngularSpeed <a href="#ks_reactor_client_unity_ksentityphysicssettings_maxangularspeed" id="ks_reactor_client_unity_ksentityphysicssettings_maxangularspeed"></a>

The maximimum angular speed of the entity measured in degrees per second.

```csharp
[Tooltip("The maximimum angular speed of the entity measured in degrees per second. (Unchecked = Use default room settings)")]
[Min(-1)]
public float MaxAngularSpeed
```

#### Field Value

[float](https://learn.microsoft.com/dotnet/api/system.single)

### MaxDepenetrationSpeed <a href="#ks_reactor_client_unity_ksentityphysicssettings_maxdepenetrationspeed" id="ks_reactor_client_unity_ksentityphysicssettings_maxdepenetrationspeed"></a>

Maximum speed of a rigidbody when moving out of penetrating state.

```csharp
[Tooltip("Maximum speed of a rigidbody when moving out of penetrating state. (Unchecked = Use default room settings)")]
[Min(-1)]
public float MaxDepenetrationSpeed
```

#### Field Value

[float](https://learn.microsoft.com/dotnet/api/system.single)

### MaxLinearSpeed <a href="#ks_reactor_client_unity_ksentityphysicssettings_maxlinearspeed" id="ks_reactor_client_unity_ksentityphysicssettings_maxlinearspeed"></a>

The maximimum linear speed of the entity.

```csharp
[Tooltip("The maximimum linear speed of the entity. (Unchecked = Use default room settings)")]
[Min(-1)]
public float MaxLinearSpeed
```

#### Field Value

[float](https://learn.microsoft.com/dotnet/api/system.single)

### PositionIterations <a href="#ks_reactor_client_unity_ksentityphysicssettings_positioniterations" id="ks_reactor_client_unity_ksentityphysicssettings_positioniterations"></a>

Determines how accurately Rigidbody joints and collision contacts are resolved.

```csharp
[Tooltip("The PositionIterations determines how accurately Rigidbody joints and collision contacts are resolved. (Unchecked = Use default room settings)")]
[Range(1, 10)]
public int PositionIterations
```

#### Field Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

### SleepThreshold <a href="#ks_reactor_client_unity_ksentityphysicssettings_sleepthreshold" id="ks_reactor_client_unity_ksentityphysicssettings_sleepthreshold"></a>

The mass-normalized energy threshold, below which objects start going to sleep.

```csharp
[Tooltip("The mass-normalized energy threshold, below which objects start going to sleep. (Unchecked = Use default room settings)")]
[Min(-1)]
public float SleepThreshold
```

#### Field Value

[float](https://learn.microsoft.com/dotnet/api/system.single)

### VelocityIterations <a href="#ks_reactor_client_unity_ksentityphysicssettings_velocityiterations" id="ks_reactor_client_unity_ksentityphysicssettings_velocityiterations"></a>

Affects how how accurately entity collision contacts are resolved.

```csharp
[Tooltip("The VelocityIterations affects how how accurately entity collision contacts are resolved. (Unchecked = Use default room settings)")]
[Range(0, 10)]
public int VelocityIterations
```

#### Field Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

## Properties

### RigidBodyMode <a href="#ks_reactor_client_unity_ksentityphysicssettings_rigidbodymode" id="ks_reactor_client_unity_ksentityphysicssettings_rigidbodymode"></a>

Is the rigid body 3D or 2D?

```csharp
public ksRigidBodyModes RigidBodyMode { get; set; }
```

#### Property Value

[ksRigidBodyModes](/reactor/api-reference/ks.reactor/ks.reactor.ksrigidbodymodes.md)

## Methods

### Validate() <a href="#ks_reactor_client_unity_ksentityphysicssettings_validate" id="ks_reactor_client_unity_ksentityphysicssettings_validate"></a>

Check if the values are valid. If a value is a negative float, then snap it to -1f. During publishing a values of -1f is used to indicate that a parent or default value should be used.

```csharp
public void Validate()
```
