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)Show 15 more
, m_AllowedLiquidSource, m_AllowSeaLevelCursorFallback, m_DebugSyntheticCursor, m_DebugSyntheticCursorShapes, m_HasLastSyntheticHitCursor, m_LastSyntheticHitCursor, m_LastSyntheticHitCursorTime, m_MaxActionDistance, m_MaxVerticalReach, m_SurfaceDetectionParams, m_SurfaceDetectionParamsNoWater, SurfaceDetectionParameters.rsd, SurfaceDetectionParameters.syncMode, SurfaceDetectionParameters.type, and vector.ZeroShow 10 more
, ActionFillBottleBase.ActionCondition(), ActionFishingNew.CreateConditionComponents(), ActionMixMortarAtWater.CreateConditionComponents(), ActionObtainLiquidBase.CreateConditionComponents(), ActionWashHandsSnow.CreateConditionComponents(), ActionWashHandsWater.CreateConditionComponents(), ActionWashHandsWaterOne.CreateConditionComponents(), ActionWashHeadWater.CreateConditionComponents(), ActionWashHeadWell.CreateConditionComponents(), and ActionWetClothingInHandsWater.CreateConditionComponents()Constants 14
protected static const float HIT_POS_TOLERANCE = 1.0protected static const float HIT_POS_TOLERANCE_SQ = HIT_POS_TOLERANCE * HIT_POS_TOLERANCEprotected static const float SEA_FALLBACK_DISTANCE_BUFFER = 1.5protected static const float SYNTHETIC_POND_SAMPLE_STEP = 1.0protected static const float SYNTHETIC_POND_SURFACE_TOLERANCE = 0.35protected static const float SYNTHETIC_POND_FALLBACK_SURFACE_TOLERANCE = 1.75protected static const float SYNTHETIC_CURSOR_DISTANCE_BUFFER = 1.5protected static const float SEA_CURSOR_STICK_DISTANCE = 0.75protected static const int SEA_CURSOR_STICK_TIME_MS = 350protected static const float SYNTHETIC_CURSOR_CACHE_AIM_TOLERANCE = 1.75protected static const int SYNTHETIC_CURSOR_CACHE_MAX_AGE_MS = 350protected static const float SEA_HIT_RAW_Y_TOLERANCE = 1.25protected static const float SEA_CURSOR_MIN_DOWN_DOT = 0.035protected static const float LIQUID_SURFACE_RAYCAST_OFFSET = 0.2Members 14
protected vector m_LastSyntheticHitCursorShow 1 more
, TryUseCachedSyntheticCursor()protected bool m_HasLastSyntheticHitCursorShow 1 more
, TryUseCachedSyntheticCursor()protected int m_LastSyntheticHitCursorTimeShow 1 more
, TryUseCachedSyntheticCursor()protected float m_MaxVerticalReachShow 3 more
, IsValidTargetObject(), TryBuildSeaLevelHitPosition(), and TryGetNormalizedSeaHitPoint()protected float m_MaxActionDistanceprotected int m_AllowedLiquidSourceShow 2 more
, TryBuildSyntheticCursor(), and TryValidateHitCursor()protected ref SurfaceDetectionParameters m_SurfaceDetectionParamsprotected ref SurfaceDetectionParameters m_SurfaceDetectionParamsNoWaterprotected int m_LiquidType = LIQUID_NONEprotected int m_WaterSourceType = EWaterSourceObjectType.NONEprotected int m_LiquidSourceType = ELiquidSourceObjectType.NONEprotected bool m_AllowSeaLevelCursorFallbackprotected bool m_DebugSyntheticCursorDIAG_DEVELOPERShow 2 more
, TryBuildSeaLevelHitPosition(), and TryResolveSyntheticCursor()protected ref array<Shape> m_DebugSyntheticCursorShapesDIAG_DEVELOPERMethods 31
override bool Can(PlayerBase player, ActionTarget target)Show 31 more
, array.Count(), DbgUI.End(), array.Find(), string.Format(), Object.GetActionComponentsForSelectionName(), DiagMenu.GetBool(), ActionTarget.GetComponentIndex(), ActionTarget.GetCursorHitPos(), Object.GetLiquidSourceObjectType(), Object.GetLiquidSourceType(), ActionTarget.GetObject(), Object.GetPosition(), Object.GetPosition(), Object.GetViewGeometryLevel(), Object.GetWaterSourceObjectType(), ActionTarget.IsProxy(), IsValidLiquid(), IsValidTargetObject(), Object.IsWell(), ActionTarget.SetCursorHitPos(), DbgUI.Text(), new TIntArray(), TryResolveSyntheticCursor(), string.Empty, UAMisc.LIQUID_SOURCE_SELECTION, m_AllowSeaLevelCursorFallback, m_DebugSyntheticCursor, m_LiquidSourceType, m_LiquidType, m_WaterSourceType, and vector.ZeroFishing/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.
protected bool IsValidTargetObject(vector playerPos, vector objectPosition, EWaterSourceObjectType waterSourceType, ELiquidSourceObjectType liquidSourceType, bool isProxy)Show 2 more
, m_MaxActionDistance, and m_MaxVerticalReachprotected bool CheckSurfaceLiquid(PlayerBase player, Object targetObj, vector hitPosition, vector playerPos, bool isValidInteract, out string surfaceType)Check vertical distance
Show 16 more
, SurfaceInfo.GetLiquidType(), CGame.GetSurface(), SurfaceInfo.GetSurfaceType(), HasClearPathToLiquidSurface(), IsCursorActuallyOnLiquidSurface(), IsNearlyZero(), new SurfaceDetectionResult(), string.Empty, SurfaceDetectionResult.height, LIQUID_SURFACE_RAYCAST_OFFSET, m_LiquidType, m_MaxActionDistance, m_MaxVerticalReach, m_SurfaceDetectionParams, SurfaceDetectionParameters.position, and SurfaceDetectionResult.surfaceprotected bool HasClearPathToLiquidSurface(PlayerBase player, vector surfacePos)Do not allow water merely below grass/terrain.
Show 1 more
, TryValidateHitCursor()Something solid is between player and the liquid point.
protected bool TryGetLiquidSurfaceAt(vector probePosition, out vector surfacePosition, out int liquidType, out string surfaceType)protected bool TryBuildSeaLevelHitPosition(PlayerBase player, vector playerPos, out vector seaHitPosition)Show 21 more
, vector.DistanceSq(), DbgUI.End(), string.Format(), CGame.GetCurrentCameraDirection(), CGame.GetCurrentCameraPosition(), HasClearPathToLiquidSurface(), CGame.IsHeadlessOrDedicatedServer(), IsSeaHitPositionValid(), vector.Normalize(), CGame.SurfaceGetSeaLevel(), CGame.SurfaceGetSeaLevelMax(), DbgUI.Text(), vector.ToString(), vector.ToString(), LIQUID_SURFACE_RAYCAST_OFFSET, m_DebugSyntheticCursor, m_MaxActionDistance, m_MaxVerticalReach, SEA_CURSOR_MIN_DOWN_DOT, SEA_FALLBACK_DISTANCE_BUFFER, and vector.ZeroApply small deadband/sticky cache.
protected bool TryBuildPondHitPosition(PlayerBase player, vector playerPos, out vector pondHitPosition)Show 20 more
, DbgUI.End(), string.Format(), CGame.GetCurrentCameraDirection(), CGame.GetCurrentCameraPosition(), HasClearPathToLiquidSurface(), IsAllowedPondLiquidSurface(), CGame.IsHeadlessOrDedicatedServer(), IsNearlyZero(), IsValidPondHitPosition(), vector.Normalize(), DbgUI.Text(), TryGetLiquidSurfaceAt(), LIQUID_SURFACE_RAYCAST_OFFSET, m_DebugSyntheticCursor, m_MaxActionDistance, SYNTHETIC_CURSOR_DISTANCE_BUFFER, SYNTHETIC_POND_FALLBACK_SURFACE_TOLERANCE, SYNTHETIC_POND_SAMPLE_STEP, SYNTHETIC_POND_SURFACE_TOLERANCE, and vector.Zeroprotected bool IsValidPondHitPosition(vector playerPos, vector hitPosition, int liquidType = LIQUID_NONE)Last chance: use closest sampled surface if it was very close.
protected bool TryGetNormalizedSeaHitPoint(vector playerPos, vector hitPosition, out vector normalizedHit)protected bool TryBuildSyntheticCursor(PlayerBase player, vector playerPos, out vector syntheticHitPosition, out int syntheticLiquidType)Preserve ValidateDistances() vertical behavior for normalized sea hits.
Show 2 more
, m_AllowedLiquidSource, and vector.Zeroprotected bool TryResolveSyntheticCursor(PlayerBase player, vector playerPos, vector currentHitPosition, out vector resolvedHitPosition, out int resolvedLiquidType)Let final validation detect exact liquid type.
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.
Show 1 more
, vector.Zeroprotected vector ApplySyntheticHitCursorStability(vector playerPos, vector candidate, int liquidType)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.
Important: cached cursor must still match current aim.
Do not allow using a cached point far beyond the active aim range.
Show 1 more
, vector.ZeroIf there is no real hit, compare cached point to current camera ray.
Show 3 more
, m_AllowedLiquidSource, m_MaxActionDistance, and m_MaxVerticalReachCheck 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.
int GetWaterSourceType()int GetLiquidSourceType()protected void ClearDebugCursorShapes()DIAG_DEVELOPERShow 1 more
, m_DebugSyntheticCursorShapesprotected void DebugDrawSyntheticCursor(PlayerBase player, vector originalHitPosition, vector cursorHitPosition, bool accepted, string reason, int liquidType = LIQUID_NONE)DIAG_DEVELOPER