-
Notifications
You must be signed in to change notification settings - Fork 278
sendVIEW
Jason Watkins edited this page Jun 2, 2015
·
3 revisions
Sets the camera view in X-Plane.
Note: This command currently works on Windows only.
Language | Signature |
---|---|
C | int sendVIEW(XPCSocket sock, VIEW_TYPE view) |
MATLAB | sendVIEW(view, socket ) |
Java | void sendVIEW(ViewType view) |
Python | sendVIEW(view) |
sock
(C): The socket used to send the command.
view
: The view to set. In Python, the ViewType class provides named constants.
The MATLAB client expects an instance from the Java gov.nasa.xpc.ViewType
enum.
socket
(MATLAB): An optional reference to a socket opened with openUDP
that
should be used to send the command.
C: A negative value if an error occurs, otherwise 0.
The current view can be checked using the sim/graphics/view/view_type
dataref,
however the value returned does not correspond to the command values used for
this command.
C Error Code | Java Exception | Python Error | Description |
---|---|---|---|
-1 | -------------- | ValueError | The specified view is not valid. |
-3 | IOException | OSError | The client is unable to send the command |
#include "xplaneConnect.h"
XPCSocket sock = openUDP(IP);
// Set the view to the chase camera
sendVIEW(sock, XPC_VIEW_CHASE);
closeUDP(sock);
import XPlaneConnect.*;
% Set the view to the chase camera
sendVIEW(sock, gov.nasa.xpc.ViewType.Chase);
import gov.nasa.xpc.XPlaneConnect;
try(XPlaneConnect xpc = new XPlaneConnect())
{
// Set the view to the chase camera
xpc.sendVIEW(ViewType.Chase);
}
import xpc
with xpc.XPlaneConnect() as client:
# Set the view to the chase camera
client.sendVIEW(xpc.ViewType.Chase)