AW AVATAR Y

From ActiveWiki
Jump to: navigation, search


Minimum requirements
Added in version 2.1
SDKbuild 13


AW_AVATAR_Y

Type

Integer

Description

Y coordinate of a users avatar.

Notes

This is the value set for AW_MY_Y when the user called aw_state_change. It specifies the avatar's elevation, with positive being above the ground and negative being below the ground.

For SDK build 27, world build 44, browser build 430; and later: It is also used by aw_avatar_set to force users into changing their avatar position.

Range

Minimum:-2147483648 centimeters (furthest down)
Maximum:2147483647 centimeters (furthest up)

Usage

#include <math.h>

void handle_avatar_change (void)
{
  int x = aw_int (AW_AVATAR_X);
  int y = aw_int (AW_AVATAR_Y);
  int z = aw_int (AW_AVATAR_Z);
  
  printf ("%s has moved to (%d, %d, %d); coordinates: %.2f%c %.2f%c %.2fa\n",
          aw_string (AW_AVATAR_NAME),
          x,
          y,
          z,
          fabs ((float)z) / 1000,
          z >= 0 ? 'N' : 'S',
          fabs ((float)x) / 1000,
          x >= 0 ? 'W' : 'E',
          (float)y / 1000);
}

aw_event_set (AW_EVENT_AVATAR_CHANGE, handle_avatar_change);

Used by

See also