AW_AVATAR_YAW

TYPE

Integer (read only)

DESCRIPTION

Specifies an avatar's yaw during the events AW_EVENT_AVATAR_ADD and AW_EVENT_AVATAR_CHANGE.

NOTES

Yaw is given in units of one tenth of a degree and can range in value from 0 to 3599.   A yaw of 0 is facing directly north, 900 is facing west, 1800 is facing south, and 2700 is facing east.

EXAMPLE

void avatar_change (void)
{

  int yaw;
  yaw = aw_int (AW_AVATAR_YAW);
  printf ("%s is facing ", aw_string (AW_AVATAR_NAME));
  if (yaw < 450 || yaw >= 3150)
    printf ("north\n");
  else if (yaw >= 450 && yaw < 1350)
    printf ("west\n");
  else if (yaw >= 1350 && yaw < 2250)
    printf ("south\n");
  else if (yaw >= 2250 && yaw < 3150)
    printf ("west\n");

}

aw_event_set (AW_EVENT_AVATAR_CHANGE, avatar_change);
aw_state_change ();
for (;;)
  if (aw_wait (1000))
    break;

SEE ALSO

AW_EVENT_AVATAR_ADD
AW_EVENT_AVATAR_CHANGE