Karma Engine
|
#include <Actor.h>
Public Member Functions | |
AActor () | |
ULevel * | GetLevel () const |
void | PostSpawnInitialize (FTransform const &SpawnTransform, AActor *InOwner, APawn *InInstigator, bool bRemoteOwned, bool bNoFail, bool bDeferConstruction) |
virtual UWorld * | GetWorld () const override final |
bool | HasActorBegunPlay () const |
bool | IsActorBeginningPlay () const |
void | DispatchBeginPlay (bool bFromLevelStreaming=false) |
virtual void | SetOwner (AActor *NewOwner) |
void | FinishSpawning (const FTransform &Transform, bool bIsDefaultTransform=false) |
bool | IsOwnedBy (const AActor *TestOwner) const |
void | PostActorConstruction () |
void | GetComponents (KarmaVector< USceneComponent * > &OutComponents) const |
void | GetComponents (KarmaVector< UActorComponent * > &OutComponents) const |
void | SetInstigator (APawn *InInstigator) |
FORCEINLINE USceneComponent * | GetRootComponent () const |
bool | SetRootComponent (USceneComponent *NewRootComponent) |
const FTransform & | GetTransform () const |
const FTransform & | ActorToWorld () const |
void | InitializeComponents () |
virtual void | PostInitializeComponents () |
AActor * | GetParentActor () const |
UChildActorComponent * | GetParentComponent () const |
void | RemoveOwnedComponent (std::shared_ptr< UActorComponent > Component) |
bool | GetAutoDestroyWhenFinished () const |
bool | CanTick () const |
void | DisableTick (bool bDisable) |
virtual void | Tick (float DeltaSeconds) |
Public Member Functions inherited from Karma::UObject | |
UObject () | |
virtual void | FinishDestroy () |
virtual const std::string & | GetDesc () |
Return a one line description of an object for viewing in the thumbnail view of the generic browser. | |
bool | IsValidChecked (const UObject *Test) |
virtual void | BeginDestroy () |
Called before destroying the object. This is called immediately upon deciding to destroy the object, to allow the object to begin an asynchronous cleanup process. | |
FORCEINLINE bool | Modify (bool bAlwaysMarkDirty=true) |
bool | IsSelected () const |
Test the selection state of a UObject. | |
Public Member Functions inherited from Karma::UObjectBase | |
UObjectBase (UClass *inClass, EObjectFlags inFlags, EInternalObjectFlags inInternalFlags, UObject *inOuter, const std::string &inName) | |
UPackage * | GetPackage () const |
UPackage * | GetExternalPackage () const |
bool | IsUnreachable () const |
FORCEINLINE void | SetInternalIndex (uint32_t StoreIndex) |
FORCEINLINE uint32_t | GetInterIndex () const |
void | MarkAsGarbage () |
void | ClearGarbage () |
FORCEINLINE const std::string & | GetName () const |
FORCEINLINE void | SetObjectName (const std::string &aName) |
FORCEINLINE UObject * | GetOuter () const |
UObject * | GetTypedOuter (UClass *Target) const |
template<typename T > | |
T * | GetTypedOuter () const |
bool | IsValidLowLevel () const |
template<typename OtherClassType > | |
FORCEINLINE bool | IsA (OtherClassType SomeBase) const |
FORCEINLINE UClass * | GetClass () const |
FORCEINLINE EObjectFlags | GetFlags () const |
FORCEINLINE void | SetFlags (EObjectFlags NewFlags) |
FORCEINLINE void | ClearFlags (EObjectFlags NewFlags) |
FORCEINLINE bool | HasAnyFlags (EObjectFlags FlagsToCheck) const |
FORCEINLINE bool | HasAnyInternalFlags (EInternalObjectFlags FlagsToCheck) const |
FORCEINLINE void | SetInternalFlags (EInternalObjectFlags FlagsToSet) const |
FORCEINLINE void | AddToRoot () |
Static Public Member Functions | |
static void | DispatchOnComponentsCreated (AActor *NewActor) |
static USceneComponent * | FixupNativeActorComponents (AActor *Actor) |
Static Public Member Functions inherited from Karma::UObject | |
static const char * | StaticConfigName () |
Static Public Member Functions inherited from Karma::UObjectBase | |
static FORCEINLINE EInternalObjectFlags | FixGarbageOrPendingKillInternalObjectFlags (const EInternalObjectFlags InFlags) |
Public Attributes | |
float | m_CreationTime |
AActor * | m_Owner |
KarmaVector< AActor * > | m_Children |
Protected Member Functions | |
virtual void | BeginPlay () |
Protected Member Functions inherited from Karma::UObjectBase | |
FORCEINLINE void | SetFlagsTo (EObjectFlags NewFlags) |
Protected Attributes | |
USceneComponent * | m_RootComponent |
bool | m_bCanEverTick |
Actor is the base class for an Object that can be placed or spawned in a level. A concept taken from Unreal Engine. Actors may contain a collection of ActorComponents, which can be used to control how actors move, how they are rendered, etc.
Karma::AActor::AActor | ( | ) |
Default constructor for AActor
|
inline |
Get the local-to-world transform of the RootComponent. Identical to GetTransform().
|
protectedvirtual |
Overridable native event for when play begins for this actor.
void Karma::AActor::DispatchBeginPlay | ( | bool | bFromLevelStreaming = false | ) |
Initiate a begin play call on this Actor, will handle calling in the correct order.
GetPathName()
|
static |
Util to call OnComponentCreated on components
void Karma::AActor::FinishSpawning | ( | const FTransform & | Transform, |
bool | bIsDefaultTransform = false ) |
Called to finish the spawning process, generally in the case of deferred spawning
|
static |
Util that sets up the actor's component hierarchy (when users forget to do so, in their native ctor)
|
inline |
Get all components derived from class 'ComponentType' and fill in the OutComponents array with the result. It's recommended to use TArrays with a TInlineAllocator to potentially avoid memory allocation costs.
bIncludeFromChildActors | If true then recurse in to ChildActor components and find components of the appropriate type in those Actors as well |
AActor * Karma::AActor::GetParentActor | ( | ) | const |
If this Actor was created by a Child Actor Component returns the Actor that owns that Child Actor Component
UChildActorComponent * Karma::AActor::GetParentComponent | ( | ) | const |
If this Actor was created by a Child Actor Component returns that Child Actor Component
|
inline |
Returns this actor's root component.
|
inline |
Get the actor-to-world transform.
|
finaloverridevirtual |
Getter for the cached world pointer, will return null if the actor is not actually spawned in a level
Reimplemented from Karma::UObject.
|
inline |
Returns whether an actor has had BeginPlay called on it (and not subsequently had EndPlay called)
void Karma::AActor::InitializeComponents | ( | ) |
Iterate over components array and call InitializeComponent, which happens once per actor
|
inline |
Returns whether an actor is in the process of beginning play
|
inline |
See if this actor is owned by TestOwner.
void Karma::AActor::PostActorConstruction | ( | ) |
Called after the actor has run its construction. Responsible for finishing the actor spawn process.
bDeferBeginPlayAndUpdateOverlaps &&
|
virtual |
Allow actors to initialize themselves on the C++ side after all of their components have been initialized, only called during gameplay
void Karma::AActor::PostSpawnInitialize | ( | FTransform const & | SpawnTransform, |
AActor * | InOwner, | ||
APawn * | InInstigator, | ||
bool | bRemoteOwned, | ||
bool | bNoFail, | ||
bool | bDeferConstruction ) |
Called after the actor is spawned in the world. Responsible for setting up actor for play.
void Karma::AActor::RemoveOwnedComponent | ( | std::shared_ptr< UActorComponent > | Component | ) |
Removes a component from the OwnedComponents array of the Actor. In general this should not need to be called directly by anything other than UActorComponent functions
void Karma::AActor::SetInstigator | ( | APawn * | InInstigator | ) |
Sets the value of Instigator without causing other side effects to this instance.
|
virtual |
Set the owner of this Actor, used primarily for network replication.
NewOwner | The Actor who takes over ownership of this Actor |
bool Karma::AActor::SetRootComponent | ( | USceneComponent * | NewRootComponent | ) |
Sets root component to be the specified component. NewRootComponent's owner should be this actor.
Only components owned by this actor can be used as a its root component.
|
virtual |
Function called every frame on this Actor. Override this function to implement custom logic to be executed every frame. Note that Tick is enabled by default, and you will need to check m_bCanEverTick is set to false to disable it.
DeltaSeconds | Game time elapsed during last frame modified by the time dilation |
KarmaVector<AActor*> Karma::AActor::m_Children |
Array of all Actors whose Owner is this actor, these are not necessarily spawned by UChildActorComponent Needs to be raw pointer only.
float Karma::AActor::m_CreationTime |
The time this actor was created, relative to World->GetTimeSeconds().
AActor* Karma::AActor::m_Owner |
Owner of this Actor, used primarily for replication (bNetUseOwnerRelevancy & bOnlyRelevantToOwner) and visibility (PrimitiveComponent bOwnerNoSee and bOnlyOwnerSee)
|
protected |
Event when play begins for this actor. For blueprint trigger The component that defines the transform (location, rotation, scale) of this Actor in the world, all other components must be attached to this one somehow.
Needs be raw pointer only