DIFF

class CCTLiquid

CCTLiquid › CCTBase

Constructors 1

void CCTLiquid(int allowedLiquidSource, float maximalTargetDistance = UAMaxDistances.DEFAULT, float maxVerticalReach = UAMaxDistances.DEFAULT, SurfaceDetectionType surfaceDetectionType = SurfaceDetectionType.Roadway, bool allowSeaLevelCursorFallback = false)

Constants 14

protected static const float HIT_POS_TOLERANCE = 1.0
protected static const float HIT_POS_TOLERANCE_SQ = HIT_POS_TOLERANCE * HIT_POS_TOLERANCE
protected static const float SEA_FALLBACK_DISTANCE_BUFFER = 1.5
protected static const float SYNTHETIC_POND_SAMPLE_STEP = 1.0
protected static const float SYNTHETIC_POND_SURFACE_TOLERANCE = 0.35
protected static const float SYNTHETIC_POND_FALLBACK_SURFACE_TOLERANCE = 1.75
protected static const float SYNTHETIC_CURSOR_DISTANCE_BUFFER = 1.5
protected static const float SEA_CURSOR_STICK_DISTANCE = 0.75
protected static const int SEA_CURSOR_STICK_TIME_MS = 350
protected static const float SYNTHETIC_CURSOR_CACHE_AIM_TOLERANCE = 1.75
protected static const int SYNTHETIC_CURSOR_CACHE_MAX_AGE_MS = 350
protected static const float SEA_HIT_RAW_Y_TOLERANCE = 1.25
protected static const float SEA_CURSOR_MIN_DOWN_DOT = 0.035
protected static const float LIQUID_SURFACE_RAYCAST_OFFSET = 0.2

Members 14

protected vector m_LastSyntheticHitCursor
protected bool m_HasLastSyntheticHitCursor
protected int m_LastSyntheticHitCursorTime
protected int m_AllowedLiquidSource
protected ref SurfaceDetectionParameters m_SurfaceDetectionParams
protected ref SurfaceDetectionParameters m_SurfaceDetectionParamsNoWater
protected int m_LiquidType = LIQUID_NONE
Referenced by Can(), CheckSeaLevelFallback(), CheckSurfaceLiquid()
Show 1 more, GetLiquidType()
protected int m_WaterSourceType = EWaterSourceObjectType.NONE
Referenced by Can(), and GetWaterSourceType()
protected int m_LiquidSourceType = ELiquidSourceObjectType.NONE
Referenced by Can(), and GetLiquidSourceType()
protected bool m_AllowSeaLevelCursorFallback
Referenced by Can(), and CCTLiquid()
protected bool m_DebugSyntheticCursorDIAG_DEVELOPER
protected ref array<Shape> m_DebugSyntheticCursorShapesDIAG_DEVELOPER

Methods 31

protected bool IsValidLiquid(int liquid)

Fishing/synthetic/sea-normalized cursor path For fishing or other synthetic cursor actions, do not fall through to generic surface checks. If the synthetic cursor cannot be resolved, the action should not be available.

Referenced by Can()
protected bool IsValidTargetObject(vector playerPos, vector objectPosition, EWaterSourceObjectType waterSourceType, ELiquidSourceObjectType liquidSourceType, bool isProxy)
Referenced by Can()
protected bool CheckSeaLevelFallback(vector hitPosition, vector playerPos)

Something solid is between player and the liquid point.

Referenced by Can()
protected bool IsSeaHitPositionValid(vector playerPos, vector hitPosition)

Apply small deadband/sticky cache.

protected bool IsValidPondHitPosition(vector playerPos, vector hitPosition, int liquidType = LIQUID_NONE)

Last chance: use closest sampled surface if it was very close.

protected bool TryBuildSyntheticCursor(PlayerBase player, vector playerPos, out vector syntheticHitPosition, out int syntheticLiquidType)

Preserve ValidateDistances() vertical behavior for normalized sea hits.

protected bool TryResolveSyntheticCursor(PlayerBase player, vector playerPos, vector currentHitPosition, out vector resolvedHitPosition, out int resolvedLiquidType)

Let final validation detect exact liquid type.

Referenced by Can()
protected bool TryValidatePondHitPosition(vector playerPos, vector hitPosition, out vector surfacePos, out int liquidType, out string surfaceType, int expectedLiquidType = LIQUID_NONE)

Validate the generated cursor once.

protected void ClearSyntheticCursorCache()

If caller expected a specific liquid mask/type, require compatibility.

protected bool TryValidateHitCursor(PlayerBase player, vector playerPos, vector hitPosition, out vector resolvedHitPosition, out int resolvedLiquidType)
protected bool TryUseCachedSyntheticCursor(PlayerBase player, vector playerPos, vector currentHitPosition, out vector resolvedHitPosition, out int resolvedLiquidType)

Freshwater / pond path.

protected bool IsPositionNearCurrentCameraRay(vector position, float maxPerpendicularDistance)

Important: cached cursor must still match current aim.

protected bool IsCachedSyntheticCursorRelevant(vector currentHitPosition, vector cachedHitPosition)

Do not allow using a cached point far beyond the active aim range.

protected bool IsAllowedPondLiquidSurface(vector playerPos, vector surfacePos, int liquidType)

If there is no real hit, compare cached point to current camera ray.

protected bool IsCursorActuallyOnLiquidSurface(vector hitPosition, vector liquidSurfacePos)

Check if we have the same or an other liquid surface

override bool CanContinue(PlayerBase player, ActionTarget target)

If terrain/grass/road surface is higher, the player is aiming at ground over/near water, not the water itself.

References Can()
int GetWaterSourceType()
int GetLiquidSourceType()
protected void ClearDebugCursorShapes()DIAG_DEVELOPER