|
This class implements the HdEmbreePrimvarSampler interface for primvars with "constant" interpolation mode. More...
#include <meshSamplers.h>
Public Member Functions | |
HdEmbreeConstantSampler (TfToken const &name, VtValue const &value) | |
Constructor. | |
virtual bool | Sample (unsigned int element, float u, float v, void *value, HdTupleType dataType) const |
Sample the primvar at an (element, u, v) location. | |
Public Member Functions inherited from HdEmbreePrimvarSampler | |
HdEmbreePrimvarSampler ()=default | |
Default constructor. | |
virtual | ~HdEmbreePrimvarSampler ()=default |
Default destructor. | |
virtual bool | Sample (unsigned int element, float u, float v, void *value, HdTupleType dataType) const =0 |
Sample the primvar at element index index and local basis coordinates u and v , writing the sample to value . | |
template<typename T > | |
bool | Sample (unsigned int element, float u, float v, T *value) const |
Additional Inherited Members | |
Static Protected Member Functions inherited from HdEmbreePrimvarSampler | |
static bool | _Interpolate (void *out, void **samples, float *weights, size_t sampleCount, HdTupleType dataType) |
Utility function for derived classes: combine multiple samples with blend weights: out = sum_i { samples [i] * weights [i] }. | |
This class implements the HdEmbreePrimvarSampler interface for primvars with "constant" interpolation mode.
This means that the buffer only has one item, which should be returned for any (element, u, v) tuple.
Definition at line 84 of file meshSamplers.h.
|
inline |
Constructor.
name | The name of the primvar. |
value | The buffer data for the primvar. |
Definition at line 89 of file meshSamplers.h.
|
virtual |
Sample the primvar at an (element, u, v) location.
For constant primvars, the buffer only contains one item, so we always return that item.
element | The element index to sample. |
u | The u coordinate to sample. |
v | The v coordinate to sample. |
value | The memory to write the value to (only written on success). |
dataType | The HdTupleType describing element values. |
Implements HdEmbreePrimvarSampler.