i6engine  1.0
i6e::api::MoverInterpolateComponent Class Reference

moving an object interpolating in some way For creating a MoverInterpolateComponent, these keys are possible:

Name Required Type Description Public
way yes short How are the frames interpolated, one of enum entries of Way yes
mode yes short In which order the frames will be processed yes
direction yes bool Direction of this mover, true is forward, false is backward yes
openTime *) uint64_t time mover stays at end position before moving backwards, *) required when mode is TWOSTATE_OPENTIME yes
keyframes yes int number of keyframes to follow yes
keyframe__pos *) vector position of i-th keyframe, *) required for all keyframes yes
keyframe__rot *) quaternion rotation of i-th keyframe, *) required for all keyframes yes
More...

#include <D:/Projekte/i6engine/libs/i6engine-modules/include/i6engine/api/components/MoverInterpolateComponent.h>

Public Types

enum  Mode : uint16_t { Mode::TWOSTATE_TOGGLE, Mode::TWOSTATE_OPENTIME, Mode::NSTATE_LOOP, Mode::ONCE }
 
enum  Way : uint16_t { Way::LINEAR, Way::BEZIER }
 
- Public Types inherited from i6e::api::MoverComponent
enum  Positioning : uint16_t { Positioning::POSITIONING_ABSOLUTE, Positioning::POSITIONING_RELATIVE }
 

Public Member Functions

 MoverInterpolateComponent (const int64_t id, const attributeMap &params)
 
 ~MoverInterpolateComponent ()
 
void addKeyFrame (const Vec3 &position, const Quaternion &rotation)
 add a new keyframe at the end of the current path More...
 
void removeKeyFrame (const uint32_t id)
 removes the keyframe with given id id is 0 indexed More...
 
keyFrame getKeyframe (const uint32_t nth) const
 gets the nth keyFrame param[in] nth which keyFrame should be returned nth can be an arbitary number. The function will return the keyFrame that will be the nth one being passed Thus the frame is also dependend on the mode being used returns the appropriate keyFrame If mode is TWOSTATE_TOGGLE, a number > number of available frames will return the last one More...
 
void setMode (const Mode m)
 
void setOpenTime (const uint64_t opentime)
 
void setWay (const Way w)
 
Way getWay () const
 
void start (Vec3 &startPos) override
 starts the moving the startPos position should be the starting position of the movement the object will be moved to this position, or in case of a circle automatically in the circle path More...
 
attributeMap synchronize () const override
 synchronizes the Components state More...
 
std::string getTemplateName () const override
 returns the name this template was registered with More...
 
void reset () override
 resets progress to initial status More...
 
std::vector< componentOptionsgetComponentOptions () override
 returns a vector containing all options of the Component being readable and writeable in the editor More...
 
- Public Member Functions inherited from i6e::api::MoverComponent
 MoverComponent (const int64_t id, const attributeMap &params)
 
virtual ~MoverComponent ()
 
virtual void Tick () override
 Components can have Tick method like normal Subsystems this method is called by the ObjectController during every Tick if the component registered itself at the ObjectFacade. More...
 
virtual void Init () override
 Initializes the Component. More...
 
virtual void Finalize () override
 finalizes the component More...
 
void setDuration (const uint64_t duration)
 
void setPositioning (const Positioning posing)
 
void stop ()
 stops movement More...
 
std::pair< AddStrategy, int64_t > howToAdd (const ComPtr &comp) const override
 asks, how to handle a new component with the same type More...
 
void shatter (const GOPtr &go) override
 Is called after a collision is detected. More...
 
- Public Member Functions inherited from i6e::api::ShatterComponent
 ShatterComponent (int64_t id, const attributeMap &params)
 Constructor of the component with a given id. More...
 
virtual ~ShatterComponent ()
 Destructor of the component. More...
 
void resetRespawn ()
 
- Public Member Functions inherited from i6e::api::Component
 Component ()
 Constructor for Component. More...
 
 Component (const int64_t id, const attributeMap &params)
 Constructor for Component. More...
 
virtual ~Component ()
 Destructor of Component. Must be implemented in derived class. More...
 
void setOwnerGO (const WeakGOPtr &objGo)
 Sets the GameObject that owns this Component. More...
 
GOPtr getOwnerGO ()
 Get the GameObject that owns this Component. More...
 
uint32_t getComponentID () const
 Returns the component identification string. More...
 
uint32_t getFamilyID () const
 Returns the family identification string. More...
 
std::string getIdentifier () const
 Returns the family identification string. More...
 
void setDie () const
 component will be deleted soon More...
 
int64_t getID () const
 returns the id of the component More...
 
void setSync (bool b)
 sets whether this object has to be synchronized or not More...
 
bool getSync () const
 
void enableTicking (bool allowTicking) const
 triggers doEnableTicking threadsafe More...
 
void setSelf (const WeakComPtr &self)
 sets weak_ptr on self for registration of ticker More...
 
std::vector< ComPtrgetSubComponents () const
 returns all SubComponents attached to this Component More...
 

Additional Inherited Members

- Static Public Member Functions inherited from i6e::api::Component
template<typename T >
static ComPtr createC (const int64_t id, const attributeMap &params)
 
- Protected Member Functions inherited from i6e::api::MoverComponent
 MoverComponent (const MoverComponent &)=delete
 
const MoverComponentoperator= (const MoverComponent &)=delete
 
- Protected Member Functions inherited from i6e::api::Component
void addTicker ()
 adds this component to ticklist More...
 
void removeTicker ()
 removes this component from ticklist More...
 
void doEnableTicking (bool allowTicking)
 sets ticking status for this Component per default all Components are allowed to tick and calling addTicker will start ticking, but in some cases, e.g. for level editor, ticking has to be disabled and just a few components are allowed to tick More...
 
- Protected Attributes inherited from i6e::api::MoverComponent
uint64_t _duration
 duration for one path More...
 
Positioning _positioning
 type of positioning More...
 
utils::weakPtr< PhysicalStateComponent, Component_psc
 PSC of the GameObject. More...
 
uint64_t _startTime
 time the moving started More...
 
Vec3 _lastPos
 last position value calculated in imaginary path used for RELATIVE positioning More...
 
Vec3 _realStartPos
 real starting position needed for synchronizing More...
 
Quaternion _lastRot
 last rotation value calculated in imaginary path used for RELATIVE positioning More...
 
bool _moving
 current status More...
 
bool _initial
 whether the call to start() will start or continue the movement More...
 
bool _started
 whether the Mover should be started on creation or not More...
 
bool _linkable
 whether the object on the Mover should be linked and moved with the Mover More...
 
std::vector< int64_t > _linked
 vector of all linked GameObject IDs More...
 
- Protected Attributes inherited from i6e::api::Component
int64_t _objOwnerID
 ID of the GameObject that owns this Component. More...
 
WeakGOPtr _objOwnerGO
 Owning GameObject. More...
 
uint32_t _objComponentID
 Component ID of the Component. More...
 
uint32_t _objFamilyID
 Family ID of the Component. More...
 
std::vector< ComPtr_subComps
 vector containing the other componetns of the same type if this is the dispatcher component More...
 
std::string _identifier
 identifies the subcomponent More...
 
int64_t _id
 id of this component More...
 
bool _sync
 
WeakComPtr _self
 a weak_ptr on the own shared_ptr More...
 
bool _tickingAllowed
 status if this object is allowed to tick or not More...
 
bool _wantsToTick
 stores if a Component which isn't allowed to tick want to tick, so it can start ticking when ticking will be allowed More...
 
bool _isTicking
 stores whether this Component is actually ticking More...
 

Detailed Description

moving an object interpolating in some way For creating a MoverInterpolateComponent, these keys are possible:

Name Required Type Description Public
way yes short How are the frames interpolated, one of enum entries of Way yes
mode yes short In which order the frames will be processed yes
direction yes bool Direction of this mover, true is forward, false is backward yes
openTime *) uint64_t time mover stays at end position before moving backwards, *) required when mode is TWOSTATE_OPENTIME yes
keyframes yes int number of keyframes to follow yes
keyframe__pos *) vector position of i-th keyframe, *) required for all keyframes yes
keyframe__rot *) quaternion rotation of i-th keyframe, *) required for all keyframes yes

Definition at line 49 of file MoverInterpolateComponent.h.

Constructor & Destructor Documentation

i6e::api::MoverInterpolateComponent::MoverInterpolateComponent ( const int64_t  id,
const attributeMap params 
)
i6e::api::MoverInterpolateComponent::~MoverInterpolateComponent ( )

Member Function Documentation

void i6e::api::MoverInterpolateComponent::addKeyFrame ( const Vec3 position,
const Quaternion rotation 
)

add a new keyframe at the end of the current path

std::vector<componentOptions> i6e::api::MoverInterpolateComponent::getComponentOptions ( )
overridevirtual

returns a vector containing all options of the Component being readable and writeable in the editor

Reimplemented from i6e::api::MoverComponent.

keyFrame i6e::api::MoverInterpolateComponent::getKeyframe ( const uint32_t  nth) const
inline

gets the nth keyFrame param[in] nth which keyFrame should be returned nth can be an arbitary number. The function will return the keyFrame that will be the nth one being passed Thus the frame is also dependend on the mode being used returns the appropriate keyFrame If mode is TWOSTATE_TOGGLE, a number > number of available frames will return the last one

Definition at line 87 of file MoverInterpolateComponent.h.

std::string i6e::api::MoverInterpolateComponent::getTemplateName ( ) const
inlineoverridevirtual

returns the name this template was registered with

Implements i6e::api::Component.

Definition at line 110 of file MoverInterpolateComponent.h.

Way i6e::api::MoverInterpolateComponent::getWay ( ) const
inline

Definition at line 101 of file MoverInterpolateComponent.h.

void i6e::api::MoverInterpolateComponent::removeKeyFrame ( const uint32_t  id)

removes the keyframe with given id id is 0 indexed

void i6e::api::MoverInterpolateComponent::reset ( )
overridevirtual

resets progress to initial status

Implements i6e::api::MoverComponent.

void i6e::api::MoverInterpolateComponent::setMode ( const Mode  m)
inline
Parameters
[in]durationtime in microseconds

Definition at line 95 of file MoverInterpolateComponent.h.

void i6e::api::MoverInterpolateComponent::setOpenTime ( const uint64_t  opentime)
inline

Definition at line 96 of file MoverInterpolateComponent.h.

void i6e::api::MoverInterpolateComponent::setWay ( const Way  w)
inline

Definition at line 99 of file MoverInterpolateComponent.h.

void i6e::api::MoverInterpolateComponent::start ( Vec3 startPos)
overridevirtual

starts the moving the startPos position should be the starting position of the movement the object will be moved to this position, or in case of a circle automatically in the circle path

Implements i6e::api::MoverComponent.

attributeMap i6e::api::MoverInterpolateComponent::synchronize ( ) const
overridevirtual

synchronizes the Components state

Reimplemented from i6e::api::MoverComponent.


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