Class DeviceEnvironment

Inheritance Relationships

Base Type

Class Documentation

class flamegpu::DeviceEnvironment : public flamegpu::ReadOnlyDeviceEnvironment

Utility for accessing environmental properties These can only be read within agent functions They can be set and updated within host functions This version also allows limited write access to device macro properties

Public Functions

__device__ __forceinline__ inline DeviceEnvironment(const detail::curve::Curve::NamespaceHash &_modelname_hash)

Constructor, requires the model name hash to init modelname_hash

Note

Public because it’s constructed by a templated class

Parameters

_modelname_hash – Hash of model name generated by curveGetVariableHash()

template<typename T, unsigned int I = 1, unsigned int J = 1, unsigned int K = 1, unsigned int W = 1, unsigned int N>
__device__ __forceinline__ DeviceMacroProperty<T, I, J, K, W> getMacroProperty(const char (&name)[N]) const

Returns a read-only accessor to the named macro property

Parameters

name – name used for accessing the property, this value should be a string literal e.g. “foobar”

Template Parameters
  • I – Length of macro property in the 1st dimension, default 1

  • J – Length of macro property in the 2nd dimension, default 1

  • K – Length of macro property in the 3rd dimension, default 1

  • W – Length of macro property in the 4th dimension, default 1

  • N – Length of variable name, this should always be implicit if passing a string literal