Class LagCompensation
[ExecutionOrder(2000)]
public sealed class LagCompensation : INetickComponent
- Inheritance
-
LagCompensation
- Implements
- Inherited Members
Constructors
LagCompensation()
public LagCompensation()
Fields
Compensate
public bool Compensate
Field Value
Methods
CanRewind(ServerConnection)
public static bool CanRewind(ServerConnection inputSource)
Parameters
inputSourceServerConnection
Returns
FetchHitShapePosAndRot(LagCompShape, NetworkPlayer, out Vector3, out Quaternion)
public void FetchHitShapePosAndRot(LagCompShape hitShape, NetworkPlayer inputSource, out Vector3 pos, out Quaternion rot)
Parameters
hitShapeLagCompShapeinputSourceNetworkPlayerposVector3rotQuaternion
FetchHitShapePosAndRot(LagCompShape, Tick, out Vector3, out Quaternion)
public void FetchHitShapePosAndRot(LagCompShape hitShape, Tick tick, out Vector3 pos, out Quaternion rot)
Parameters
hitShapeLagCompShapetickTickposVector3rotQuaternion
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
centerVector3Center of the sphere.
radiusfloatRadius of the sphere.
hitsList<NetHit>inputSourceNetworkPlayerThe input source to compensate for.
layerMaskintA defines which layers of colliders to include in the query.
includeInputSourcebooloneHitPerHitShapeContainerboolChoose whether you want to include only one HitShape per HitShapeContainer
filterPredicate<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
shapeLagCompShapeoriginVector3directionVector3hitDataNetHitinputSourceNetworkPlayermaxDistancefloatincludeInputSourcebool
Returns
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
originVector3The starting point of the ray in world coordinates.
directionVector3The direction of the ray.
hitDataNetHitinputSourceNetworkPlayerThe input source to compensate for.
maxDistancefloatThe max distance the ray should check for collisions.
layerMaskintA that is used to selectively ignore Colliders when casting a ray.
includeInputSourceboolfilterPredicate<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
originVector3The starting point of the ray in world coordinates.
directionVector3The direction of the ray.
hitsList<NetHit>inputSourceNetworkPlayerThe input source to compensate for.
maxDistancefloatThe max distance the ray should check for collisions.
layerMaskintA that is used to selectively ignore Colliders when casting a ray.
includeInputSourcebooloneHitPerHitShapeContainerboolfilterPredicate<LagCompContainer>