Fix compilation warnings on large worlds

This commit is contained in:
Wojtek Figat
2024-09-19 17:04:31 +02:00
parent 93d9b9877c
commit ba701eb4d3
3 changed files with 11 additions and 13 deletions

View File

@@ -396,8 +396,8 @@ void BehaviorTreeMoveToNode::GetAgentSize(Actor* agent, float& outRadius, float&
// Estimate actor bounds to extract capsule information
const BoundingBox box = agent->GetBox();
const BoundingSphere sphere = agent->GetSphere();
outRadius = sphere.Radius;
outHeight = box.GetSize().Y;
outRadius = (float)sphere.Radius;
outHeight = (float)box.GetSize().Y;
}
int32 BehaviorTreeMoveToNode::GetStateSize() const
@@ -522,7 +522,7 @@ String BehaviorTreeMoveToNode::GetDebugInfo(const BehaviorUpdateContext& context
goal = state->GoalLocation.ToString();
const Vector3 agentLocation = state->Agent->GetPosition();
const Vector3 agentLocationOnPath = agentLocation + state->AgentOffset;
float distanceLeft = state->Path.Count() > state->TargetPathIndex ? Vector3::Distance(state->Path[state->TargetPathIndex], agentLocationOnPath) : 0;
Real distanceLeft = state->Path.Count() > state->TargetPathIndex ? Vector3::Distance(state->Path[state->TargetPathIndex], agentLocationOnPath) : 0;
for (int32 i = state->TargetPathIndex; i < state->Path.Count(); i++)
distanceLeft += Vector3::Distance(state->Path[i - 1], state->Path[i]);
return String::Format(TEXT("Agent: '{}'\nGoal: '{}'\nDistance: {}"), agent, goal, (int32)distanceLeft);
@@ -559,7 +559,7 @@ void BehaviorTreeMoveToNode::State::OnUpdate()
const float acceptableHeightPercentage = 1.05f;
const float testHeight = agentHeight * acceptableHeightPercentage;
const Vector3 toGoal = agentLocationOnPath - pathSegmentEnd;
const float toGoalHeightDiff = (toGoal * UpVector).SumValues();
const Real toGoalHeightDiff = (toGoal * UpVector).SumValues();
if (toGoal.Length() <= testRadius && toGoalHeightDiff <= testHeight)
{
TargetPathIndex++;