KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::AStaticMeshActor Class Reference

An actor that contains a static mesh component, allowing the mesh to be rendered in the game world. More...

#include <StaticMeshActor.h>

Inheritance diagram for Karma::AStaticMeshActor:
Karma::AActor Karma::UObject Karma::UObjectBase

Public Member Functions

 AStaticMeshActor (const std::string &name="StaticMeshActor")
 Constructor for StaticMeshActor.
void LoadMeshFromFile (const std::string &filePath)
 Loads a static mesh from a file and assigns it to the static mesh component.
UStaticMeshComponentGetStaticMeshComponent () const
 Getter for the static mesh component.
virtual void Tick (float DeltaSeconds) override
Public Member Functions inherited from Karma::AActor
 AActor ()
ULevelGetLevel () const
void PostSpawnInitialize (FTransform const &SpawnTransform, AActor *InOwner, APawn *InInstigator, bool bRemoteOwned, bool bNoFail, bool bDeferConstruction)
virtual UWorldGetWorld () 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 USceneComponentGetRootComponent () const
bool SetRootComponent (USceneComponent *NewRootComponent)
const FTransformGetTransform () const
bool SetActorTransform (const FTransform &NewTransform)
bool SetActorLocation (const glm::vec3 &NewLocation)
 Move the actor instantly to the specified location.
bool SetActorRotation (TRotator NewRotation)
void SetActorScale3D (glm::vec3 NewScale3D)
const FTransformActorToWorld () const
void InitializeComponents ()
virtual void PostInitializeComponents ()
AActorGetParentActor () const
UChildActorComponentGetParentComponent () const
void RemoveOwnedComponent (std::shared_ptr< UActorComponent > Component)
bool GetAutoDestroyWhenFinished () const
bool CanTick () const
void DisableTick (bool bDisable)
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)
 Constructor used by StaticAllocateObject.
virtual void ShivaUObject ()
 One function to destroy them.
UPackageGetPackage () const
 Walks up the list of outers until it finds a package directly associated with the object.
UPackageGetExternalPackage () const
bool IsUnreachable () const
FORCEINLINE void SetInternalIndex (uint32_t StoreIndex)
FORCEINLINE uint32_t GetInternalIndex () const
void MarkAsGarbage ()
void ClearGarbage ()
FORCEINLINE const std::string & GetName () const
FORCEINLINE void SetObjectName (const std::string &aName)
FORCEINLINE UObjectGetOuter () const
UObjectGetTypedOuter (UClass *Target) const
template<typename T>
T * GetTypedOuter () const
bool IsValidLowLevel () const
template<typename OtherClassType>
FORCEINLINE bool IsA (OtherClassType SomeBase) const
FORCEINLINE UClassGetClass () const
FORCEINLINE EObjectFlags GetFlags () const
FORCEINLINE void SetFlags (EObjectFlags NewFlags)
FORCEINLINE void ClearFlags (EObjectFlags FlagsToClear)
FORCEINLINE bool HasAnyFlags (EObjectFlags FlagsToCheck) const
FORCEINLINE bool HasAnyInternalFlags (EInternalObjectFlags FlagsToCheck) const
FORCEINLINE void SetInternalFlags (EInternalObjectFlags FlagsToSet) const
FORCEINLINE void AddToRoot ()

Additional Inherited Members

Static Public Member Functions inherited from Karma::AActor
static void DispatchOnComponentsCreated (AActor *NewActor)
static USceneComponentFixupNativeActorComponents (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 inherited from Karma::AActor
float m_CreationTime
AActorm_Owner
KarmaVector< AActor * > m_Children
Protected Member Functions inherited from Karma::AActor
virtual void BeginPlay ()
Protected Member Functions inherited from Karma::UObjectBase
 UObjectBase ()
 Providing a default constructor.
FORCEINLINE void SetFlagsTo (EObjectFlags NewFlags)
Protected Attributes inherited from Karma::AActor
USceneComponentm_RootComponent
bool m_bCanEverTick

Detailed Description

An actor that contains a static mesh component, allowing the mesh to be rendered in the game world.

Since
Karma 1.0.0

Constructor & Destructor Documentation

◆ AStaticMeshActor()

Karma::AStaticMeshActor::AStaticMeshActor ( const std::string & name = "StaticMeshActor")

Constructor for StaticMeshActor.

Parameters
nameThe name of the static mesh actor.

Member Function Documentation

◆ GetStaticMeshComponent()

UStaticMeshComponent * Karma::AStaticMeshActor::GetStaticMeshComponent ( ) const
inline

Getter for the static mesh component.

Returns
UStaticMeshComponent* The static mesh component of this actor.
Since
Karma 1.0.0

◆ LoadMeshFromFile()

void Karma::AStaticMeshActor::LoadMeshFromFile ( const std::string & filePath)

Loads a static mesh from a file and assigns it to the static mesh component.

Parameters
filePathThe file path of the static mesh to load.
Since
Karma 1.0.0

◆ Tick()

void Karma::AStaticMeshActor::Tick ( float DeltaSeconds)
overridevirtual

Function called every frame on this Actor. Override this function to implement custom logic to be executed every frame.

Remarks
Note that Tick is enabled by default, and you will need to check m_bCanEverTick is set to false to disable it.
Parameters
DeltaSecondsGame time elapsed during last frame modified by the time dilation
Since
Karma 1.0.0

Reimplemented from Karma::AActor.


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