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

# Class ksBaseServerPhysics

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

Extended server physics base class available on the server.

```csharp
public abstract class ksBaseServerPhysics : ksBasePhysics
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) â† ksBasePhysics â† [ksBaseServerPhysics](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksbaseserverphysics.md)

#### Inherited Members

ksBasePhysics.AutoSync, ksBasePhysics.Gravity, ksBasePhysics.m\_gravity, ksBasePhysics.SyncAll(), ksBasePhysics.SyncTransforms(), ksBasePhysics.RaycastAny(ksRaycastParams), ksBasePhysics.RaycastNearest(ksRaycastParams, out ksRaycastResult), ksBasePhysics.Raycast(ksRaycastParams), ksBasePhysics.SweepAny(ksSweepParams), ksBasePhysics.SweepNearest(ksSweepParams, out ksSweepResult), ksBasePhysics.Sweep(ksSweepParams), ksBasePhysics.OverlapAny(ksOverlapParams), ksBasePhysics.Overlap(ksOverlapParams), ksBasePhysics.ComputePenetration(ksICollider, ksVector3, ksQuaternion, ksICollider, ksVector3, ksQuaternion, out ksVector3, out float), ksBasePhysics.GetClosestPoint(ksVector3, ksICollider), ksBasePhysics.GetClosestPoint(ksVector3, ksICollider, ksVector3, ksQuaternion), ksBasePhysics.CreateSimulationQueryParams(ksIEntity, bool), ksBasePhysics.Depenetrate(ksOverlapParams, out ksVector3, ksBasePhysics.DepenetrateCallback, float), ksBasePhysics.SweepAndSlide(ksSweepSlideParams, out ksVector3), [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

### Gravity <a href="#ks_reactor_server_ksbaseserverphysics_gravity" id="ks_reactor_server_ksbaseserverphysics_gravity"></a>

Get/Set the current gravity in the scene Attention: Component updates (Physics.Gravity.Y = 1) will not compile. Instead reassign the gravity using a set (Physics.Gravity = new Vector3())

```csharp
public ksVector3 Gravity { get; set; }
```

#### Property Value

ksVector3

## Methods

### ApplyExplosiveForce(ksVector3, float, float, Interpolation, uint, float, ksForceMode, RigidBodyFilter) <a href="#ks_reactor_server_ksbaseserverphysics_applyexplosiveforce_ks_reactor_ksvector3_system_single_system" id="ks_reactor_server_ksbaseserverphysics_applyexplosiveforce_ks_reactor_ksvector3_system_single_system"></a>

Applies an explosive force to all rigid bodies that overlap a sphere. The force is applied at the point on the rigid body nearest to the `origin` of the explosion. Trigger colliders are ignored when finding the nearest point. The force is weaker the further this point is from the explosion `origin`. The force points in the direction of a line starting at the explosion `origin` and ending at the nearest point where the force is applied. If the rigid body overlaps the explosion `origin`, the rigid body's center of mass is used as the end point for calculating the force direction instead.

```csharp
public abstract void ApplyExplosiveForce(ksVector3 origin, float radius, float force, ksMath.Interpolation falloff = Interpolation.LINEAR, uint groupMask = 4294967295, float upwardsModifier = 0, ksForceMode mode = ksForceMode.IMPULSE, ksBaseServerPhysics.RigidBodyFilter filter = null)
```

#### Parameters

`origin` ksVector3

The origin of the explosion.

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

The explosion radius. If zero or less, this function does nothing.

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

How much force to apply at the `origin` of the explosion.

`falloff` ksMath.Interpolation

The falloff equation type for calculating the force at a distance from the `origin`. Use [CONSTANT](/reactor/api-reference/ks.reactor/ks.reactor.ksmath/ks.reactor.ksmath.interpolation.md#KS_Reactor_ksMath_Interpolation_CONSTANT) to use the full force regardless of the distance.

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

Only rigid bodies belonging to at least one of the collision groups in this group mask will be affected.

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

When calculating the force direction, the `origin` is shifted down this amount to shift the resulting direction upwards and make the explosion lift object upwards.

`mode` ksForceMode

The type of force to apply. Defaults to impulse.

`filter` [ksBaseServerPhysics](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksbaseserverphysics.md).[RigidBodyFilter](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksbaseserverphysics/ks.reactor.server.ksbaseserverphysics.rigidbodyfilter.md)

Delegate for filtering which rigid bodies to apply the force to. Returns true to apply the force.

### SyncGravity() <a href="#ks_reactor_server_ksbaseserverphysics_syncgravity" id="ks_reactor_server_ksbaseserverphysics_syncgravity"></a>

Syncs gravity with the physics system.

```csharp
protected abstract void SyncGravity()
```

### SyncMassProperties() <a href="#ks_reactor_server_ksbaseserverphysics_syncmassproperties" id="ks_reactor_server_ksbaseserverphysics_syncmassproperties"></a>

Builds [InertiaTensor](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksbaserigidbody.md#KS_Reactor_Server_ksBaseRigidBody_InertiaTensor), [InertiaTensorRotation](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksbaserigidbody.md#KS_Reactor_Server_ksBaseRigidBody_InertiaTensorRotation), and [CenterOfMass](/reactor/api-reference/ks.reactor.server/ks.reactor.server.ksbaserigidbody.md#KS_Reactor_Server_ksBaseRigidBody_CenterOfMass) for rigid bodies whose values need to be rebuilt. You should not need to call this if [AutoSync](/reactor/api-reference/ks.reactor/ks.reactor.ksbasephysics.md#KS_Reactor_ksBasePhysics_AutoSync) is true, as they will be built automatically when needed if you access the getters.

```csharp
public abstract void SyncMassProperties()
```
