VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
The Object Parameter Database API

DtVrfParameterDb is the base object parameter database class.

It holds a collection of DtVrfObjectParameters entries, keyed on DtObjectType. It has member functions for adding, removing, and looking up DtVrfObjectParameters entries. It also includes an interface for load() and save(), but with an empty implementation. You can create derived types of object parameter database classes that know how to load and save themselves from file in whatever format you choose.

VR-Forces has one kind of derived DtVrfParameterDb type, DtMtlParameterDb. DtMtlParameterDb extends the base class by adding the ability to load from and save to DtReaderWriter (MTL) format. The DtMtlParameterDb class knows how to read and write object parameter database files in this format and in the (pre-VR-Forces 3.7) single file format.

The DtCgf class is responsible for creating the object parameter database object. By default, it creates an instance of type DtMtlParameterDb. You can override this behavior and have VR-Forces create some other kind of derived DtVrfObjectParametersDb. To do this, register a static creator function for the new kind of DtVrfObjectParametersDb with the DtDefaultVrfCreator class before initializing the DtCgf, for example:

DtCgf cgf;
. . .
DtDefaultVrfCreator creator;
// Specify the base parameter database type, DtVrfParameterDb. This
// is the simplest kind of parameter database. It does not serialize
// itself to file in MTL format.
// Initialize the CGF, passing in our altered creator.
cgf->init(exerciseConn, 1, &creator);

The example createParamDbDynamically demonstrates how to use a different type of object parameter database with VR-Forces.


Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)