Game Development Community

A quick question on container functions...

by Kirby Webber · in Torque Game Engine · 08/17/2005 (11:58 am) · 1 replies

There are numerous container functions that are pretty useful for identifying objects within the world space.

Two that I am most interested in are containerBoxEmpty() and containerFindFirst().

Both of these functions accept x, y, and z parameters to define the area to be searched - this leaves me wondering a few things:

1) Since Torque uses a right-handed coord system, does the z value refer to height and the y value refer to depth? I'd think so, but I want to be sure (I'm mapping out some logic that get's pretty complex pretty quickly.)

2) Are these values (x,y,z) based upon the relationship the WORLD (as I fear the case may be) or on the OBJECT calling the function?

The reason I ask is, if you wanted to search a specific depth/ range that was not uniform with your width and hieght values, then it would make sense to simply modify the depth of the y value to fit your needs - HOWEVER, if that value is projected using the orientation of the world, and not the player, it's usefulness is diminished - in this particular application.

~ Clear as mud?

#1
08/17/2005 (4:23 pm)
1) Yes. You could confirm this with some simple experiments.

2) The world. Standard collision interfaces. If you need to take points in object space and move to world space you can easily transform them.

Most code in the engine queries in world space, because it's much faster, than does another pass culling the requested data to be in the exact space/culling volume it needs.