Closed paulmelis closed 2 years ago
Hmmm, looking at
https://github.com/ospray/ospray/blob/a783bf987cff6a2d70a2dfce6732d7f2572703bd/ospray/common/Instance.cpp#L37-L40
it seems that what I'm trying isn't too unreasonable
Strike that, as that's internal code, not something that uses the C++ wrappers
Ah, looking at apps/ospTestSuite/test_geometry.cpp I think I got it:
const box3f bounds = c.getBounds<box3f>();
Yes, that should do the trick (using OSPTYPEFOR_SPECIALIZATION
for own types, as done for example in ospray_cpp/ext/glm.h
and then forcing the template specialization by explicitly passing the own type as template argument) .
What's the correct way of using a custom
box3f
type together withgetBounds()
? As far as I understand it defining your own type is the only option with the C++ wrappers if you don't want to use rkcommon (which only has source releases, hence is less attractive). I've tried this:Compiling this snippet results in an error, saying that the return type template parameter of
getBounds()
can't be determined:My C++ template-fu isn't strong enough to figure out how to fix this...