AW EVENT ENTITY LINKS

From ActiveWiki
Revision as of 11:59, 18 October 2008 by Macavity (talk | contribs) (Added in, cleanup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Minimum requirements
Added in version 4.1
SDKbuild 58


AW_EVENT_ENTITY_LINKS

Description

Receives objects that have been linked to a mover.

Notes

The event is triggered by a call to aw_mover_links.

Attributes

AW_ENTITY_TYPE
AW_ENTITY_ID

Plus all the attributes provided for the object as listed in AW_EVENT_OBJECT_ADD.

Usage

void handle_mover_links (void)
{
  /* receiving links to a mover */
  printf ("Link to mover %d added into scene: %d %s\n",
    aw_int (AW_ENTITY_ID),
    aw_int (AW_OBJECT_TYPE), aw_int (AW_OBJECT_MODEL));
}

void handle_entity_add (void)
{
  if (aw_int (AW_ENTITY_TYPE) != AW_ENTITY_TYPE_MOVER)
    return;
  
  printf ("Mover %d %s added into scene\n",
    aw_int (AW_ENTITY_ID), aw_int (AW_OBJECT_MODEL));
  
  /* request links to this mover */
  aw_mover_links (aw_int (AW_ENTITY_ID));
}
aw_event_set (AW_EVENT_ENTITY_ADD, handle_entity_add);
aw_event_set (AW_EVENT_ENTITY_LINKS, handle_mover_links);

See also