class CCTLiquid
CCTLiquid › CCTBase
Lightweight liquid target condition.
Handles the two paths that every liquid action needs: - liquid source objects (wells, barrels, ...) - liquid surfaces under the real (engine provided) action cursor
The camera based synthetic cursor / sea level cursor reconstruction lives in CCTLiquidSyntheticCursor, so actions that do not need it (drinking, filling, washing, snow, ...) never pay for it.
All engine queries go through CCTLiquidFrameProbe, which shares them between every liquid condition evaluated in the same frame. This class only holds the per action parameters (liquid mask, reach) and applies them to the shared result.
Constructors 1
void CCTLiquid(int allowedLiquidSource, float maximalTargetDistance = UAMaxDistances.DEFAULT, float maxVerticalReach = UAMaxDistances.DEFAULT, SurfaceDetectionType surfaceDetectionType = SurfaceDetectionType.Roadway, bool allowSeaLevelCursorFallback = false)allowSeaLevelCursorFallback- kept for signature compatibility only, it has no effect here. Use CCTLiquidSyntheticCursor if you need the camera based cursor reconstruction.
Show 6 more
, m_CanBeSaltwater, m_MaxActionDistance, m_MaxActionDistanceSq, m_MaxVerticalReach, m_Probe, and m_SurfaceDetectionTypeShow 9 more
, ActionFillBottleBase.CreateConditionComponents(), ActionMixMortarAtWater.CreateConditionComponents(), ActionObtainLiquidBase.CreateConditionComponents(), ActionWashHandsSnow.CreateConditionComponents(), ActionWashHandsWater.CreateConditionComponents(), ActionWashHandsWaterOne.CreateConditionComponents(), ActionWashHeadWater.CreateConditionComponents(), ActionWashHeadWell.CreateConditionComponents(), and ActionWetClothingInHandsWater.CreateConditionComponents()Constants 3
protected const float LIQUID_SURFACE_RAYCAST_OFFSET = 0.2protected const float MAX_HEIGHT_DIFF_SURFACE = 0.25protected const float SEA_HIT_RAW_Y_TOLERANCE = 1.25Members 12
protected float m_MaxVerticalReachprotected float m_MaxActionDistanceprotected float m_MaxActionDistanceSqprotected int m_AllowedLiquidSourceprotected int m_SurfaceDetectionTypeprotected bool m_CanBeSaltwaterPrecomputed mask tests, so the per-frame paths are plain bool reads.
Show 1 more
, CCTLiquidSyntheticCursor.TryValidateHitCursor()protected bool m_CanBeFreshwaterprotected CCTLiquidFrameProbe m_ProbeShared, frame scoped engine queries.
protected int m_LiquidType = LIQUID_NONEShow 2 more
, GetLiquidType(), and CCTLiquidSyntheticCursor.ResolveSyntheticCursor()protected int m_WaterSourceType = EWaterSourceObjectType.NONEprotected int m_LiquidSourceType = ELiquidSourceObjectType.NONEprotected string m_ProfilerName = "CCTLiquid::Can"DIAG_DEVELOPERMethods 17
override bool Can(PlayerBase player, ActionTarget target)protected bool CanInternal(PlayerBase player, ActionTarget target)Show 21 more
, ActionTarget.GetComponentIndex(), ActionTarget.GetCursorHitPos(), Object.GetLiquidSourceObjectType(), Object.GetLiquidSourceType(), ActionTarget.GetObject(), Object.GetPosition(), Object.GetPosition(), Object.GetWaterSourceObjectType(), ActionTarget.IsProxy(), IsValidLiquid(), IsValidTargetObject(), Object.IsWell(), CCTLiquidFrameProbe.IsWellComponentValid(), IsWellInReach(), ResolveSyntheticCursor(), m_CanBeSaltwater, m_LiquidSourceType, m_LiquidType, m_Probe, m_SurfaceDetectionType, and m_WaterSourceTypeprotected bool ResolveSyntheticCursor(PlayerBase player, vector playerPos, ActionTarget target, Object targetObj, vector hitPosition)Hook for camera based cursor reconstruction. The base condition has none.
Returns: true when the cursor was resolved and m_LiquidType was set, the caller must then not run the generic surface checks.
protected bool IsValidTargetObject(vector playerPos, vector objectPosition, EWaterSourceObjectType waterSourceType, ELiquidSourceObjectType liquidSourceType, bool isProxy)Show 2 more
, m_MaxActionDistanceSq, and m_MaxVerticalReachprotected bool IsWellInReach(PlayerBase player, vector playerPos, Object well, vector hitPosition)Check vertical distance first, it is the cheaper of the two.
protected bool CheckSurfaceLiquid(PlayerBase player, Object targetObj, vector hitPosition, vector playerPos, out bool hasSurfaceType)protected bool HasClearPathToLiquidSurface(PlayerBase player, vector surfacePos)Do not allow water merely below grass/terrain.
protected bool TryGetNormalizedSeaHitPoint(vector playerPos, vector hitPosition, out vector normalizedHit)Engine query last.
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 GetLiquidType()int GetWaterSourceType()int GetLiquidSourceType()