Merge remote-tracking branch 'origin/master' into 1.9
# Conflicts: # Source/Engine/UI/GUI/Common/Button.cs
This commit is contained in:
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user