#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::EntityInstance * | getEntityInstance () const |
| nap::Component * | getComponent () const |
| template<typename T > | |
| T * | getComponent () const |
| virtual bool | init (utility::ErrorState &errorState) |
Public Member Functions inherited from Object | |
| Object () | |
| virtual | ~Object () |
| virtual void | onDestroy () |
| Object (Object &)=delete | |
| Object & | operator= (const Object &)=delete |
| Object (Object &&)=delete | |
| Object & | operator= (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.
| ParameterBlendComponentInstance | ( | EntityInstance & | entity, |
| Component & | resource | ||
| ) |
| void enable | ( | bool | value | ) |
Turns blending on / off.
| value | if blending is turned on |
| bool enabled | ( | ) | const |
Returns if blending is enabled. Preset changes without blending enabled have no effect.
| float getBlendValue | ( | ) |
| int getIndex | ( | ) | const |
| const std::vector<std::string>& getPresets | ( | ) | const |
| bool hasPresets | ( | ) | const |
|
overridevirtual |
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.
| errorState | contains the error message if initialization fails. |
Reimplemented from ComponentInstance.
| bool isBlending | ( | ) | const |
| bool reload | ( | nap::utility::ErrorState & | error | ) |
Reloads all the presets from disk.
| error | contains the error if reloading fails. |
|
overridevirtual |
Blends the parameter values.
| deltaTime | time in between frames in seconds. |
Reimplemented from ComponentInstance.