Factory

Factory component functions.

Namespace: dmGameSystem
Include: #include <dmsdk/gamesys/components/comp_factory.h>
FUNCTIONS
dmGameObject::Result CompFactorySpawn(HFactoryWorld world, HFactoryComponent component, HCollection collection, dmhash_t id, dmVMath::Point3 position, dmVMath::Quat rotation, dmVMath::Vector3 scale, dmGameObject::HPropertyContainer properties, dmGameObject::HInstance out_instance) Spawns a new gameobject instance in a collection u...

Functions

CompFactorySpawn

dmGameObject::Result CompFactorySpawn(HFactoryWorld world, HFactoryComponent component, HCollection collection, dmhash_t id, dmVMath::Point3 position, dmVMath::Quat rotation, dmVMath::Vector3 scale, dmGameObject::HPropertyContainer properties, dmGameObject::HInstance out_instance)

Spawns a new gameobject instance in a collection using a factory component.

PARAMETERS

HFactoryWorld world Factory world
HFactoryComponent component Factory component
HCollection collection Gameobject collection to spawn into
dmhash_t id Identifier for the new instance. Must be unique within the collection. Pass 0 to automatically generate a unique identifier (e.g. /instance1, /instance2 etc.).
dmVMath::Point3 position Position of the spawned object
dmVMath::Quat rotation Rotation of the spawned object
dmVMath::Vector3 scale Scale of the spawned object
dmGameObject::HPropertyContainer properties Property container with override properties
dmGameObject::HInstance out_instance Output parameter for the new instance

RETURNS

dmGameObject::Result Result of the operation