view
Tweet
hifi: #21317 Create helper functions for getting into avatar coordinate space

Frequently a JS developer needs to move between world space and avatar space, which is hard. Add some helper functions to MyAvatar that make this easy:

MyAvatar.worldToAvatarPoint(Vec3)
MyAvatar.worldToAvatarDirection(Vec3)
MyAvatar.worldToAvatarRotation(Quat)

and the inverse functions:

MyAvatar.avatarToWorldPoint(Vec3)
MyAvatar.avatarToWorldDirection(Vec3)
MyAvatar.avatarToWorldRotation(Quat)

And write a helpful script called avatarToWorld.js that demonstrates these functions by rendering cyan overlay spheres at your index fingertips, as well as rendering a skinny box 'pointer' that starts at your hips and points in the direction your avatar is facing.

Comments & Activity

Labels Saved!

Bids

Login to bid
Who Amount Done in ...
*name hidden*$ ***8 hrs