HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Transform spaces

One of the pieces of data that is included with the POP_ContextData is the transform space from which this POP is being cooked. If this POP deals with coordinates in another frame of reference and it needs to transform these positions to local space, the transform object is used.

For example, suppose the POP references a SOP in /obj/geo1. Yet, the POP is being cooked from a POP Merge in /obj/geo2. Then, the POP needs to know where /obj/geo1 is located relative to /obj/geo2, so that the particles interact with the geometry in the correct space.

The particle positions in the geometry are always in local space. The POP just wants them to interact with geometry that is positioned relative to the local space. To build a transform mapping the referenced SOP's geometry into the particle system's local space, you would use the following code (in the case described above obj would point to /obj/geo1 and POP_ContextData::myXformObj would point to /obj/geo2):

getXformToReference(context, obj, data->myXformObj, xform);

This is a very advanced topic and usually won't be required for most general purpose POPs. It is only relevant for POPs that reference SOPs. Even then, it is usually simpler to use POP_Node::getGeo() which abstracts most of the details away.