AW EVENT ENTITY ADD

From ActiveWiki
Revision as of 14:41, 3 November 2008 by Macavity (talk | contribs) (→‎Usage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Minimum requirements
Added in version 4.1
SDKbuild 53
Browserbuild 948


AW_EVENT_ENTITY_ADD

Description

Receives mover attributes as soon a mover comes into view.

Attributes

AW_ENTITY_TYPE
AW_ENTITY_ID
AW_ENTITY_STATE
AW_ENTITY_FLAGS
AW_ENTITY_X
AW_ENTITY_Y
AW_ENTITY_Z
AW_ENTITY_YAW
AW_ENTITY_PITCH
AW_ENTITY_ROLL
AW_ENTITY_OWNER_SESSION
AW_ENTITY_MODEL_NUM
AW_ENTITY_OWNER_CITIZEN

Plus all attributes that are also provided to define the mover object which are listed in AW_EVENT_OBJECT_ADD.

Usage

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);

See also