-
Notifications
You must be signed in to change notification settings - Fork 4
flyControl
The flyControl python file centralizes all code and functions related to directly manipulating the camera rotation and position changes.
focus(): Orients the camera to look at the pivot position.
onEvent(): Processes the following mouse and keyboard events.
- KeyBoard: move camera position using the WASD and RF keys. A and D, move pan the camera along the X axis, S and W, along the Z axis, and R and F along the Y axis.
- Mouse: Dragging across the screen allows for rotation of the galaxy.
- Ctrl + Mouse Click: Selects a pivot point. Pressing Ctrl will activate Pivot-Selection mode, which will chagne the color of the galaxy to indicate being active. Then clicking the Mouse while the Ctrl key is active will select the X and Y position of the new Pivot position.
- Mouse Scroll-Wheel: Only used when pivot selection mode is active, used to set the Z axis of the pivot point. While pivot selection mode is active, a "Slice" of the galaxy corresponding to the current Z-axis position will show up as a brighter shade of green, while other parts of the galaxy will be dark red.
onUpdate(int frame, int time, float dt): updates camera position. Arguments frame and time are currently unused. dt specifies the change in time from the last time the onUpdate method was called.
enablePivotSelectorMode(bool enabled): alternates between pivot selection and non pivot mode.
resetPivot(): sets the pivot position to the center of the boundaries of the world.
setCamPos(int x, int y, int z): Sets the camera position to the arguments, with all other variables set consistent.
setCamOrientation(w,ix,iy,iz): Sets the camera orientation with the components of a Quaternion as arguments.
setPivotPoint(int x, int y, int z): Sets the coordinates of the Galaxy pivot point.
requestUpdatePos(): Sends the current camera position information to the javascript interface. This function is currently called by the javascript interface to update displayed camera position values.