THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/10/2003 at 12:54, xxxxxxxx wrote:
Cinema 4D Version: 8.206
Language(s) : C++ ;
Im using the RayCollider to intersect the mouse cursor position with the object to find the polygon that the mouse is over, using a tool plugin.
I have globally declared a RayCollider and called the RayCollider::Init(obj,TRUE) method on my tools Init method.
I have it all working except my tool changes the vertices of active object, and the RayCollider doesn't take into account the new changes.
I can fix this my adding a rc::Init(obj,TRUE); in the GetCursorInfo method, but the rc:Init method slows down the plugin somewhat, especially with high dense meshes.
How can I tell the RayCollider to use the new vertice changes of the object without re-initializes it everytime?
On 27/10/2003 at 01:05, xxxxxxxx wrote:
I don't think that would be possible. RayCollider::Init() builds a possibly non-trivial space partition cache of the object that isn't easy to upgrade. If you need a higher performance you'll have to build your own algorithm that supports this. For a small number of rays you could first see if a brute force check against all polygons would be faster. (I.e. if you're only doing one ray before you change the vertices it might be faster not to build the cache and just check each polygon.)
On 28/10/2003 at 01:14, xxxxxxxx wrote:
Thats what i feared