ContainerRadiusSearch not finding a detached camera
by Orion Elenzil · in Torque Game Engine · 01/03/2007 (5:29 pm) · 5 replies
Hi all -
this is sort of a shot in the dark,
but does anyone have a notion why i'd have trouble getting a successful containerRadiusSearch against a camera which is detached ?
i worry that the bin selection in Container::findObjects() isn't large enough for some reason.
this is sort of a shot in the dark,
but does anyone have a notion why i'd have trouble getting a successful containerRadiusSearch against a camera which is detached ?
i worry that the bin selection in Container::findObjects() isn't large enough for some reason.
About the author
#2
i'm determining if the camera is in the bins by doing a hardcoded check on chain->object->getClassName() immediately inside that main while(chain) loop.
01/03/2007 (6:00 pm)
Fwiw,i'm determining if the camera is in the bins by doing a hardcoded check on chain->object->getClassName() immediately inside that main while(chain) loop.
#3
Probably just not implemented for that unusual case--when cameras should collide they are mounted to things that do the collision checking for them.
01/03/2007 (8:31 pm)
I'd imagine that the camera object itself simply doesn't respond to collision/search queries--it's never designed to collide with anything directly.Probably just not implemented for that unusual case--when cameras should collide they are mounted to things that do the collision checking for them.
#4
yah, that seems like a possibility,
except when the search radius is larger it definitely hits the camera.
i should really test against stock TGE, because we have done stuff which might affect this,
but that will take a bit of effort and i was hoping maybe there's a known issue.
01/04/2007 (12:28 am)
Hi stephen, thanks for replying!yah, that seems like a possibility,
except when the search radius is larger it definitely hits the camera.
i should really test against stock TGE, because we have done stuff which might affect this,
but that will take a bit of effort and i was hoping maybe there's a known issue.
#5
Keep in mind that while the appear at the design level to be so, bins are not logically arranged--they are a hash system and just because 2 objects are near each other in different bins does now mean the two bins are numerically "close".
I'm also not seeing the expected check against the overflow bin (all objects should always be checking against the overflow bin, at least for collision checks--not sure if it truly applies here in your use case), which implies that your search may not be properly implemented and/or your camera isn't properly navigating bins.
01/04/2007 (10:06 am)
I've not heard of it before, so really not sure. Then again, I don't think anyone has tried to do a search on a camera itself before :)Keep in mind that while the appear at the design level to be so, bins are not logically arranged--they are a hash system and just because 2 objects are near each other in different bins does now mean the two bins are numerically "close".
I'm also not seeing the expected check against the overflow bin (all objects should always be checking against the overflow bin, at least for collision checks--not sure if it truly applies here in your use case), which implies that your search may not be properly implemented and/or your camera isn't properly navigating bins.
Associate Orion Elenzil
Real Life Plus
so the context here is Container::findObjects().
when the search radius is 20,
we end up searching four bins: (0, 15) (0, 16) (1, 15) (1, 16).
the camera is found in bins (0, 15) and in (0, 16). - very well.
but when the search radius is 5,
which results in a "box" parameter which definitely contains the camera and even the camera's world box,
we end up searching one bin: (1, 15),
which the camera is not in.
i haven't really explored the whole bin and searching areas of the code before,
so any words from the wise would be appreciated.
mind,
we's dealing with a fairly heavily modded TGE 1.3.5 here.