Moved compuation of avatar postion using head/body joints int a helper
method. Also we compute this once per frame in setHMDSensorMatrix instead
of inside of every setPostion/setOrientation call.
MyAvatar now uses a cached copy of the HMDSensor location,
instead of calling into Application for every access.
This allows us to simplify application to always return the
most recent pose, instead of a different one pre and post physics.
Added accessors to HMD Sensor in MyAvatar, besides being helpful,
it also an optimization to avoid extracting quaternions from the
HMD matrix on every access.
* modifed openvr plugin to return different eye pose matrices.
* avatar position and physics body now follow the head.
* orientation also follows head direction
collisionsSoundURL can be set in preferences:
Currently defaults to https://s3.amazonaws.com/hifi-public/sounds/Collisions-hitsandslaps/airhockey_hit1.wav.
Can be empty, which means no sound, rather than restoring default.
MyAvatar.collisionSoundURL can read/written in scripts.
Preloads when set, so that it won't have to fetch on first collision.
Plays at start of collision only, with volume proportional to "velocity change"^2.
Need to always add _skeletonModel to the main scene when switching to head/body avatar.
Need to always remove _firstPersonSkeletonModel from main scene when switching to head/body avatar.
When the avatar is changed via set*URL, we need to set the associated model visibility appropriately.
This way when it gets added to the scene later in preRender, initWhenReady, it will render with the correct visibility settings.
The head model visibility is now updated in preRender()
Moved the near clip plane in a bit more
Invalidate head bone vector on LOD switching.
Removed _currentSkeletonModel pointer, instead use _prevShouldDrawHead to detect when we should flip the visibility bit.
Currently this model is identical to the third person model, except
that the head bones have been 'cauterized' by applying a zero scale transform.
This allows us to set the near clip back to a reasonable value.