AAIController::SuggestTossVelocity

Computes a launch velocity vector to toss a projectile and hit the given destination.

Windows
MacOS
Linux

References

Module

AIModule

Header

/Engine/Source/Runtime/AIModule/Classes/AIController.h

Include

#include "AIController.h"

Source

/Engine/Source/Runtime/AIModule/Private/AIController.cpp

Syntax

bool SuggestTossVelocity
(
    FVector & OutTossVelocity,
    FVector Start,
    FVector End,
    float TossSpeed,
    bool bPreferHighArc,
    float CollisionRadius,
    bool bOnlyTraceUp
)

Remarks

Computes a launch velocity vector to toss a projectile and hit the given destination. Performance

Potentially expensive. Nonzero CollisionRadius and bOnlyTraceUp=false are the more expensive options.

Returns

  • true if a valid arc was computed, false if no valid solution could be found

Parameters

Parameter

Description

OutTossVelocity

out param stuffed with the computed velocity to use

Start

desired start point of arc

End

desired end point of arc

TossSpeed

Initial speed of the theoretical projectile. Assumed to only change due to gravity for the entire lifetime of the projectile

CollisionSize

(optional) - is the size of bounding box of the tossed actor (defaults to (0,0,0)

bOnlyTraceUp

(optional) - when true collision checks verifying the arc will only be done along the upward portion of the arc

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss