Physics
public static class PhysicsNamespace 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
public const int DefaultRaycastLayers = ~0x4Every layer but Ignore Raycast (layer 2).
AllLayers
public const int AllLayers = ~0Every layer.
Properties
gravity
public static Vector3 gravity { get; }The gravity of the world's physics.
Methods
Raycast
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.
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.
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
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).
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
public static bool CheckSphere(Vector3 position, float radius, int layerMask = DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)A collider of the world touches the sphere.
OverlapSphere
public static Collider[] OverlapSphere(Vector3 position, float radius, int layerMask = AllLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal)The colliders of the world that touch the sphere.
