How to use setGlobalBounds ?
by John Doppler Schiff · in Torque Game Engine · 06/18/2006 (3:35 am) · 6 replies
Hi folks,
I've been monkeying around with massive DTS shapes, and I've finally gotten around to trying out setGlobalBounds -- except that I've been stopped cold by the fact that I haven't a clue how to access it.
If I understand correctly, it's a method function available on all SceneObjects, but I can't seem to get my hands on it through script files or the console. Is it accessible via TorqueScript? If so... how? That's been too much of a challenge for my two remaining brain cells, so far.
As always, any help you can provide is greatly appreciated!
-- JohnDopp
PS: Additional background, if needed: my guinea pig object is a low-poly, huge DTS, a six-sided cylinder roughly 2048 x 4096 Torque/3DS units, and is inserted into the mission as an unscaled TSStatic.
I've been monkeying around with massive DTS shapes, and I've finally gotten around to trying out setGlobalBounds -- except that I've been stopped cold by the fact that I haven't a clue how to access it.
If I understand correctly, it's a method function available on all SceneObjects, but I can't seem to get my hands on it through script files or the console. Is it accessible via TorqueScript? If so... how? That's been too much of a challenge for my two remaining brain cells, so far.
As always, any help you can provide is greatly appreciated!
-- JohnDopp
PS: Additional background, if needed: my guinea pig object is a low-poly, huge DTS, a six-sided cylinder roughly 2048 x 4096 Torque/3DS units, and is inserted into the mission as an unscaled TSStatic.
#2
It would be in Torquescript, something like:
GlobalBounds = 230;
in the datablock
but im just guessing
06/20/2006 (8:09 am)
That sounds like the maximum distance it can travel before being stopped by an invisible barrier, just a guessIt would be in Torquescript, something like:
GlobalBounds = 230;
in the datablock
but im just guessing
#3
Sounds like just what I need at the moment, but I'll be spanked if I can figure out how to get at it.
06/20/2006 (8:35 am)
Actually, it's an addition to TGE1.4 that causes the engine to treat a DTS as if its bounding box was infinitely large, so the object always renders. It prevents large objects from being culled when you travel too far from its origin.Sounds like just what I need at the moment, but I'll be spanked if I can figure out how to get at it.
#4
06/20/2006 (9:55 am)
Doing it for anything but TSStatics you could add it as a new datablock property at GameBase. For a TSStatic it probably be easiest to just make a small subclass called LargeTSStatic or something, and just add the line setGlobalBounds(); to it's onAdd function.
#5
Unfortunately, if I add it as anything other than a TSStatic, Torque vomits up an "Error: no plane possible" alert as soon as the object comes into view, regardless of whether I'm using setGlobalBounds() or not.
Oy! Back to the drawing board. =)
06/20/2006 (10:11 pm)
Thanks Paul, that helped greatly. Unfortunately, if I add it as anything other than a TSStatic, Torque vomits up an "Error: no plane possible" alert as soon as the object comes into view, regardless of whether I'm using setGlobalBounds() or not.
Oy! Back to the drawing board. =)
#6
Thanks, everyone! You've saved me yet another ulcer. =)
06/20/2006 (11:39 pm)
Got it... broke the DTS into smaller units, and Torque no longer chokes on it. Thanks, everyone! You've saved me yet another ulcer. =)
Torque Owner John Doppler Schiff