sergey.pozhidaev Posted April 30, 2014 Posted April 30, 2014 Добрый день! Такая проблема: работаем с Sim версией движка, нужно в плагине получать BoundBox и BoundFrustum, но все их функции принимают vec3, а не dvec3. Какие могут быть варианты решения? Спасибо. Hello. I have a problem: I use Sim version of engine and I need to get BoundBox and BoundFrustum in plugin, but all functions of those classes accepts vec3 parameters instead of dvec3. How I can solve this problem? Thanks.
unclebob Posted May 10, 2014 Posted May 10, 2014 Hello, Sergey! Sorry for late reply. There is a couple of ways you can get bounds in double precision: 1) Get local bounds in float via getBoundBox/Sphere/Frustum call, get node world matrix in double precition and transform local bounds properly; 2) Get world bounds in double via getWorldBoundBox/Sphere/Frustum call.
sergey.pozhidaev Posted May 15, 2014 Author Posted May 15, 2014 Thank You! And I have another problem: I need to add vertex to ObjectMeshDynamic in plugin, I get dvec3 vertex from my function, but addVertex accepts only vec3.
ulf.schroeter Posted May 15, 2014 Posted May 15, 2014 Mesh vertices cannot be specified in double precision as the underlying API's only support float. Therfore you have to cast double to float,
unclebob Posted May 16, 2014 Posted May 16, 2014 Mesh vertices are stored in local coordinates and float only as they transfered to the GPU. If you want to add a world vertex to ObjectMeshDynamic then you need to transform world vertex coorditantes to local and then convert double to float (might be huge troubles with precision during this step).
Recommended Posts