Public Member Functions | List of all members
ParameterBlendComponentInstance Class Reference

#include <parameterblendcomponent.h>

Public Member Functions

 ParameterBlendComponentInstance (EntityInstance &entity, Component &resource)
 ~ParameterBlendComponentInstance ()
virtual bool init (utility::ErrorState &errorState) override
virtual void update (double deltaTime) override
bool enabled () const
void enable (bool value)
bool isBlending () const
float getBlendValue ()
int getIndex () const
const std::vector< std::string > & getPresets () const
bool reload (nap::utility::ErrorState &error)
bool hasPresets () const
- Public Member Functions inherited from ComponentInstance
 ComponentInstance (EntityInstance &entity, Component &resource)
nap::EntityInstancegetEntityInstance () const
nap::ComponentgetComponent () const
template<typename T >
T * getComponent () const
- Public Member Functions inherited from Object
 Object ()
virtual ~Object ()
virtual void onDestroy ()
 Object (Object &)=delete
Objectoperator= (const Object &)=delete
 Object (Object &&)=delete
Objectoperator= (Object &&)=delete

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...


Runtime part of the parameter blend component. Smoothly blends a set of parameters over time towards a given preset. The parameters that are blended are defined by the 'BlendGroup' of the resource. The preset index controls the preset to sample the parameters from.

A blender needs to be available for every parameter that is blended. The system issues a warning on initialization when there is no blender available for a specific parameter. By default float, double, vec2, vec3 and color parameters are supported. If a preset does not contain a specific parameter a warning is issued.

Inheritance diagram for ParameterBlendComponentInstance:
Collaboration diagram for ParameterBlendComponentInstance:

Constructor & Destructor Documentation

◆ ParameterBlendComponentInstance()

◆ ~ParameterBlendComponentInstance()

Member Function Documentation

◆ enable()

void enable ( bool  value)

Turns blending on / off.

valueif blending is turned on

◆ enabled()

bool enabled ( ) const

Returns if blending is enabled. Preset changes without blending enabled have no effect.

if blending is enabled.

◆ getBlendValue()

float getBlendValue ( )
current blend value from 0 - 1

◆ getIndex()

int getIndex ( ) const
current preset index

◆ getPresets()

const std::vector<std::string>& getPresets ( ) const
the names of all the presets that can be blended.

◆ hasPresets()

bool hasPresets ( ) const
if there are any presets to blend

◆ init()

virtual bool init ( utility::ErrorState errorState)

Initializes the component. All presets associated with the 'RootGroup' of the 'BlendGroup' are sourced from disk. A blender is created for every parameter and stored for future use on update.

errorStatecontains the error message if initialization fails.
if initialization succeeded.

Reimplemented from ComponentInstance.

◆ isBlending()

bool isBlending ( ) const
if the component is currently blending.

◆ reload()

bool reload ( nap::utility::ErrorState error)

Reloads all the presets from disk.

errorcontains the error if reloading fails.
if reloading the presets succeeded.

◆ update()

virtual void update ( double  deltaTime)

Blends the parameter values.

deltaTimetime in between frames in seconds.

Reimplemented from ComponentInstance.