Difference between revisions of "IS CPP"
Bokujishin (talk | contribs) m |
|||
| Line 1: | Line 1: | ||
| − | == | + | {{Infobox InSim packet |
| + | | description = Set the camera position, or receive the current camera position | ||
| + | | size = 32 | ||
| + | | type_key = ISP_CPP | ||
| + | | type_value = 9 | ||
| + | | direction = in-out | ||
| + | | prev = [[IS_SCC]] | ||
| + | | next = [[IS_ISM]] | ||
| + | }} | ||
The '''C'''amera '''P'''osition '''P'''acket is used to fully control the in-game camera, including standard and free view modes. It can also be requested by sending a [[InSim_enumerations#TINY|TINY_SCP]] request. | The '''C'''amera '''P'''osition '''P'''acket is used to fully control the in-game camera, including standard and free view modes. It can also be requested by sending a [[InSim_enumerations#TINY|TINY_SCP]] request. | ||
| + | |||
| + | == Packet details == | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 34: | Line 44: | ||
| word || Flags || ISS state flags (see below) | | word || Flags || ISS state flags (see below) | ||
|} | |} | ||
| − | |||
| − | |||
=== Size === | === Size === | ||
| Line 91: | Line 99: | ||
To convert the heading, pitch, and roll values to angles in degrees: | To convert the heading, pitch, and roll values to angles in degrees: | ||
| − | * heading (from positive Y axis) = H / 32768 * 180 - 180 | + | * {{var|heading}} (from positive Y axis) = {{var|H}} / 32768 * 180 - 180 |
| − | * pitch = -P / 32768 * 180 | + | * {{var|pitch}} = {{var|-P}} / 32768 * 180 |
| − | * roll = R / 32768 * 180 | + | * {{var|roll}} = {{var|R}} / 32768 * 180 |
To convert angles in degrees to heading, pitch, and roll values: | To convert angles in degrees to heading, pitch, and roll values: | ||
| − | * H = (180 + heading) * 32768 / 180 | + | * {{var|H}} = (180 + {{var|heading}}) * 32768 / 180 |
| − | * P = -pitch * 32768 / 180 | + | * {{var|P}} = {{var|-pitch}} * 32768 / 180 |
| − | * R = roll * 32768 / 180 | + | * {{var|R}} = {{var|roll}} * 32768 / 180 |
| + | |||
| + | Note that the {{kbd|/cp}} command uses a different format (heading 0 points to negative Y, roll is a floating point value, positive pitch looks down...). | ||
| − | + | {{InSim packets}} | |
[[Category:InSim packets]] | [[Category:InSim packets]] | ||
Latest revision as of 11:24, 14 February 2026
| IS_CPP | |
|---|---|
| Set the camera position, or receive the current camera position | |
| Overview | |
| Size | 32 |
| Type | ISP_CPP (9) |
| Usage | both ways |
| Previous packet IS_SCC |
Next packet IS_ISM |
The Camera Position Packet is used to fully control the in-game camera, including standard and free view modes. It can also be requested by sending a TINY_SCP request.
Packet details
| Type | Name | Description |
|---|---|---|
| byte | Size | 32 |
| byte | Type | ISP_CPP |
| byte | ReqI | instruction: 0 / or reply: ReqI as received in the TINY_SCP |
| byte | Zero | |
| Vec | Pos | Position vector |
| word | H | heading - 0 points along Y axis |
| word | P | pitch |
| word | R | roll |
| byte | ViewPLID | Unique ID of viewed player (0 = none) |
| byte | InGameCam | InGameCam (as reported in StatePack) |
| float | FOV | 4-byte float: FOV in degrees |
| word | Time | Time in ms to get there (0 means instant) |
| word | Flags | ISS state flags (see below) |
Size
The size of the packet is always 32 bytes.
Type
The packet type from the ISP_ enumeration, always ISP_CPP.
ReqI
ReqI is equal to zero, unless the packet is a reply to a TINY_SCP request.
Pos
Position vector, 3 signed integers representing the X, Y, and Z coordinates, where 65536 represents 1 metre.
H
The camera heading, a value of 0 points along the Y axis. 32768 represents 180 degrees.
P
The camera pitch, a value of 0 points "forward" horizontally. 32768 represents 180 degrees.
R
The camera roll, a value of 0 means no roll. 32768 represents 180 degrees.
ViewPLID
The unique ID of the player being viewed. A value of 0 means no player is viewed (free view only).
InGameCam
The standard camera view, as reported in IS_STA.
FOV
The field of view of the camera, in degrees.
Time
Time in ms to get to the destination. This allows smooth camera movement. A value of 0 will instantly set the camera.
Flags
A number of ISS_ state flags can be set in this packet:
- ISS_SHIFTU: free view mode
- ISS_SHIFTU_FOLLOW: follow the car designated by ViewPLID
- ISS_VIEW_OVERRIDE: override the user's view
Notes
To convert the heading, pitch, and roll values to angles in degrees:
- heading (from positive Y axis) = H / 32768 * 180 - 180
- pitch = -P / 32768 * 180
- roll = R / 32768 * 180
To convert angles in degrees to heading, pitch, and roll values:
- H = (180 + heading) * 32768 / 180
- P = -pitch * 32768 / 180
- R = roll * 32768 / 180
Note that the /cp command uses a different format (heading 0 points to negative Y, roll is a floating point value, positive pitch looks down...).
| Initialisation | IS_ISI | ||
|---|---|---|---|
| Version Information | IS_VER | ||
| General Purpose | IS_TINY · IS_SMALL · IS_TTC | ||
| State Reporting and Requests | IS_STA · IS_SFP · IS_ISM | ||
| Text Messages and Key Presses | IS_SCH · IS_MSO · IS_III · IS_MST · IS_MTC · IS_MSX · IS_MSL | ||
| Voting | IS_VTN | ||
| Race Tracking | IS_RST · IS_REO | ||
| Autocross | IS_AXI · IS_AXO · IS_UCO · IS_OCO · IS_AXM | ||
| Connection Tracking | IS_NCN · IS_CNL · IS_CPR · IS_ACR · IS_NCI · IS_SLC · IS_CIM | ||
| Car Tracking | IS_NPL · IS_PLP · IS_PLL · IS_LAP · IS_SPX · IS_PIT · IS_PSF · IS_PLA · IS_PEN · IS_TOC · IS_FLG · IS_PFL · IS_FIN · IS_RES · IS_NLP · IS_MCI · IS_CRS · IS_CON · IS_OBH · IS_HLV · IS_CSC | ||
| Camera Control | IS_SCC · IS_CPP | ||
| Replay Control | IS_RIP | ||
| Screenshots | IS_SSH | ||
| InSim Buttons | IS_BFN · IS_BTN · IS_BTC · IS_BTT | ||
| AI Control | IS_AIC · IS_AII | ||
| Other packets | IS_MOD · IS_CCH · IS_PLC · IS_HCP · IS_JRR · IS_MAL · IS_PLH · IS_IPB | ||