Imposter


The Imposter object, when started by an event object (like EventOnInput) or a script, creates an imposter (a run-time clone) of objects linked to it, as long as run-time cloning is supported for those objects.

The relationship window on the Imposter object's property dialog lets you set linked objects as PARENT or MASTER. The imposter will be created at the run-time Imposter object position, or the run-time master object position.

The Imposter object will stop after creating the clones, and will be ready to be started again, to create a new imposter for each master object linked to it.

The Imposter object is typically used to create run-time instances of SkinMesh and Particles objects.

For an example of usage, please see the ImposterObjectDemo project.



Maximum imposters

When the number of imposters created exceeds the maximum specified in this box, the first imposter created will vanish while the new one is added to the scene.

It is recommended that you don't set this value higher than the amount of imposters you will actually need, as some memory space is allocated based on the value you specify, regardless of the number of imposters you will actually create, run-time.

Imposter lifetime

After the specified time has ellapsed, the imposter will be removed by the scene. This feature is useful where the imposter itself doesn't have a built-in lifetime timer.

If the lifetime specified is zero, imposters will never expire. However they will be removed from the scene if the Imposter object is reset, run-time, by an event object or a script.

Create imposters shadow

If this option is checked, each created imposter will include a shadow caster, if this is supported by the master object.

Display handle

Check this option to visualize the Imposter object handle run-time.

Use mesh map

If this option is checked, one imposter for each vertex in a specified mesh in DirectX (.x) file format will be created. For an example of usage, please see the demo project called ImposterMeshMapDemo.3dr.

The .x file to use as mesh-map can be specified by clicking the Select mesh map file button.

Imposters will be created all at the same time when the Imposter object is started (see above).

The position of each imposter will be at each vertex position. The position will be relative to Imposter object position (or master position, depending on relationship settings, see below).

Note that, unless you chose to use master object orientation (see below), each imposter relative orientation will be based on vertex normal information, as it is stored in the source .x file.

This means that the imposter will be oriented so that its local Z axis matches the vertex normal vector. So, for example, if the mesh map is a flat terrain and the imposter mesh is a tree, in order to be correctly oriented, it must be modeled so that, when imported as a regular SkinMesh, its tip points towards the +Z axis (blue axis in the Virtual Editor).

When making your own mesh maps, also note that the .x file will have to be in the data\meshmaps folder, along with the default one (meshMap.x).

Randomization

These parameters allow you to add randomization offsets to each imposter that will be created.

Randomization X/Y/Z parameters are +/- offsets from the imposter intended orientation/location, which, as said, can be based on master object, Imposter object or mesh-map.

Random variations will be source-relative (that is, reative to the master object if the master object is the souce, relative to the Imposter object if it is the source, and relative to individual vertex positions if a mesh map is used.

For scaling, randomization parameters are +/- offsets from the X/Y/Z Base scaling factors.

NOTE: base scaling is ignored if all randomization offsets are zero.

NOTE: when using mesh map's vertex normal for orientation, randomizing Z location means radomizing the position along the mesh vertex normal. So, to randomize the horizonthal location of trees on a terrain for example, you set the X and Y randomization ranges only.

Relationships

This list defines how the Imposter object relates to the objects linked to it. The following relationship types are supported:

  • IGNORE. Do nothing.


  • MASTER. This object will be used as master to create an imposter when the Imposter object is started. The imposter will be placed at the Imposter objects runtime position (same location, same orientation). You can use this setting for as many objects as needed.


  • MASTER (use orientation). Same as MASTER, but Imposter orientation will be the same as the master object. Location will be same as Imposter's. You can use this setting for as many objects as needed.


  • MASTER (use location). Same as MASTER, but Imposter location will be the same as the master object. Orientation will be same as Imposter's. You can use this setting for as many objects as needed.


  • MASTER (use position). Same as MASTER, but Imposter location AND orientation will be the same as the master object. You can use this setting for as many objects as needed.


  • PARENT. If the Imposter object is linked to another object AND the other object is set as PARENT, then, run-time, when the parent moves and rotates, the Imposter handle will follow it, keeping it's relative position as you set it in the Virtual Editor.


  • For information about the remaining controls, please click here.