Volumes Of Fun http://www.volumesoffun.com/phpBB3/ |
|
PolyVox::raycastWithDirection troubles http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=576 |
Page 1 of 1 |
Author: | drwbns [ Thu Mar 06, 2014 5:27 pm ] |
Post subject: | PolyVox::raycastWithDirection troubles |
Hi guys, I'm using the latest version from the repo and noticed there is no Raycast template anymore. So I'm trying raycast with direction instead but its not working - Code: PolyVox::RaycastResult raycastResult; PolyVox::raycastWithDirection<PolyVox::LargeVolume<PolyVox::Density8>, PolyVox::RaycastResult> raycast(&volume, start, direction, raycastResult); It says raycast is undefined...help please |
Author: | David Williams [ Fri Mar 07, 2014 2:38 pm ] |
Post subject: | Re: PolyVox::raycastWithDirection troubles |
We're in the process of 'unclassing' parts of PolyVox and replacing them with simple function calls instead. So you don't need to create an instance of 'raycastWithDirection', you simply call it as a function. From the unit test in TestRaycast.cpp: Code: RaycastTestFunctor raycastTestFunctor; RaycastResult result = raycastWithDirection(&volData, start, randomUnitVectors[ct % 1024] * 1000.0f, raycastTestFunctor); Note that RaycastTestFunctor is an example of a callback which you can provide yourself, which is executed for each voxel on the ray and which detemines whether traversal should continue. However, if you are using it for picking then you might find the new 'pickVoxel' function easier as you don't need to worry about providing a callback. Instead you give it an example of an empty voxel. See TestPicking.cpp to see it being used. |
Author: | drwbns [ Sat Mar 08, 2014 2:45 am ] |
Post subject: | Re: PolyVox::raycastWithDirection troubles |
Oh ok, where can I find the TestPicking.cpp file? Is it in the repo? Also, I don't see the pickVoxel function anywhere in the library. |
Author: | David Williams [ Sat Mar 08, 2014 7:38 am ] |
Post subject: | Re: PolyVox::raycastWithDirection troubles |
If you are on the 'develop' branch of the repo then you should find 'PolyVox/library/PolyVoxCore/include/PolyVoxCore/Picking.h' and 'PolyVox/tests/TestPicking.cpp'. The BitBucket links are below: https://bitbucket.org/volumesoffun/poly ... at=develop https://bitbucket.org/volumesoffun/poly ... at=develop |
Author: | drwbns [ Mon Mar 10, 2014 3:45 pm ] |
Post subject: | Re: PolyVox::raycastWithDirection troubles |
Ok thanks, I'll reply back if I have trouble with picking. Thank you |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |