Leviathan  0.8.0.0
Leviathan game engine
Leviathan::ObjectAnimationHandler Class Reference

#include <ObjectAnimationHandler.h>

+ Inheritance diagram for Leviathan::ObjectAnimationHandler:

Public Member Functions

bs::HAnimation GetInternal ()
 
 REFERENCE_COUNTED_PTR_TYPE (ObjectAnimationHandler)
 
- Public Member Functions inherited from Leviathan::SceneAttachable
DLLEXPORT ~SceneAttachable ()
 
DLLEXPORT void DetachFromParent ()
 Detaches this from parent if attached. More...
 
SceneNodeGetParent () const
 
bool HasParent () const
 
 REFERENCE_COUNTED_PTR_TYPE (SceneAttachable)
 
- Public Member Functions inherited from Leviathan::ReferenceCounted
 ReferenceCounted (const ReferenceCounted &other)=delete
 
ReferenceCountedoperator= (const ReferenceCounted &other)=delete
 
FORCE_INLINE void AddRef () const
 
FORCE_INLINE void Release () const
 removes a reference and deletes the object if reference count reaches zero More...
 
FORCE_INLINE void AddRef ()
 
FORCE_INLINE void Release ()
 
int32_t GetRefCount () const
 Returns the reference count. More...
 

Protected Member Functions

DLLEXPORT ObjectAnimationHandler (SceneNode &parent)
 
virtual DLLEXPORT void OnAttachedToParent (SceneNode &parent) override
 
virtual DLLEXPORT void OnDetachedFromParent (SceneNode &oldparent) override
 
- Protected Member Functions inherited from Leviathan::SceneAttachable
DLLEXPORT void NotifyDetachParent (SceneNode &oldparent)
 
DLLEXPORT void NotifyAttachParent (SceneNode &parent)
 
virtual DLLEXPORT void PrepareToRender ()
 
- Protected Member Functions inherited from Leviathan::ReferenceCounted
DLLEXPORT ReferenceCounted ()
 
virtual DLLEXPORT ~ReferenceCounted ()
 

Protected Attributes

friend ReferenceCounted
 

Additional Inherited Members

- Public Types inherited from Leviathan::ReferenceCounted
using basepointer = boost::intrusive_ptr< ReferenceCounted >
 
using refcountedpointer = boost::intrusive_ptr< ReferenceCounted >
 
- Static Public Member Functions inherited from Leviathan::ReferenceCounted
template<class ActualType >
static boost::intrusive_ptr< ActualType > WrapPtr (ActualType *ptr)
 Creates an intrusive_ptr from raw pointer. More...
 
template<class ActualType , class... Args>
static boost::intrusive_ptr< ActualType > MakeShared (Args &&... args)
 Constructs a new instance and wraps it. More...
 

Detailed Description

Note
When not using bsf this will likely be directly placed into a Renderable

Definition at line 16 of file ObjectAnimationHandler.h.

Constructor & Destructor Documentation

◆ ObjectAnimationHandler()

DLLEXPORT ObjectAnimationHandler::ObjectAnimationHandler ( SceneNode parent)
protected

Definition at line 8 of file ObjectAnimationHandler.cpp.

9 {
10  parent.AttachObject(this);
11 
12  LEVIATHAN_ASSERT(Animation, "Animation didn't get initialized");
13 }
#define LEVIATHAN_ASSERT(x, msg)
Definition: Define.h:100
DLLEXPORT void AttachObject(const SceneAttachable::pointer &object)
Attaches an object to this SceneNode.
Definition: SceneNode.cpp:68

Member Function Documentation

◆ GetInternal()

bs::HAnimation Leviathan::ObjectAnimationHandler::GetInternal ( )
inline

Definition at line 25 of file ObjectAnimationHandler.h.

26  {
27  return Animation;
28  }

◆ OnAttachedToParent()

DLLEXPORT void ObjectAnimationHandler::OnAttachedToParent ( SceneNode parent)
overrideprotectedvirtual

Reimplemented from Leviathan::SceneAttachable.

Definition at line 15 of file ObjectAnimationHandler.cpp.

16 {
17  Animation = parent.GetInternal()->addComponent<bs::CAnimation>();
18 }
bs::HSceneObject GetInternal()
Definition: SceneNode.h:171

◆ OnDetachedFromParent()

DLLEXPORT void ObjectAnimationHandler::OnDetachedFromParent ( SceneNode oldparent)
overrideprotectedvirtual

Reimplemented from Leviathan::SceneAttachable.

Definition at line 20 of file ObjectAnimationHandler.cpp.

21 {
22  if(Animation)
23  Animation->destroy();
24  Animation = nullptr;
25 }

◆ REFERENCE_COUNTED_PTR_TYPE()

Leviathan::ObjectAnimationHandler::REFERENCE_COUNTED_PTR_TYPE ( ObjectAnimationHandler  )

Member Data Documentation

◆ ReferenceCounted

friend Leviathan::ObjectAnimationHandler::ReferenceCounted
protected

Definition at line 20 of file ObjectAnimationHandler.h.


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