Torque 3D - Script Manual: Zone Class Reference

TorqueScript

Main   Class List   Namespace List   Online

Zone Class Reference
[Miscellaneous]

An object that represents an interior space. More...

Inheritance diagram for Zone:

List of all members.

Public Member Functions

void dumpZoneState (bool updateFirst=true)
 Dump a list of all objects assigned to the zone to the console as well as a list of all connected zone spaces.
int getZoneId ()
 Get the unique numeric ID of the zone in its scene.

Public Attributes

Lighting

ColorF ambientLightColor
 Color of ambient lighting in this zone.
bool useAmbientLightColor
 Whether to use ambientLightColor for ambient lighting in this zone or the global ambient color.
Internal

string edge
 For internal use only.
string plane
 For internal use only.
string point
 For internal use only.
Sound

SFXAmbience soundAmbience
 Ambient sound environment for the space.
Zoning

int zoneGroup
 ID of group the zone is part of.

Static Public Attributes

static bool isRenderable
 Disables rendering of all instances of this type.
static bool isSelectable
 Disables selection of all instances of this type.

Detailed Description

An object that represents an interior space.

A zone is an invisible volume that encloses an interior space. All objects that have their world space axis-aligned bounding boxes (AABBs) intersect the zone's volume are assigned to the zone. This assignment happens automatically as objects are placed and transformed. Also, assignment is not exclusive meaning that an object can be assigned to many zones at the same time if it intersects all of them.

In itself, the volume of a zone is fully sealed off from the outside. This means that while viewing the scene from inside the volume, only objects assigned to the zone are rendered while when viewing the scene from outside the volume, objects exclusively only assigned the zone are not rendered.

Usually, you will want to connect zones to each other by means of portals. A portal overlapping with a zone

Example:
// Example declaration of a Zone.  This creates a box-shaped zone.
new Zone( TestZone )
{
   position = "3.61793 -1.01945 14.7442";
   rotation = "1 0 0 0";
   scale = "10 10 10";
};

Zone Groups

Normally, Zones will not connect to each other when they overlap. This means that if viewing the scene from one zone, the contents of the other zone will not be visible except when there is a portal connecting the zones. However, sometimes it is convenient to represent a single interior space through a combination of Zones so that when any of these zones is visible, all other zones that are part of the same interior space are visible. This is possible by employing "zone groups".

See also:
Portal

Member Function Documentation

void Zone::dumpZoneState ( bool  updateFirst = true  ) 

Dump a list of all objects assigned to the zone to the console as well as a list of all connected zone spaces.

Parameters:
updateFirst Whether to update the contents of the zone before dumping. Since zoning states of objects are updated on demand, the zone contents can be outdated.
int Zone::getZoneId (  ) 

Get the unique numeric ID of the zone in its scene.

Returns:
The ID of the zone.

Member Data Documentation

Color of ambient lighting in this zone.

Only used if useAmbientLightColor is true.

string Zone::edge

For internal use only.

string Zone::plane

For internal use only.

string Zone::point

For internal use only.

Ambient sound environment for the space.

Whether to use ambientLightColor for ambient lighting in this zone or the global ambient color.

ID of group the zone is part of.



Copyright © GarageGames, LLC. All Rights Reserved.