Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Camera variables #126

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions SimConnect/RequestList.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ def __init__(self, _sm, _time=10, _attemps=10):
self.list.append(self.Racing)
self.EnvironmentData = self.__EnvironmentData(_sm, _time, _attemps)
self.list.append(self.EnvironmentData)
self.CameraData = self.__Camera(_sm, _time, _attemps)
self.list.append(self.CameraData)
self.SlingsandHoists = self.__SlingsandHoists(_sm, _time, _attemps)
self.list.append(self.SlingsandHoists)

Expand Down Expand Up @@ -1170,3 +1172,15 @@ class __EnvironmentData(RequestHelper):
"LOCAL_YEAR": ["Local year", b'LOCAL YEAR', b'Number', 'N'],
"TIME_ZONE_OFFSET": ["Local time difference from GMT", b'TIME ZONE OFFSET', b'Seconds', 'N'],
}

class __Camera(RequestHelper):
list = {
"CAMERA_GAMEPLAY_PITCH_YAW:index": ["Returns either the pitch (index 0) or the yaw (index 1) of the current gameplay camera.", b'CAMERA GAMEPLAY PITCH YAW:index', b'Radians', 'N'],
"CAMERA_REQUEST_ACTION": ["This can be used to have the currently active camera perform a predefined action.", b'CAMERA REQUEST ACTION', b'Enum', 'Y'],
"CAMERA_STATE": ["This can be used to get or set the camera 'state', which will be one of the listed enum values.", b'CAMERA STATE', b'Enum', 'Y'],
"CAMERA_SUBSTATE": ["This variable can be used to get or set the camera 'sub-state'.", b'CAMERA SUBSTATE', b'Enum', 'Y'],
"CAMERA_VIEW_TYPE_AND_INDEX:index": ["Get or set both the type of view for the current camera, as well as the option index.", b'CAMERA VIEW TYPE AND INDEX:index', b'Enum', 'Y'],
"CAMERA_VIEW_TYPE_AND_INDEX_MAX:index": ["Get the number of option indices related to a specific camera view type.", b'CAMERA VIEW TYPE AND INDEX MAX:index', b'Number', 'Y'],
"GAMEPLAY_CAMERA_FOCUS": ["This gets/sets the focus for the camera zoom.", b'GAMEPLAY CAMERA FOCUS', b'Number', 'Y'],
"IS_CAMERA_RAY_INTERSECT_WITH_NODE": ["Check for a collision along a ray from the center of the user FOV and a model node.", b'IS CAMERA RAY INTERSECT WITH NODE', b'Bool', 'N'],
}