Adventure Kit  4.16
Public Member Functions | Public Attributes | List of all members
AAdvKitZone Class Reference

Zones are special movement objects that a character can use for specific movement modes. More...

#include <AdvKitZone.h>

Inheritance diagram for AAdvKitZone:
AAdvKitZoneLine AAdvKitZoneRectangle AAdvKitZoneSpline

Public Member Functions

 AAdvKitZone (const FObjectInitializer &ObjectInitializer)
 
void GenerateTransitions (bool bZoneMoved=true)
 
virtual void GenerateTransitions_Implementation (bool bZoneMoved=true)
 
virtual void AddTransition (TSubclassOf< AAdvKitCharacter > For, class UAdvKitTransitionComponent *Transition)
 
virtual void RemoveExistingTransitionsTo (class AAdvKitZone *Other)
 
virtual bool IsPointInside (const FVector &WorldPosition, float ErrorMargin=0.1f)
 
virtual TArray< class UAdvKitTransitionComponent * > GetPossibleTransitions (const class AAdvKitCharacter *ForCharacter)
 
FVector GetPositionInDirection (const FVector &FromWorldPosition, const FVector &WorldDesiredDelta, bool bClamp, const FVector &HalfExtent, const FRotator &ExtentWorldRotation=FRotator::ZeroRotator)
 
virtual FVector GetPositionInDirection_Implementation (const FVector &FromWorldPosition, const FVector &WorldDesiredDelta, bool bClamp, const FVector &HalfExtent, const FRotator &ExtentWorldRotation=FRotator::ZeroRotator)
 
virtual bool MoveLocationInDirection (UAdvKitZoneLocation *LocationToMove, const FVector &WorldDesiredDelta, const FVector &HalfExtent, const FRotator &ExtentWorldRotation=FRotator::ZeroRotator)
 
virtual FVector GetZoneForwardVector (const UAdvKitZoneLocation *AtLocation)
 
virtual FVector GetZoneRightVector (const UAdvKitZoneLocation *AtLocation)
 
virtual FVector GetZoneUpVector (const UAdvKitZoneLocation *AtLocation)
 
FVector ConstrainPositionToZone (const FVector &WorldPosition, const FVector &HalfExtent, const FRotator &ExtentWorldRotation=FRotator::ZeroRotator) const
 
virtual FVector ConstrainPositionToZone_Implementation (const FVector &WorldPosition, const FVector &HalfExtent, const FRotator &ExtentWorldRotation=FRotator::ZeroRotator) const
 
virtual EAdvKitMovementMode GetPhysics ()
 
virtual uint8 GetCustomPhysics ()
 
virtual bool HasPhysics (EAdvKitMovementMode QueryPhysics)
 
virtual bool HasCustomPhysics (uint8 QueryPhysics)
 
void SetCharacterClass (TSubclassOf< AAdvKitCharacter > CharacterClass)
 
void AddCharacterClass (TSubclassOf< AAdvKitCharacter > CharacterClass)
 
void RemoveCharacterClass (TSubclassOf< AAdvKitCharacter > CharacterClass)
 
bool IsCharacterSupported (AAdvKitCharacter *Character)
 
virtual bool MoveLocationInDirectionNew (FVector &LocalZoneLocation, const FVector &WorldDesiredDelta, const FVector &HalfExtent, const FRotator &ExtentWorldRotation=FRotator::ZeroRotator)
 
virtual FVector GetZoneLocationWorld (const FVector &LocalZoneLocation) const
 
virtual FVector GetZoneLocationLocal (const FVector &WorldLocation) const
 
FVector GetZoneForwardVectorNew (const FVector &LocalZoneLocation) const
 
virtual FVector GetZoneForwardVectorNew_Implementation (const FVector &LocalZoneLocation) const
 
FVector GetZoneRightVectorNew (const FVector &LocalZoneLocation) const
 
virtual FVector GetZoneRightVectorNew_Implementation (const FVector &LocalZoneLocation) const
 
FVector GetZoneUpVectorNew (const FVector &LocalZoneLocation) const
 
virtual FVector GetZoneUpVectorNew_Implementation (const FVector &LocalZoneLocation) const
 
FVector GetClosestZoneForwardVector (const FVector &ToWorldLocation) const
 
virtual FVector GetClosestZoneForwardVector_Implementation (const FVector &ToWorldLocation) const
 
FVector GetClosestZoneRightVector (const FVector &ToWorldLocation) const
 
virtual FVector GetClosestZoneRightVector_Implementation (const FVector &ToWorldLocation) const
 
FVector GetClosestZoneUpVector (const FVector &ToWorldLocation) const
 
virtual FVector GetClosestZoneUpVector_Implementation (const FVector &ToWorldLocation) const
 
virtual FTransform GetClosestZoneTransform (const FVector &ToWorldLocation) const
 
FVector GetClosestZoneLocationNew (const FVector &WorldLocation, const FVector &HalfExtent, const FRotator &ExtentWorldRotation=FRotator::ZeroRotator) const
 
virtual FVector GetClosestZoneLocationNew_Implementation (const FVector &WorldLocation, const FVector &HalfExtent, const FRotator &ExtentWorldRotation=FRotator::ZeroRotator) const
 
FVector ConstrainDirectionToZone (const FVector &WorldDirection, const FVector &AtWorldLocation) const
 
virtual FVector ConstrainDirectionToZone_Implementation (const FVector &WorldDirection, const FVector &AtWorldLocation) const
 
virtual bool IsNameStableForNetworking () const override
 
virtual bool IsSupportedForNetworking () const override
 

Public Attributes

EAdvKitMovementMode ZonePhysics
 
uint8 CustomZonePhysics
 
TArray< UAdvKitTransitionBuilderModule * > BuildModules
 
bool bDoubleConstructionScriptFix
 

Detailed Description

Zones are special movement objects that a character can use for specific movement modes.

A zone always restricts movement within a specified region, e.g. a line or rectangle. Zones can also have predefined transition points between them.

Constructor & Destructor Documentation

AAdvKitZone::AAdvKitZone ( const FObjectInitializer &  ObjectInitializer)

Constructor

Member Function Documentation

void AAdvKitZone::AddCharacterClass ( TSubclassOf< AAdvKitCharacter CharacterClass)

Adds a character class to all transition build modules if not present, yet

Parameters
CharacterClassCharacter class to add
void AAdvKitZone::AddTransition ( TSubclassOf< AAdvKitCharacter For,
class UAdvKitTransitionComponent Transition 
)
virtual

Add an existing transition to the transitions list

Parameters
ForCharacter class that can use the transition
TransitionThe transition to add
FVector AAdvKitZone::ConstrainDirectionToZone ( const FVector &  WorldDirection,
const FVector &  AtWorldLocation 
) const

Restricts a desired direction to match zone.

Parameters
WorldDirectionDirection to restrict.
AtWorldLocationLocation at which the direction should be constrained. (Since zones may be splines a constrained direction can differ based on location).
Returns
Direction restricted to zone.
FVector AAdvKitZone::ConstrainPositionToZone ( const FVector &  WorldPosition,
const FVector &  HalfExtent,
const FRotator &  ExtentWorldRotation = FRotator::ZeroRotator 
) const

Clamps a given location so it is inside the zone.

Parameters
WorldPositionLocation to clamp.
HalfExtentHalf size of the character, describing its capsule (e.g. capsule radius and half height)
ExtentWorldRotationRotation of the character.
Returns
Location inside zone.
void AAdvKitZone::GenerateTransitions ( bool  bZoneMoved = true)

Creates all transitions for this zone. Called either manually or by a transition builder if an adjacent zone triggers it.

Parameters
bZoneMovedTrue if this zone was moved, false if it not
FVector AAdvKitZone::GetClosestZoneForwardVector ( const FVector &  ToWorldLocation) const

Gets the zone's forward vector closest to a specified point.

Parameters
ToWorldLocationLocation to query the vector at.
Returns
Forward vector in world space.
FVector AAdvKitZone::GetClosestZoneLocationNew ( const FVector &  WorldLocation,
const FVector &  HalfExtent,
const FRotator &  ExtentWorldRotation = FRotator::ZeroRotator 
) const

Creates a new zone location as close to a given location as possible

Parameters
WorldLocationLocation the zone location would ideally be at.
HalfExtentHalf size of the character, describing its capsule (e.g. capsule radius and half height)
ExtentWorldRotationRotation of the character.
Returns
Zone Location inside zone.
FVector AAdvKitZone::GetClosestZoneRightVector ( const FVector &  ToWorldLocation) const

Gets the zone's right vector closest to a specified point.

Parameters
ToWorldLocationLocation to query the vector at.
Returns
Right vector in world space.
FTransform AAdvKitZone::GetClosestZoneTransform ( const FVector &  ToWorldLocation) const
virtual

Gets the zone's transform closest to a specified point.

Parameters
ToWorldLocationLocation to query the vector at.
Returns
Transform closest to the given location.
FVector AAdvKitZone::GetClosestZoneUpVector ( const FVector &  ToWorldLocation) const

Gets the zone's up vector closest to a specified point.

Parameters
ToWorldLocationLocation to query the vector at.
Returns
Up vector in world space.
uint8 AAdvKitZone::GetCustomPhysics ( )
virtual

Get custom movement mode of this zone.

Returns
Custom movement mode inside the zone.
EAdvKitMovementMode AAdvKitZone::GetPhysics ( )
virtual

Get movement mode of this zone.

Returns
Movement mode inside the zone.
FVector AAdvKitZone::GetPositionInDirection ( const FVector &  FromWorldPosition,
const FVector &  WorldDesiredDelta,
bool  bClamp,
const FVector &  HalfExtent,
const FRotator &  ExtentWorldRotation = FRotator::ZeroRotator 
)

Get the next position in this zone in a certain direction. Since zones restrict movement the character can not always move as it desires, but has to adhere to a direction given by the zone.

Parameters
FromWorldPositionWhere the movement starts
WorldDesiredDeltaThe intended direction of the movement
bClampWhether or not to restrict the resulting location to the zone as well
HalfExtentHalf size of the character, describing its capsule (e.g. capsule radius and half height)
ExtentWorldRotationRotation of the character.
Returns
The resulting location after the move was restricted to the zone.
TArray< class UAdvKitTransitionComponent * > AAdvKitZone::GetPossibleTransitions ( const class AAdvKitCharacter ForCharacter)
virtual

Queries all available transitions for a given character.

Parameters
ForCharacterThe character to get transitions for.
Returns
List of all available transitions.
FVector AAdvKitZone::GetZoneForwardVector ( const UAdvKitZoneLocation AtLocation)
virtual

Gets the zone's forward vector at a specified point.

Parameters
AtLocationLocation to query the vector at.
Returns
Forward vector in world space.
FVector AAdvKitZone::GetZoneForwardVectorNew ( const FVector &  LocalZoneLocation) const

Gets the zone's forward vector at a specified point.

Parameters
LocalZoneLocationLocation to query the vector at.
Returns
Forward vector in world space.
FVector AAdvKitZone::GetZoneRightVector ( const UAdvKitZoneLocation AtLocation)
virtual

Gets the zone's right vector at a specified point.

Parameters
AtLocationLocation to query the vector at.
Returns
Right vector in world space.
FVector AAdvKitZone::GetZoneRightVectorNew ( const FVector &  LocalZoneLocation) const

Gets the zone's right vector at a specified point.

Parameters
LocalZoneLocationLocation to query the vector at.
Returns
Right vector in world space.
FVector AAdvKitZone::GetZoneUpVector ( const UAdvKitZoneLocation AtLocation)
virtual

Gets the zone's up vector at a specified point.

Parameters
AtLocationLocation to query the vector at.
Returns
Up vector in world space.
FVector AAdvKitZone::GetZoneUpVectorNew ( const FVector &  LocalZoneLocation) const

Gets the zone's up vector at a specified point.

Parameters
LocalZoneLocationLocation to query the vector at.
Returns
Up vector in world space.
bool AAdvKitZone::HasCustomPhysics ( uint8  QueryPhysics)
virtual

Check if the zone has a specific custom movement mode.

Parameters
QueryPhysicsThe mode to check for.
Returns
True if zone has this mode.
bool AAdvKitZone::HasPhysics ( EAdvKitMovementMode  QueryPhysics)
virtual

Check if the zone has a specific movement mode.

Parameters
QueryPhysicsThe mode to check for.
Returns
True if zone has this mode.
bool AAdvKitZone::IsCharacterSupported ( AAdvKitCharacter Character)

Query if a character can enter this zone

Parameters
CharacterCharacter that wants to enter the zone
bool AAdvKitZone::IsPointInside ( const FVector &  WorldPosition,
float  ErrorMargin = 0.1f 
)
virtual

Checks if a given location is inside the zone.

Parameters
WorldPositionThe location to check for
ErrorMarginHow much leeway the check has
Returns
True if inside zone, false otherwise
bool AAdvKitZone::MoveLocationInDirection ( UAdvKitZoneLocation LocationToMove,
const FVector &  WorldDesiredDelta,
const FVector &  HalfExtent,
const FRotator &  ExtentWorldRotation = FRotator::ZeroRotator 
)
virtual

Moves a zone location along the zone while keeping it inside the zone.

Parameters
LocationToMoveThe location object to move
WorldDesiredDeltaThe intended direction of the movement
HalfExtentHalf size of the character, describing its capsule (e.g. capsule radius and half height)
ExtentWorldRotationRotation of the character.
Returns
True if location was moved, false otherwise
bool AAdvKitZone::MoveLocationInDirectionNew ( FVector &  LocalZoneLocation,
const FVector &  WorldDesiredDelta,
const FVector &  HalfExtent,
const FRotator &  ExtentWorldRotation = FRotator::ZeroRotator 
)
virtual

Moves a zone location along the zone while keeping it inside the zone.

Parameters
LocalZoneLocationThe location object to move
WorldDesiredDeltaThe intended direction of the movement
HalfExtentHalf size of the character, describing its capsule (e.g. capsule radius and half height)
ExtentWorldRotationRotation of the character.
Returns
True if location was moved, false otherwise

Reimplemented in AAdvKitZoneSpline.

void AAdvKitZone::RemoveCharacterClass ( TSubclassOf< AAdvKitCharacter CharacterClass)

Removes a character class from all transition build modules

Parameters
CharacterClassCharacter class to remove
void AAdvKitZone::RemoveExistingTransitionsTo ( class AAdvKitZone Other)
virtual

Removes all transitions that target a specified zone

Parameters
OtherThe zone that transitions target
void AAdvKitZone::SetCharacterClass ( TSubclassOf< AAdvKitCharacter CharacterClass)

Sets a character class to all transition build modules removing all previous ones

Parameters
CharacterClassCharacter class to set

Member Data Documentation

bool AAdvKitZone::bDoubleConstructionScriptFix

This flag prevents transition generation if the map has not been loaded but the constructin script already runs. In that case prior transitions could be wiped because no neighbour zones are found.

TArray<UAdvKitTransitionBuilderModule*> AAdvKitZone::BuildModules

Build modules this zone will use.

uint8 AAdvKitZone::CustomZonePhysics

Custom Movement mode to be used in this zone

EAdvKitMovementMode AAdvKitZone::ZonePhysics

Movement mode to be used in this zone


The documentation for this class was generated from the following files: