29 #ifndef __X3DINTERPOLATORNODE_H__
30 #define __X3DINTERPOLATORNODE_H__
128 Inst< SFFloat > _set_fraction = 0,
129 Inst< MFFloat > _key = 0 );
136 vector<H3DFloat> keys = key->getValue();
137 if( keys.size() == 0 )
return -1;
139 if ( keys.size() == 1 || f <= keys[0] ) {
143 if ( f >= keys[keys.size()-1] ) {
145 return (
int)keys.size() - 2;
150 for(
size_t i = keys.size()-1;
true; --i) {
152 w = (f-keys[i])/(keys[i+1]-keys[i]);
174 H3DUniquePtr< MFFloat >
key;
Contains the MFFloat field class.
Contains the SFFloat field class.
Header file for X3DChildNode, X3D scene-graph node.
This abstract node type indicates that the concrete nodes which are instantiated based on it may be u...
Definition: X3DChildNode.h:42
The abstract node X3DInterpolatorNode forms the basis for all types of interpolators specified in thi...
Definition: X3DInterpolatorNode.h:123
H3DUniquePtr< MFFloat > key
The key field contains the list of key times, which could appear as: key [0 0.25 0....
Definition: X3DInterpolatorNode.h:174
H3DUniquePtr< SFFloat > set_fraction
The set_fraction inputOnly field receives an SFFloat event and causes the interpolator node function ...
Definition: X3DInterpolatorNode.h:167
int lookupKey(H3DFloat f, H3DFloat &w)
Utility function for Interpolator nodes to be able to find the index for the key pair to interpolate ...
Definition: X3DInterpolatorNode.h:134
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: X3DInterpolatorNode.h:177
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194