Table of Contents

Class LagCompensation

Namespace
Netick.Pro
Assembly
Netick.Pro.dll
[ExecutionOrder(2000)]
public sealed class LagCompensation : INetickComponent
Inheritance
LagCompensation
Implements
Inherited Members

Constructors

LagCompensation()

public LagCompensation()

Fields

Compensate

public bool Compensate

Field Value

bool

Methods

CanRewind(ServerConnection)

public static bool CanRewind(ServerConnection inputSource)

Parameters

inputSource ServerConnection

Returns

bool

FetchHitShapePosAndRot(LagCompShape, NetworkPlayer, out Vector3, out Quaternion)

public void FetchHitShapePosAndRot(LagCompShape hitShape, NetworkPlayer inputSource, out Vector3 pos, out Quaternion rot)

Parameters

hitShape LagCompShape
inputSource NetworkPlayer
pos Vector3
rot Quaternion

FetchHitShapePosAndRot(LagCompShape, Tick, out Vector3, out Quaternion)

public void FetchHitShapePosAndRot(LagCompShape hitShape, Tick tick, out Vector3 pos, out Quaternion rot)

Parameters

hitShape LagCompShape
tick Tick
pos Vector3
rot Quaternion

NetworkFixedUpdate()

public void NetworkFixedUpdate()

NetworkRender()

public void NetworkRender()

OverlapSphere(Vector3, float, List<NetHit>, NetworkPlayer, int, bool, bool, Predicate<LagCompContainer>)

Performs a lag compensated OverlapSphere which computes and stores HitShapes and Colliders (if includeUnityColliders is equal to true) touching or inside the sphere.

public void OverlapSphere(Vector3 center, float radius, List<NetHit> hits, NetworkPlayer inputSource, int layerMask = -1, bool includeInputSource = false, bool oneHitPerHitShapeContainer = false, Predicate<LagCompContainer> filter = null)

Parameters

center Vector3

Center of the sphere.

radius float

Radius of the sphere.

hits List<NetHit>
inputSource NetworkPlayer

The input source to compensate for.

layerMask int

A defines which layers of colliders to include in the query.

includeInputSource bool
oneHitPerHitShapeContainer bool

Choose whether you want to include only one HitShape per HitShapeContainer

filter Predicate<LagCompContainer>

Raycast(LagCompShape, Vector3, Vector3, out NetHit, NetworkPlayer, float, bool)

public bool Raycast(LagCompShape shape, Vector3 origin, Vector3 direction, out NetHit hitData, NetworkPlayer inputSource, float maxDistance = Infinity, bool includeInputSource = false)

Parameters

shape LagCompShape
origin Vector3
direction Vector3
hitData NetHit
inputSource NetworkPlayer
maxDistance float
includeInputSource bool

Returns

bool

Raycast(Vector3, Vector3, out NetHit, NetworkPlayer, float, int, bool, Predicate<LagCompContainer>)

Casts a lag compensated ray, from point origin, in direction direction, of length maxDistance, against all HitShapes and Colliders (if includeUnityColliders is equal to true) in the Scene.

public bool Raycast(Vector3 origin, Vector3 direction, out NetHit hitData, NetworkPlayer inputSource, float maxDistance = Infinity, int layerMask = -1, bool includeInputSource = false, Predicate<LagCompContainer> filter = null)

Parameters

origin Vector3

The starting point of the ray in world coordinates.

direction Vector3

The direction of the ray.

hitData NetHit
inputSource NetworkPlayer

The input source to compensate for.

maxDistance float

The max distance the ray should check for collisions.

layerMask int

A that is used to selectively ignore Colliders when casting a ray.

includeInputSource bool
filter Predicate<LagCompContainer>

Returns

bool

Returns true if the ray intersects with a Collider/HitShape, otherwise false.

RaycastAll(Vector3, Vector3, List<NetHit>, NetworkPlayer, float, int, bool, bool, Predicate<LagCompContainer>)

Casts a lag compensated ray, from point origin, in direction direction, of length maxDistance, against all HitShapes and in the Scene, and return all hits.

public void RaycastAll(Vector3 origin, Vector3 direction, List<NetHit> hits, NetworkPlayer inputSource, float maxDistance = Infinity, int layerMask = -1, bool includeInputSource = false, bool oneHitPerHitShapeContainer = false, Predicate<LagCompContainer> filter = null)

Parameters

origin Vector3

The starting point of the ray in world coordinates.

direction Vector3

The direction of the ray.

hits List<NetHit>
inputSource NetworkPlayer

The input source to compensate for.

maxDistance float

The max distance the ray should check for collisions.

layerMask int

A that is used to selectively ignore Colliders when casting a ray.

includeInputSource bool
oneHitPerHitShapeContainer bool
filter Predicate<LagCompContainer>