add support for game-control mode semantic data - #187
Open
AndrewMeadows wants to merge 3 commits into
Open
AndrewMeadows wants to merge 3 commits into
AndrewMeadows wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds some constants and new functions for accessing game-control mode semantic data.
Going forward the viewer will send not only the canonical data (1) but also modal data (2) to the server. The canonical data will be presented to the
game_controlevent however the modal data will be available via new function calls inside thegame_controlevent:integer mode = llGetGameControlMode(agent_id)
integer buttons = llGetGameControlModeButtons(agent_id)
list axes = llGetGameControlModeAxes(agent_id)
(1) Canonical data is organized according to how the buttons and axes as mapped to the device controller:
The canonical axes are:
(2) Modal data is organized according to how the buttons and axes are mapped to actions and will vary by the mode being used. The modes are:
For the AVATAR mode the button bits are:
And the AVATAR axes are:
Note the game controller lists the two triggers as distinct axes, but for the modes the two are always paired together as a single axis.
The CURSOR mode is interesting because the axes are not necessarily normalized to the range [-1,1]. Instead one pair of axes is the actual cursor position inside the view window, and another pair represents the normalized fractional location of the cursor within the view window.