QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Q::Zone Struct Reference
[QServer]

Root 3D scene object. More...

#include <Q/q.h>

Inheritance diagram for Q::Zone:

Q::Object Q::ObjectBase List of all members.

Public Types

enum  rayTestFlags {
  throughPortals = 1,
  instanceValid = 2,
  normalValid = 4,
  faceNormalValid = 8
}

Public Member Functions

 Zone ()
 Zone (const char *name)
Group root () const
Maths::Box3f box () const
Environment environment () const
Utils::Result setEnvironment (const Environment &e)
RayInfo rayTestClosest (const Maths::Vec3f &position, const Maths::Vec3f &direction, float distance, unsigned int flags, const Group &exclude)
bool rayTestClosest (const Maths::Vec3f &position, const Maths::Vec3f &direction, float distance, unsigned int flags, const Group &exclude, RayInfo *ri) const
RayInfo rayTestAny (const Maths::Vec3f &position, const Maths::Vec3f &direction, float distance, unsigned int flags, const Group &exclude)
bool rayTestAny (const Maths::Vec3f &position, const Maths::Vec3f &direction, float distance, unsigned int flags, const Group &exclude, RayInfo *ri) const
List rangeQuery (const Maths::Box3f &box, unsigned int flags, const Concept &filter) const
List rangeQuery (const Maths::Sphere3f &s, unsigned int flags, const Concept &filter) const
List rangeQuery (const Maths::Cylinder3f &s, unsigned int flags, const Concept &filter) const

Static Public Member Functions

Zone create (const char *name, const Database &db=Database())
Zone find (const char *name)
ClassType classType ()
Zone cast (const ObjectBase &)

Detailed Description

Root 3D scene object.

The Zone object is the root object for a section of a 3D scene. Typically a scene is made up from a network of zones which are connected by Portal and PortalInstance objects. This allows both efficient rendering (only zones which can be seen and are in Scope need to be rendered) and makes it possible to only load a manageable subset of the scene into memory, allowing scenes larger than the platform memory to be supported. The Zone in which the Camera resides is the only one that will be rendered into the respective CameraLayer, unless there are also visible PortalInstance in the Zone connecting to neighbouring Zones.

See also:
Scope


Member Enumeration Documentation

enum Q::Zone::rayTestFlags
 

This enumerated type defines the behaviour for the ray testing functions.

Enumeration values:
throughPortals  If the ray hits a portal then continue testing in the neighbouring Zone.
instanceValid  If the ray hits an instance then record its value in the RayInfo.
normalValid  If the ray hits a triangle based object such as a Mesh then calculate the interpolated value of the normal at the hit point and store it in the RayInfo.
faceNormalValid  If the ray hits a triangle based object such as a Mesh then store the normal of the face in the RayInfo.


Constructor & Destructor Documentation

Q::Zone::Zone  )  [inline]
 

Create a null zone reference.

Q::Zone::Zone const char *  name  ) 
 

Search the currently attached databases for a zone with the given name.


Member Function Documentation

Maths::Box3f Q::Zone::box  )  const
 

Return an axis-aligned box which contains all the geometry of a zone.

Zone Q::Zone::cast const ObjectBase  )  [static]
 

If the object referenced by obj is a zone, then return a suitable Zone reference to the object.

Note:
Casting this object will cause it to be loaded from the database if it is not currently resident.

ClassType Q::Zone::classType  )  [static]
 

Return the type for this class

Zone Q::Zone::create const char *  name,
const Database db = Database()
[static]
 

Create a new zone named name in the given database, db, (or the most recently attached read-write database if db is null).

Environment Q::Zone::environment  )  const
 

Return the environment parameters used when rendering this zone. If no environment has yet been set on the zone, then an invalid object is returned.

Zone Q::Zone::find const char *  name  )  [static]
 

Search the currently attached databases for a zone with the given name and return that object, if it exists.

List Q::Zone::rangeQuery const Maths::Cylinder3f s,
unsigned int  flags,
const Concept filter
const
 

Warning:
This method is not implemented yet.
Return a list of the objects in the zone that intersect the given cylinder. If filter is specified then only those objects that succeed in the test of 'isa(filter)' will be added to the list. The object overlaps itself and is included in the list.

Warning:
Filtering only works if databases are opened. This includes filtering by ObjectBase::ClassType.
See also:
Concept::isa

List Q::Zone::rangeQuery const Maths::Sphere3f s,
unsigned int  flags,
const Concept filter
const
 

Warning:
This method is not implemented yet.
Return a list of the objects in the zone that intersect the given sphere. If filter is specified then only those objects that succeed in the test of 'isa(filter)' will be added to the list. The object overlaps itself and is included in the list.

Warning:
Filtering only works if databases are opened. This includes filtering by ObjectBase::ClassType.
See also:
Concept::isa

List Q::Zone::rangeQuery const Maths::Box3f box,
unsigned int  flags,
const Concept filter
const
 

Return a list of Instance in the zone that are overlapped by the given box. Only those instances that are marked as collider, collidee or boundsEvent will be returned.

If filter is specified then only those objects that succeed in the test of 'isa(filter)' will be added to the list. The object overlaps itself and is included in the list.

Warning:
Filtering only works if databases are opened. This includes filtering by ObjectBase::ClassType.
See also:
Concept::isa

bool Q::Zone::rayTestAny const Maths::Vec3f position,
const Maths::Vec3f direction,
float  distance,
unsigned int  flags,
const Group exclude,
RayInfo ri
const
 

Fire a ray of length distance into the scene starting from position in the direction specified by the unit vector direction. If the ray hits any object in the scene, a description of one of the objects hit is recorded in the structure pointed to by ri and true is returned. If no object intersects the ray, false is returned and the valid flag of the structure pointed to by ri is set to false. The values of flags and exclude are interpreted as for Zone::rayTestClosest.

RayInfo Q::Zone::rayTestAny const Maths::Vec3f position,
const Maths::Vec3f direction,
float  distance,
unsigned int  flags,
const Group exclude
 

Fire a ray of length distance into the scene starting from position in the direction specified by the unit vector direction. If the ray hits any object in the scene, return a description of one of the objects which were hit. The values of flags and exclude are interpreted as for Zone::rayTestClosest.

Deprecated:
Using this method implies performing expensive structure initialisations and structure copies to create and return the method's value. On certain platforms, this time can be larger than that spent actually searching the scene. Please consider using the method which takes a pointer to the result structure.

bool Q::Zone::rayTestClosest const Maths::Vec3f position,
const Maths::Vec3f direction,
float  distance,
unsigned int  flags,
const Group exclude,
RayInfo ri
const
 

Fire a ray of length distance into the scene starting from position in the direction specified by the unit vector direction. If the ray hits any object in the scene, a description of the closest object hit is recorded in the structure pointed to by ri and true is returned, otherwise the valid flag of the structure pointed to be ri is set to false the false is returned. If exclude is non-null, the ray ignores objects in the sub-tree rooted at exclude. The value of flags is a mask of rayTestFlags and determines how much information is calculated about the hit point and also whether of not to test adjacent zones if the ray intersects a portal.

RayInfo Q::Zone::rayTestClosest const Maths::Vec3f position,
const Maths::Vec3f direction,
float  distance,
unsigned int  flags,
const Group exclude
 

Fire a ray of length distance into the scene starting from position in the direction specified by the unit vector direction. If the ray hits any object in the scene, return a description of the closest object hit. If exclude is non-null, the ray ignores objects in the sub-tree rooted at exclude. The value of flags is a mask of rayTestFlags and determines how much information is calculated about the hit point and also whether of not to test adjacent zones if the ray intersects a portal. The closest object which intersects the ray is returned.

Deprecated:
Using this method implies performing expensive structure initialisations and structure copies to create and return the method's value. On certain platforms, this time can be larger than that spent actually searching the scene. Please consider using the method which takes a pointer to the result structure.

Group Q::Zone::root  )  const
 

Return the Group which represents the root of the zone's scene graph.

Utils::Result Q::Zone::setEnvironment const Environment e  ) 
 

Set the environment parameters used when rendering this zone. An environment object maybe be used on many different zones if they all share the same properties.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004