On 21/01/2016 at 15:37, xxxxxxxx wrote:
User Information:
Cinema 4D Version:
Platform:
Language(s) :
---------
Hey,
I can't get VolumeData::TraceGeometryEnhanced() to work properly for me. Maybe I don't understand
the docs correctly. I've previously been using TraceGeometry(), but now I need to exclude certain objects
from the tracing, thus I want to use TraceGeometryEnhanced() to do another trace, ignoring the
previous hit (at least that is what I understand that this method can be used for).
vps->vd->GetRay(x, y, &ray);
Bool hit = false;
RayHitID lhit;
Vector64 oldray;
RAYBIT const raybits = RAYBIT_0;
Int32 const raydepth = 0;
while (true) {
hit = vps->vd->TraceGeometryEnhanced(&ray, MAXREALr, lhit, raydepth, raybits, &oldray, &si);
if (!hit || !si.op || !si.op->link) {
break;
}
if (!needs_to_be_excluded(si.op->link)) {
break;
}
lhit = si.id;
}
I run into an infinite loop when an object is to be excluded. Is the function used for what I think it
is used? If yes (or not) how can I make it work?
Thanks