OpenVDB 14.0.0
Loading...
Searching...
No Matches
nanovdb::math::detail Namespace Reference

Classes

struct  MakeVoid
 Scalar component type of a scalar or vector value type, e.g. float for both float and Vec3<float> More...
struct  ScalarOf
struct  ScalarOf< T, typename MakeVoid< typename T::ValueType >::type >

Functions

template<typename RealT, typename T>
constexpr auto toReal (const T &v)
 Explicitly convert an integral v to RealT, i.e. the implicit promotion in mixed integer/floating-point arithmetic. All other types are returned unchanged.
template<typename T, typename S>
T scale (const T &v, S s)
 Preserve NanoVDB vectors' component-precision scalar multiplication. For other types, multiply before converting the result back to T.

Function Documentation

◆ scale()

template<typename T, typename S>
T scale ( const T & v,
S s )
inline

Preserve NanoVDB vectors' component-precision scalar multiplication. For other types, multiply before converting the result back to T.

◆ toReal()

template<typename RealT, typename T>
auto toReal ( const T & v)
inlineconstexpr

Explicitly convert an integral v to RealT, i.e. the implicit promotion in mixed integer/floating-point arithmetic. All other types are returned unchanged.

Note
The samplers interpolate integral grids in integer arithmetic and truncate the result, e.g. the linear weights and tricubic stencil weights become zero, so their output is generally not meaningful.