NodeWorld

Physics

La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.

csharp
public static class Physics

Namespace NodeWorld.Flux.

Rays and overlaps in the world's colliders, on each player's game (the server has no physics). They go through the avatars, portals and photo cameras NodeWorld puts in the scene.

Constants

DefaultRaycastLayers

csharp
public const int DefaultRaycastLayers = ~0x4

Every layer but Ignore Raycast (layer 2).

AllLayers

csharp
public const int AllLayers = ~0

Every layer.

Properties

gravity

csharp
public static Vector3 gravity { get; }

The gravity of the world's physics.

Methods

Raycast

csharp
public static bool Raycast(Vector3 origin, Vector3 direction, out RaycastHit hitInfo, float maxDistance = float.PositiveInfinity, int layerMask = DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)

The first collider along the ray from origin in direction, within maxDistance and the layers of layerMask: true and hitInfo, or false.

csharp
public static bool Raycast(Ray ray, out RaycastHit hitInfo, float maxDistance = float.PositiveInfinity, int layerMask = DefaultRaycastLayers)

The first collider along the ray, within maxDistance: true and hitInfo, or false.

csharp
public static bool Raycast(Vector3 origin, Vector3 direction, float maxDistance = float.PositiveInfinity, int layerMask = DefaultRaycastLayers)

A collider is along the ray from origin in direction, within maxDistance.

RaycastAll

csharp
public static RaycastHit[] RaycastAll(Vector3 origin, Vector3 direction, float maxDistance = float.PositiveInfinity, int layerMask = DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)

Every hit on a collider of the world along the ray (not sorted, as Unity's).

csharp
public static RaycastHit[] RaycastAll(Ray ray, float maxDistance = float.PositiveInfinity, int layerMask = DefaultRaycastLayers)

Every hit on a collider of the world along the ray (not sorted, 64 at most).

CheckSphere

csharp
public static bool CheckSphere(Vector3 position, float radius, int layerMask = DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)

A collider of the world touches the sphere.

OverlapSphere

csharp
public static Collider[] OverlapSphere(Vector3 position, float radius, int layerMask = AllLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)

The colliders of the world that touch the sphere.