> 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.server.physx/ks.reactor.server.physx.pxphysics.md).

# Class pxPhysics

Namespace: [KS.Reactor.Server.PhysX](/reactor/api-reference/ks.reactor.server.physx.md)\
Assembly: KSReactor.dll

```csharp
public static class pxPhysics
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [pxPhysics](/reactor/api-reference/ks.reactor.server.physx/ks.reactor.server.physx.pxphysics.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)

## Properties

### DefaultMaterial <a href="#ks_reactor_server_physx_pxphysics_defaultmaterial" id="ks_reactor_server_physx_pxphysics_defaultmaterial"></a>

```csharp
public static pxMaterial DefaultMaterial { get; set; }
```

#### Property Value

[pxMaterial](/reactor/api-reference/ks.reactor.server.physx/ks.reactor.server.physx.pxmaterial.md)

### IsEnabled <a href="#ks_reactor_server_physx_pxphysics_isenabled" id="ks_reactor_server_physx_pxphysics_isenabled"></a>

Checks if physics is enabled.

```csharp
public static bool IsEnabled { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

## Methods

### CreateConvexMesh(ksVector3\[]) <a href="#ks_reactor_server_physx_pxphysics_createconvexmesh_ks_reactor_ksvector3" id="ks_reactor_server_physx_pxphysics_createconvexmesh_ks_reactor_ksvector3"></a>

```csharp
public static IntPtr CreateConvexMesh(ksVector3[] vertices)
```

#### Parameters

`vertices` ksVector3\[]

#### Returns

[IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

### CreateHeightField(pxHeightFieldSample\[], uint, uint) <a href="#ks_reactor_server_physx_pxphysics_createheightfield_ks_reactor_server_physx_pxheightfieldsample___sy" id="ks_reactor_server_physx_pxphysics_createheightfield_ks_reactor_server_physx_pxheightfieldsample___sy"></a>

```csharp
public static IntPtr CreateHeightField(pxHeightFieldSample[] heightData, uint numCols, uint numRows)
```

#### Parameters

`heightData` [pxHeightFieldSample](/reactor/api-reference/ks.reactor.server.physx/ks.reactor.server.physx.pxheightfieldsample.md)\[]

`numCols` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

`numRows` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

#### Returns

[IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

### CreateMaterial(float, float, float, pxMaterialCombineMode, pxMaterialCombineMode) <a href="#ks_reactor_server_physx_pxphysics_creatematerial_system_single_system_single_system_single_ks_reacto" id="ks_reactor_server_physx_pxphysics_creatematerial_system_single_system_single_system_single_ks_reacto"></a>

```csharp
public static IntPtr CreateMaterial(float staticFriction, float dynamicFriction, float restitution, pxMaterialCombineMode frictionCombine, pxMaterialCombineMode restitutionCombine)
```

#### Parameters

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

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

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

`frictionCombine` [pxMaterialCombineMode](/reactor/api-reference/ks.reactor.server.physx/ks.reactor.server.physx.pxmaterialcombinemode.md)

`restitutionCombine` [pxMaterialCombineMode](/reactor/api-reference/ks.reactor.server.physx/ks.reactor.server.physx.pxmaterialcombinemode.md)

#### Returns

[IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

### CreateRigidDynamic(IntPtr) <a href="#ks_reactor_server_physx_pxphysics_createrigiddynamic_system_intptr" id="ks_reactor_server_physx_pxphysics_createrigiddynamic_system_intptr"></a>

```csharp
public static IntPtr CreateRigidDynamic(IntPtr transformData)
```

#### Parameters

`transformData` [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

#### Returns

[IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

### CreateRigidStatic(IntPtr) <a href="#ks_reactor_server_physx_pxphysics_createrigidstatic_system_intptr" id="ks_reactor_server_physx_pxphysics_createrigidstatic_system_intptr"></a>

```csharp
public static IntPtr CreateRigidStatic(IntPtr transformData)
```

#### Parameters

`transformData` [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

#### Returns

[IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

### CreateScene(eSolverTypes, pxSceneFlags) <a href="#ks_reactor_server_physx_pxphysics_createscene_ks_reactor_server_physx_pxscene_esolvertypes_ks_reacto" id="ks_reactor_server_physx_pxphysics_createscene_ks_reactor_server_physx_pxscene_esolvertypes_ks_reacto"></a>

```csharp
public static IntPtr CreateScene(pxScene.eSolverTypes solverType, pxSceneFlags flags)
```

#### Parameters

`solverType` [pxScene](/reactor/api-reference/ks.reactor.server.physx/ks.reactor.server.physx.pxscene.md).[eSolverTypes](/reactor/api-reference/ks.reactor.server.physx/ks.reactor.server.physx.pxscene/ks.reactor.server.physx.pxscene.esolvertypes.md)

`flags` [pxSceneFlags](/reactor/api-reference/ks.reactor.server.physx/ks.reactor.server.physx.pxsceneflags.md)

#### Returns

[IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

### CreateShape(IntPtr, IntPtr, ref ksVector3, ref ksQuaternion, bool) <a href="#ks_reactor_server_physx_pxphysics_createshape_system_intptr_system_intptr_ks_reactor_ksvector3__ks_r" id="ks_reactor_server_physx_pxphysics_createshape_system_intptr_system_intptr_ks_reactor_ksvector3__ks_r"></a>

```csharp
public static IntPtr CreateShape(IntPtr geometry, IntPtr material, ref ksVector3 position, ref ksQuaternion rotation, bool isExlusive)
```

#### Parameters

`geometry` [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

`material` [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

`position` ksVector3

`rotation` ksQuaternion

`isExlusive` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Returns

[IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

### CreateTriangleMesh(ksVector3\[], uint\[]) <a href="#ks_reactor_server_physx_pxphysics_createtrianglemesh_ks_reactor_ksvector3___system_uint32" id="ks_reactor_server_physx_pxphysics_createtrianglemesh_ks_reactor_ksvector3___system_uint32"></a>

```csharp
public static IntPtr CreateTriangleMesh(ksVector3[] vertices, uint[] triangles)
```

#### Parameters

`vertices` ksVector3\[]

`triangles` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)\[]

#### Returns

[IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

### Initialize(string, int, uint) <a href="#ks_reactor_server_physx_pxphysics_initialize_system_string_system_int32_system_uint32" id="ks_reactor_server_physx_pxphysics_initialize_system_string_system_int32_system_uint32"></a>

```csharp
public static void Initialize(string pvdHost, int pvdPort, uint threads)
```

#### Parameters

`pvdHost` [string](https://learn.microsoft.com/dotnet/api/system.string)

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

`threads` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

### RegisterLogCallback(string, LogCallback, byte, byte) <a href="#ks_reactor_server_physx_pxphysics_registerlogcallback_system_string_ks_reactor_server_physx_pxphysic" id="ks_reactor_server_physx_pxphysics_registerlogcallback_system_string_ks_reactor_server_physx_pxphysic"></a>

```csharp
public static extern void RegisterLogCallback(string channel, pxPhysics.LogCallback handler, byte level, byte bubble)
```

#### Parameters

`channel` [string](https://learn.microsoft.com/dotnet/api/system.string)

`handler` [pxPhysics](/reactor/api-reference/ks.reactor.server.physx/ks.reactor.server.physx.pxphysics.md).[LogCallback](/reactor/api-reference/ks.reactor.server.physx/ks.reactor.server.physx.pxphysics/ks.reactor.server.physx.pxphysics.logcallback.md)

`level` [byte](https://learn.microsoft.com/dotnet/api/system.byte)

`bubble` [byte](https://learn.microsoft.com/dotnet/api/system.byte)

### Release() <a href="#ks_reactor_server_physx_pxphysics_release" id="ks_reactor_server_physx_pxphysics_release"></a>

```csharp
public static void Release()
```

### UnregisterLogCallback(string, LogCallback) <a href="#ks_reactor_server_physx_pxphysics_unregisterlogcallback_system_string_ks_reactor_server_physx_pxphys" id="ks_reactor_server_physx_pxphysics_unregisterlogcallback_system_string_ks_reactor_server_physx_pxphys"></a>

```csharp
public static extern void UnregisterLogCallback(string channel, pxPhysics.LogCallback handler)
```

#### Parameters

`channel` [string](https://learn.microsoft.com/dotnet/api/system.string)

`handler` [pxPhysics](/reactor/api-reference/ks.reactor.server.physx/ks.reactor.server.physx.pxphysics.md).[LogCallback](/reactor/api-reference/ks.reactor.server.physx/ks.reactor.server.physx.pxphysics/ks.reactor.server.physx.pxphysics.logcallback.md)
