Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
Public Member Functions | Friends | List of all members
Engine::AnimationComponent Class Reference

#include <AnimationComponent.hpp>

Inheritance diagram for Engine::AnimationComponent:
Engine::Component

Public Member Functions

 ~AnimationComponent ()
 
eastl::vector< eastl::weak_ptr< ModelComponent > > GetEntityModels () const
 Returns all model components owned by the entity. More...
 
eastl::vector< eastl::string > GetModelAnimations (eastl::weak_ptr< ModelComponent > modelComponent)
 Returns the names of all animations of the given model component. More...
 
eastl::vector< eastl::string > GetModelAnimations (size_t index)
 Returns the names of all animations of the given model component. More...
 
void SetModelAnimation (eastl::weak_ptr< ModelComponent > modelComponent, eastl::string name, bool resetTime)
 Sets the animation of the specified model to the animation with the specified name. More...
 
void SetModelAnimation (size_t index, eastl::string name, bool resetTime)
 Sets the animation of the specified model to the animation with the specified name. More...
 
eastl::string GetModelCurrentAnimation (eastl::weak_ptr< ModelComponent > modelComponent)
 Returns the name of the model's current animation. More...
 
eastl::string GetModelCurrentAnimation (size_t index)
 Returns the name of the model's current animation. More...
 
void ResetModelAnimation (eastl::weak_ptr< ModelComponent > modelComponent)
 Resets the animation of the specified model component. More...
 
void ResetModelAnimation (size_t index)
 Resets the animation of the specified model component. More...
 
void SetModelAnimationTime (eastl::weak_ptr< ModelComponent > modelComponent, float time)
 Sets the progress of the model's animation to the specified time. More...
 
void SetModelAnimationTime (size_t index, float time)
 Sets the progress of the model's animation to the specified time. More...
 
float GetModelAnimationTime (eastl::weak_ptr< ModelComponent > modelComponent)
 Returns the progress of the model's current animation. More...
 
float GetModelAnimationTime (size_t index)
 Returns the progress of the model's current animation. More...
 
float GetModelAnimationDuration (eastl::weak_ptr< ModelComponent > modelComponent)
 Returns the duration of the model's current animation. More...
 
float GetModelAnimationDuration (size_t index)
 Returns the duration of the model's current animation. More...
 
void SetModelAnimationPaused (eastl::weak_ptr< ModelComponent > modelComponent, bool paused)
 Sets whether or not the model's animation should be paused. More...
 
void SetModelAnimationPaused (size_t index, bool paused)
 Sets whether or not the model's animation should be paused. More...
 
bool isModelAnimationPaused (eastl::weak_ptr< ModelComponent > modelComponent)
 Returns whether or not the model's animation is paused. More...
 
bool isModelAnimationPaused (size_t index)
 Returns whether or not the model's animation is paused. More...
 
void SetModelAnimationLooping (eastl::weak_ptr< ModelComponent > modelComponent, bool looping)
 Sets whether or not the model's animation should loop. More...
 
void SetModelAnimationLooping (size_t index, bool looping)
 Sets whether or not the model's animation should loop. More...
 
bool IsModelAnimationLooping (eastl::weak_ptr< ModelComponent > modelComponent)
 Returns whether or not the model's animation is looping. More...
 
bool IsModelAnimationLooping (size_t index)
 Returns whether or not the model's animation is looping. More...
 
void SetModelAnimationSpeed (eastl::weak_ptr< ModelComponent > modelComponent, float speed)
 Sets the speed modifier of the model's animation. The default is 1.0f. More...
 
void SetModelAnimationSpeed (size_t index, float speed)
 Sets the speed modifier of the model's animation. The default is 1.0f. More...
 
float GetModelAnimationSpeed (eastl::weak_ptr< ModelComponent > modelComponent)
 Returns the speed modifier of the model's animation. More...
 
float GetModelAnimationSpeed (size_t index)
 Returns the speed modifier of the model's animation. More...
 
- Public Member Functions inherited from Engine::Component
virtual ~Component ()=default
 
eastl::weak_ptr< EntityGetOwner () const
 This method allows you to get the entity holding this component. More...
 

Friends

class Entity
 

Additional Inherited Members

- Public Attributes inherited from Engine::Component
bool isEnabled
 
- Protected Member Functions inherited from Engine::Component
 Component ()
 
template<typename ComponentType >
eastl::weak_ptr< ComponentType > GetComponent ()
 This method allows you to get the first component of the given type. More...
 
template<typename ComponentType >
eastl::vector< eastl::weak_ptr< ComponentType > > GetComponents ()
 This method allows you to get all of the components of the given type. More...
 
eastl::vector< eastl::shared_ptr< Component > > GetAllComponents () const
 Returns all the components of this entity. More...
 
template<class ComponentType , class... Args>
eastl::weak_ptr< ComponentType > AddComponent (Args &&...args)
 Allows you to create a component of the given type. More...
 
template<class ComponentType , class... Args>
eastl::vector< eastl::weak_ptr< ComponentType > > AddComponents (size_t count, Args &&...args)
 Allows you to create X amount of components of the given type. More...
 
template<typename ComponentType >
void RemoveComponent (size_t amountToRemove=1) const
 Allows X amount of components of the given type. More...
 
template<typename ComponentType >
void RemoveAllComponents () const
 Deletes all the components of the given type. More...
 
template<typename archive >
void SaveBaseComponent (archive ar)
 Saves the data of this component to a archive (all derived classes have their own version, but if needed they can call this one as a failsafe/default version) More...
 
template<typename archive >
void LoadBaseComponent (archive ar)
 loads the data from the archive to this component (all derived classes have their own version, but if needed they can call this one as a failsafe/default version) More...
 
virtual void OnBeginContact (eastl::weak_ptr< Entity > entity)
 
virtual void OnEndContact (eastl::weak_ptr< Entity > entity)
 
eastl::weak_ptr< ComponentGetPointerRefence () const
 This method allows you to get a direct refence to the weak pointer of this component. More...
 
template<typename ComponentType >
eastl::weak_ptr< ComponentType > GetPointerRefence ()
 This method allows you to get a direct refence to the weak pointer of this component. More...
 

Detailed Description

Definition at line 11 of file AnimationComponent.hpp.

Constructor & Destructor Documentation

Engine::AnimationComponent::~AnimationComponent ( )

Definition at line 7 of file AnimationComponent.cpp.

Member Function Documentation

eastl::vector< eastl::weak_ptr< ModelComponent > > Engine::AnimationComponent::GetEntityModels ( ) const

Returns all model components owned by the entity.

Returns
A vector of weak pointers to model components.

Definition at line 11 of file AnimationComponent.cpp.

float Engine::AnimationComponent::GetModelAnimationDuration ( eastl::weak_ptr< ModelComponent modelComponent)

Returns the duration of the model's current animation.

Parameters
modelComponentThe model component to get the duration from.
Returns
The duration in seconds.

Definition at line 119 of file AnimationComponent.cpp.

float Engine::AnimationComponent::GetModelAnimationDuration ( size_t  index)

Returns the duration of the model's current animation.

Parameters
indexThe index of the model component to get the duration from.
Returns
The duration in seconds.

Definition at line 129 of file AnimationComponent.cpp.

eastl::vector< eastl::string > Engine::AnimationComponent::GetModelAnimations ( eastl::weak_ptr< ModelComponent modelComponent)

Returns the names of all animations of the given model component.

Parameters
modelComponentThe model component to get the animations from.
Returns
A vector of strings.

Definition at line 16 of file AnimationComponent.cpp.

eastl::vector< eastl::string > Engine::AnimationComponent::GetModelAnimations ( size_t  index)

Returns the names of all animations of the given model component.

Parameters
indexThe index into the model components vector to get the animations from.
Returns
A vector of strings.

Definition at line 26 of file AnimationComponent.cpp.

float Engine::AnimationComponent::GetModelAnimationSpeed ( eastl::weak_ptr< ModelComponent modelComponent)

Returns the speed modifier of the model's animation.

Parameters
modelComponentThe model component to get the speed from.
Returns
The speed of the animation.

Definition at line 221 of file AnimationComponent.cpp.

float Engine::AnimationComponent::GetModelAnimationSpeed ( size_t  index)

Returns the speed modifier of the model's animation.

Parameters
indexThe index of the model component to get the speed from.
Returns
The speed of the animation.

Definition at line 231 of file AnimationComponent.cpp.

float Engine::AnimationComponent::GetModelAnimationTime ( eastl::weak_ptr< ModelComponent modelComponent)

Returns the progress of the model's current animation.

Parameters
modelComponentThe model component to get the time from.
Returns
The time in seconds.

Definition at line 101 of file AnimationComponent.cpp.

float Engine::AnimationComponent::GetModelAnimationTime ( size_t  index)

Returns the progress of the model's current animation.

Parameters
indexThe index of the model component to get the time from.
Returns
The time in seconds.

Definition at line 111 of file AnimationComponent.cpp.

eastl::string Engine::AnimationComponent::GetModelCurrentAnimation ( eastl::weak_ptr< ModelComponent modelComponent)

Returns the name of the model's current animation.

Parameters
modelComponentThe model component to get the name from.
Returns
The name of the animation.

Definition at line 51 of file AnimationComponent.cpp.

eastl::string Engine::AnimationComponent::GetModelCurrentAnimation ( size_t  index)

Returns the name of the model's current animation.

Parameters
indexThe index of the model component to get the name from.
Returns
The name of the animation.

Definition at line 61 of file AnimationComponent.cpp.

bool Engine::AnimationComponent::IsModelAnimationLooping ( eastl::weak_ptr< ModelComponent modelComponent)

Returns whether or not the model's animation is looping.

Parameters
modelComponentThe model component to get the status from.
Returns
Whether or not the animation is looping.

Definition at line 187 of file AnimationComponent.cpp.

bool Engine::AnimationComponent::IsModelAnimationLooping ( size_t  index)

Returns whether or not the model's animation is looping.

Parameters
indexThe index of model component to get the status from.
Returns
Whether or not the animation is looping.

Definition at line 197 of file AnimationComponent.cpp.

bool Engine::AnimationComponent::isModelAnimationPaused ( eastl::weak_ptr< ModelComponent modelComponent)

Returns whether or not the model's animation is paused.

Parameters
modelComponentThe model component to get the status from.
Returns
Whether or not the animation is paused.

Definition at line 153 of file AnimationComponent.cpp.

bool Engine::AnimationComponent::isModelAnimationPaused ( size_t  index)

Returns whether or not the model's animation is paused.

Parameters
indexThe index of the model component to get the status from.
Returns
Whether or not the animation is paused.

Definition at line 163 of file AnimationComponent.cpp.

void Engine::AnimationComponent::ResetModelAnimation ( eastl::weak_ptr< ModelComponent modelComponent)

Resets the animation of the specified model component.

Parameters
modelComponentThe model component to reset the animation for.

Definition at line 69 of file AnimationComponent.cpp.

void Engine::AnimationComponent::ResetModelAnimation ( size_t  index)

Resets the animation of the specified model component.

Parameters
indexThe index of the model component to reset the animation for.

Definition at line 78 of file AnimationComponent.cpp.

void Engine::AnimationComponent::SetModelAnimation ( eastl::weak_ptr< ModelComponent modelComponent,
eastl::string  name,
bool  resetTime 
)

Sets the animation of the specified model to the animation with the specified name.

Parameters
nameThe name of the animation.
modelComponentThe model component to set the animation for.
resetTimeWhether or not the animation time needs to be reset.

Definition at line 35 of file AnimationComponent.cpp.

void Engine::AnimationComponent::SetModelAnimation ( size_t  index,
eastl::string  name,
bool  resetTime 
)

Sets the animation of the specified model to the animation with the specified name.

Parameters
indexThe index of the model component.
nameThe name of the animation.
resetTimeWhether or not the animation time needs to be reset.

Definition at line 44 of file AnimationComponent.cpp.

void Engine::AnimationComponent::SetModelAnimationLooping ( eastl::weak_ptr< ModelComponent modelComponent,
bool  looping 
)

Sets whether or not the model's animation should loop.

Parameters
modelComponentThe model component to set the status of.
loopingWhether or not the animation should loop.

Definition at line 171 of file AnimationComponent.cpp.

void Engine::AnimationComponent::SetModelAnimationLooping ( size_t  index,
bool  looping 
)

Sets whether or not the model's animation should loop.

Parameters
indexThe index of the model component to set the status of.
loopingWhether or not the animation should loop.

Definition at line 180 of file AnimationComponent.cpp.

void Engine::AnimationComponent::SetModelAnimationPaused ( eastl::weak_ptr< ModelComponent modelComponent,
bool  paused 
)

Sets whether or not the model's animation should be paused.

Parameters
modelComponentThe model component to pause the animation of.
pausedWhether or not the animation should be paused.

Definition at line 137 of file AnimationComponent.cpp.

void Engine::AnimationComponent::SetModelAnimationPaused ( size_t  index,
bool  paused 
)

Sets whether or not the model's animation should be paused.

Parameters
indexThe index of the model component to pause the animation of.
pausedWhether or not the animation should be paused.

Definition at line 146 of file AnimationComponent.cpp.

void Engine::AnimationComponent::SetModelAnimationSpeed ( eastl::weak_ptr< ModelComponent modelComponent,
float  speed 
)

Sets the speed modifier of the model's animation. The default is 1.0f.

Parameters
modelComponentThe model component to set the speed for.
speedThe new speed.

Definition at line 205 of file AnimationComponent.cpp.

void Engine::AnimationComponent::SetModelAnimationSpeed ( size_t  index,
float  speed 
)

Sets the speed modifier of the model's animation. The default is 1.0f.

Parameters
indexThe index of the model component to set the speed for.
speedThe new speed.

Definition at line 214 of file AnimationComponent.cpp.

void Engine::AnimationComponent::SetModelAnimationTime ( eastl::weak_ptr< ModelComponent modelComponent,
float  time 
)

Sets the progress of the model's animation to the specified time.

Parameters
modelComponentThe model component to affect.
timeThe new time in seconds.

Definition at line 85 of file AnimationComponent.cpp.

void Engine::AnimationComponent::SetModelAnimationTime ( size_t  index,
float  time 
)

Sets the progress of the model's animation to the specified time.

Parameters
indexThe index of the model component to affect.
timeThe new time in seconds.

Definition at line 94 of file AnimationComponent.cpp.

Friends And Related Function Documentation

friend class Entity
friend

Definition at line 206 of file AnimationComponent.hpp.


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