VX++ Framework (VxCpp.dll)
Friendly Voxon development with classes
Public Member Functions | List of all members
VoxieBox Class Reference

VoxieBox class. More...

Inheritance diagram for VoxieBox:
IVoxieBox

Public Member Functions

 VoxieBox ()
 VoxieBox constructor checks to see if another instance of VoxieBox has been created. More...
 
 ~VoxieBox ()
 Deconstructor for VoxieBox calls VoxieBox:shutdown to stop hardware and release voxiebox.dll.
 
int breath ()
 The 'update loop' for a VX application also updates voxie_input_t struct. More...
 
int breath (voxie_inputs_t *input)
 A breath is a complete volume sweep. More...
 
void startFrame ()
 start building the frame buffer. More...
 
void endFrame ()
 function to signify the end of a volumetric frame.
 
void endBreath ()
 same as VoxieBox::quitLoop() just with an alternative name - exits out the breath() loop.
 
void quitLoop ()
 Call this to tell Voxiebox library you want to exit the breath() loop and quit the application. More...
 
void shutdown ()
 frees the voxiebox.DLL from memory and allows the file to be accessed by other processes
 
int init ()
 Initializes and updates voxiebox.dll's voxie window (voxie_wind_t) More...
 
voxie_wind_tgetVoxieWindow ()
 returns a pointer to the internal voxie_wind_t struct
 
voxie_frame_tgetVoxieFrame ()
 returns a pointer to the internal voxie_frame_t struct
 
void setBorder (bool option, int color=0xffffff)
 toggles a white border around the perimeter of the volumetric display.
 
void setEnableExitOnEsc (bool option)
 Toggles the use of the 'esc' key to escape a Voxon program (by calling VoxieBox::quitLoop())
 
void setEnableNavClipping (bool option)
 Toggles nav clipping (cursor / position is always inside the volume) when using the VoxieBox::getNavPosition or the VoxieBox::drawCursor() functions. Set to false by default.
 
void setEnableMouseClipping (bool option)
 Set to true if you want the mouse to clip (cursor is always inside the volume) when using the VoxieBox::getMousePosition or the VoxieBox::drawCursor() functions.
 
void setCleanExitOnQuitLoop (bool option)
 when enabled and VoxieBox::quitLoop is called the Voxiebox library is freed from memory
 
void setEnableLegacyKeyInput (bool option)
 toggles when enabled and VoxieBox::quitLoop() is called the Voxiebox library is freed from memory. Set to true by default.
 
void setEnableLegacyJoyInput (bool option)
 Set to true to handle Joy input manually. Disables many of the joy input functions. Set to false by default.
 
void setEnableLegacyNavInput (bool option)
 Set to true to handle Nav input manually. Disables many of the nav input functions. Set to false by default.
 
void setEnableLegacyTouchInput (bool option)
 Set to true to handle Touch input manually. Disables many of the touch input functions. Set to false by default.
 
void setInvertZAxis (bool option)
 Inverts the Z axis. (by default - values are at the top of the screen and + values are below). Set to false by default.
 
void setEnableJoyDeadZone (bool option)
 Toggles a joystick / gamepad dead zone on analog sticks. Set to true by default.
 
void setEnableNavDeadZone (bool option)
 Toggles a dead zone for Space Navigator. Set to true by default.
 
double getDeltaTime ()
 Returns delta time (the time between volume updates) delta time is CPU speed dependent and can be used to make ensure timing is consistent between various computers / systems. More...
 
double getTime ()
 Returns the running time (in seconds) from program execution till present. More...
 
double getVPS ()
 Returns the system's current VPS (volumes per second). More...
 
float getAspectX ()
 Returns the internal voxie_wind_t's aspect X ratio. More...
 
float getAspectY ()
 Returns the internal voxie_wind_t's aspect Y ratio. More...
 
float getAspectZ ()
 Returns the internal voxie_wind_t's aspect Z ratio. More...
 
point3d getAspect ()
 Returns all the internal voxie_wind_t's aspect ratio values as a point3d (x,y,z) More...
 
void setAspectX (float newAspectX)
 Set the internal voxie_wind_t's X aspect ratio value and update the voxie_wind_t. More...
 
void setAspectY (float newAspectY)
 Set the internal voxie_wind_t's Y aspect ratio value and update the voxie_wind_t. More...
 
void setAspectZ (float newAspectZ)
 Set the internal voxie_wind_t's Z aspect ratio value and update the voxie_wind_t. More...
 
void setAspect (point3d newAspect)
 Set all the internal voxie_wind_t's aspect ratio values and update the voxie_wind_t. More...
 
void setDisplay2D ()
 Turns off the reciprocating screen and effectively makes the display a '2D' screen. (Works on Voxon hardware only)
 
void setDisplay3D ()
 Turns on the reciprocating screen / activates the volumetric display. (Works on Voxon hardware only)
 
void setView (float xMin, float yMin, float zMin, float xMax, float yMax, float zMax)
 Set a custom view. More...
 
void setView (point3d LUT, point3d RDB)
 Same setView() but using point3D for coordinates instead of 6 floats. More...
 
void setMaskPlane (float x0, float y0, float z0, float nx, float ny, float nz)
 Call after each VoxieBox::setView() to mask off a plane of a specified thickness. More...
 
void setGlobalShader (float horizontalAngle, float verticalAngle, float amplitude)
 changes the global normal vector (vw.normhax) for shading. More...
 
void flushGfx ()
 Flush all graphics commands on internal buffer, causing all graphics commands to actually execute and complete. More...
 
void freeGfx (const char *fileName)
 Frees a filename from VoxieBox.dll internal cache (any filename passed to voxie_drawmeshtex() / drawMesh, voxie_drawheimap() / drawHeightMap, voxie_drawspr() / drawModel) More...
 
void setProject (int dispNum, int dir, float x, float y, int z, float *xo, float *yo)
 Advanced utility function for keystone calibration (used by graphcalc and keystone calibration in voxiedemo) see the source code for voxiedemo.c for an understanding of how this works. More...
 
void setLeds (int dispNum, int r, int g, int b)
 Set LEDs values on projector hardware. More...
 
void reportVoxieWind (int posX, int posY)
 Exposes all the variables from the internal (vw) voxie_wind_t onto the secondary (touch) screen. More...
 
void reportVoxieFrame (int posX, int posY)
 Exposes some of the variables from the internal voxie_frame_t onto the secondary (touch) screen. More...
 
void reportVoxieWind (int posX, int posY, voxie_wind_t *VW)
 Exposes all the variables of a voxie_wind_t struct onto the secondary (touch) screen. More...
 
void reportVoxieFrame (int posX, int posY, voxie_frame_t *VF)
 Exposes some of the variables a voxie_frame_t struct onto the secondary (touch) screen. More...
 
void debugText (int x, int y, int fcol, int bcol, const char *fmt,...)
 display text and/or variables unto to secondary (touch) screen. Supports in printf() format specifiers. -1 for transparent color More...
 
double debugBar (int posX, int posY, double currentVal, double maxVal, double minVal, const char *text, int type)
 Draws a vertical bar for help tracking variables onto the secondary (touch) screen. More...
 
double showVPS (int posX, int posY)
 Displays volumes per second (volumetric equivalent of 'FPS') and version info on the secondary (touch) screen. More...
 
void debugDrawPix (int x, int y, int col)
 Draws single pixel on the secondary (touch) screen. More...
 
void debugDrawHLine (int xStartPos, int xEndPos, int y, int col)
 Draws horizontal line on the secondary (touch) screen. More...
 
void debugDrawLine (float xStartPos, float yStartPos, float xEndPos, float yEndPos, int col)
 Draws a line on the secondary (touch) screen. More...
 
void debugDrawCircle (int xCenterPos, int yCenterPos, int radius, int col)
 Draw circle on the secondary (touch) screen. More...
 
void debugDrawBoxFill (int xStartPos, int yStartPos, int xEndPos, int yEndPos, int col)
 Draw filled rectangle on the secondary (touch) screen. Must be called between startFrame() & endFrame() functions. More...
 
void debugDrawCircFill (int xCenterPos, int yCenterPos, int radius, int col)
 Draw filled circle on the secondary (touch) screen. Must be called between startFrame() & endFrame() functions. More...
 
void debugDrawTile (tiletype *source, int xpos, int ypos)
 Draws a texture onto the secondary (touch) screen. More...
 
bool debugCustomFontSet (const char *fileName, int index=-1)
 sets an the internal font to be a custom bitmap. @TODO finish description
 
void debugCustomFont (int xpos, int ypos, int customFontIndex, const char *fmt,...)
 Prints the custom bitmap font to the secondary (touch) screen. Must be called between startFrame() & endFrame() functions.
 
void drawVox (point3d pos, int col)
 Renders a single voxel onto the volumetric using a single point3d for coordinates. More...
 
void drawVox (float x, float y, float z, int col)
 Renders a single voxel onto the volumetric using 3 floats for coordinates. More...
 
void drawBox (point3d posLeftUpTop, point3d posRightDownBottom, int fillmode, int col)
 Renders a rectangle / box on the volumetric display using 2 point3ds for coordinates. More...
 
void drawBox (float x0, float y0, float z0, float x1, float y1, float z1, int fillmode, int col)
 Renders a rectangle/box on the volumetric display using 6 floats for coordinates.
 
void drawCube (point3d *p, point3d *r, point3d *d, point3d *f, int fillmode, int col)
 Renders a cube using specified vectors to volumetric display. Similar to VoxieBox:drawModel() but only draws a cube. More...
 
void drawSphere (point3d pos, float radius, int fillmode, int col)
 renders a sphere on the volumetric display using a point3d for position More...
 
void drawSphere (float x, float y, float z, float radius, int fillmode, int col)
 renders a sphere on the volumetric display using 3 floats More...
 
void drawLine (point3d startPos, point3d endPos, int col)
 Renders a line on the volumetric display using point3d for coordinates. More...
 
void drawLine (float xStartPos, float yStartPos, float zStartPos, float xEndPos, float yEndPos, float zEndPos, int col)
 Renders a line on the volumetric display using 6 floats for coordinates. More...
 
void drawPoly (pol_t *, int, int)
 Renders a filled polygon. Assumes points are in loop order and coplanar. More...
 
void drawMesh (const char *fileNam, poltex_t *verticeList, int verticeNum, int *meshList, int meshNum, int flags, int col)
 Draws a mesh from a list of vertices can render in as dots, lines, polygons, or filled mesh. More...
 
void drawMeshExt (const char *fileNam, point3d *VerticeXYZArray, int verticeXYZNum, uvcol_t *verticcUVCArray, int verticeUVCNum, inds_t *indiceArray, int indiceNum, int flags, int col)
 Extended version of VoxieBox::drawMesh() Draws a mesh from a list of vertices comprised of XYZ array and UVC (texture and color) and managed by an indices inds_t can render in as dots, lines, polygons, or filled mesh. More...
 
void drawCone (float xStartPos, float yStartPos, float zStartPos, float startRadius, float xEndPos, float yEndPos, float zEndPos, float endRadius, int fillmode, int col)
 Renders a cone shape on the volumetric display with rounded ends (also capable of rendering a cylinder/sphere) using 6 floats for coordinates. More...
 
void drawCone (point3d startPos, float startRadius, point3d endPos, float endRadius, int fillmode, int col)
 Renders a cone shape on the volumetric display with rounded ends (also capable of rendering a cylinder/sphere) using 2 point3ds for coordinates. More...
 
int drawModel (const char *filename, point3d *pos, point3d *rVector, point3d *dVector, point3d *fVector, int col)
 Renders 3D model (.obj, .ply, .stl, .kv6). Displays a filename mesh onto the volumetric display. More...
 
int drawModelExt (const char *filename, point3d *pos, point3d *rVector, point3d *dVector, point3d *fVector, int col, float forcescale, float fdrawratio, int flags)
 Renders 3D model (.obj, .ply, .stl, .kv6) Displays a filename mesh onto the volumetric display. Extended from VoxieBox:drawModel. More...
 
int drawModelGetExtents (const char *charbuff, extents_t *extentsPtr, int flags)
 Returns the extents of a 3D model (.obj, .kv6, .stl etc...) More...
 
void drawQuad (const char *filename, point3d *pos, float width, float height, float hang, float vang, float tilt, int col=0x404040, float uValue=1, float vValue=1)
 Renders a 2D textured (.png, .jpg... most image formats) quad (plane) onto the volumetric display. Useful to rendering 2D textures. Must be called between startFrame() & endFrame() functions. More...
 
float drawHeightMap (char *fileName, point3d *pos, point3d *rVector, point3d *dVector, point3d *fVector, int colorKey, int reserved, int flags)
 Renders a heightmap (.jpg, .png or tiletype data) onto the volumetric display. More...
 
void drawText (point3d *pos, point3d *rVector, point3d *dVector, int col, const char *fmt,...)
 Renders a string (printf-style) unto the volumetric display. More...
 
void drawTextExt (point3d *pos, point3d *rVector, point3d *dVector, float size, int col, const char *fmt,...)
 Renders a string (printf-style) unto the volumetric display w/ addition parameter to set size / radial width. More...
 
void drawTextSimp (point3d *pos, float textWidth, float textHeight, float hang, float vang, float tilt, int col, const char *fmt,...)
 Renders a string (printf-style) unto the volumetric display. Simple syntax. More...
 
void drawDicom (voxie_dicom_t *vd, const char *gfilnam, point3d *gp, point3d *gr, point3d *gd, point3d *gf, int *animn, int *loaddone)
 draw a DICOM file onto the volumetric display. - for help with this function call contact voxon photonics directly.
 
int getKeyState (int scancode)
 returns a key's input state (0 = no press, 1 = just pressed, 3 = held down) see vxInputTypes.h::Keys for scancodes More...
 
int getKeyIsDown (int scancode)
 returns 1 if the scancode's key is held down (pressed). For scancodes see vxInputTypes.h::Keys More...
 
int getKeyOnDown (int scancode)
 returns a 1 if the scancode's key is just pressed. Requires VoxieBox::setEnableLegacyKeyInput() set to false to work. For scancodes see vxInputTypes.h::Keys More...
 
double getKeyDownTime (int scancode)
 return the time (in seconds) The scancode's key has been held down for requires VoxieBox::setEnableLegacyKeyInput() to be set to false to work More...
 
int getKeyOnUp (int scancode)
 returns a 1 if the scancode's key is just released. Requires VoxieBox::setEnableLegacyKeyInput() set to false to work. For scancodes see vxInputTypes.h::Keys More...
 
int getKeyStream ()
 Returns buffered ASCII keyboard input. More...
 
int getKeyStreamScanCode ()
 Similar to getKeyStream but returns only the scancode of the keystate of a streaming state. To be run with a while loop. Returns 0 if no more keys are in the stream.
 
void reportKeyboard (int posX, int posY)
 Reports the state of the keyboard on to the secondary (touch) screen. Used to help with debugging/. More...
 
voxie_keyboard_history_t getKeyHistory ()
 returns internal voxie_keyboard_history_t struct which holds the keyboard input history. setEnableLegacyKeyInput but be set to false.
 
int getMouseXDelta ()
 Returns the internal mouse's X delta movement. Reads from internal (in) voxie_input_t. More...
 
int getMouseYDelta ()
 Returns the internal mouse's Y delta movement. Reads from the internal (in) voxie_input_t. More...
 
int getMouseZDelta ()
 Returns the internal mouse's Z delta movement. Reads from the internal (in) voxie_input_t. More...
 
point3d getMouseDelta ()
 Returns the internal mouse's X,Y and Z delta movements as a point3d. Reads from the internal (in) voxie_input_t. More...
 
point3d getMousePosition ()
 
void setMousePosition (point3d newPos)
 Overrides internal mouse position with a new point3d position. More...
 
void setMouseXYSensitivity (float newAmount)
 Set the Mouse's X and Y sensitivity. 0.001 is default. (0.0001 = low sensitive, 0.9 = extremely sensitive) Mouse movements work in integers the amount is scaled down.
 
void setMouseZSensitivity (float newAmount)
 Set the Mouse's Z sensitivity. 0.0005 is default. Since Mouse movements work in integers the amount is scaled down.
 
void setMouseDoubleClickThreshold (double timeThreshold)
 Set the time between mouse clicks to register a 'double click' (which triggers a true setting for getMouseDoubleClick()) More...
 
double getMouseDoubleClickThreshold ()
 Returns the mouse double click threshold. (how quickly 2 mouse clicks signify a 'double click'). Presented in seconds. More...
 
float getMouseZSensitivity ()
 Returns the current mouse Z sensitivity. Default is 0.0005. More...
 
float getMouseXYSensitivity ()
 Returns the current mouse XY sensitivity. Default is 0.001. More...
 
int getMouseButtonState ()
 Returns the internal mouse button state. Reads from the internal (in) voxie_input_t. More...
 
int getMousePrevButtonState ()
 Returns the internal mouse previous button state. Reads from the internal (in) voxie_input_t.
More...
 
int getMouseButtonIsDown (int buttonCode)
 Returns the state of mouse's buttonCode. More...
 
int getMouseButtonOnDown (int buttonCode)
 Returns the state of mouse's buttonCode. More...
 
int getMouseButtonOnUp (int buttonCode)
 Checks to see if desired MoustButton has been just released ('on up') More...
 
double getMouseButtonDownTime (int buttonCode)
 Returns the mount of time (in seconds) a mouse's button has been pressed. More...
 
int getMouseDoubleClick (int buttonCode)
 Returns 1 if particular Mouse's buttonCode has been clicked twice within the double click threshold. More...
 
void reportMouse (int posX, int posY, bool showCursor=true)
 Reports mouse input state information onto secondary (touch) screen. More...
 
voxie_inputs_t getMouseState ()
 returns the internal (in) voxie_inputs_t struct. More...
 
void setMouseState (voxie_inputs_t newMouse)
 Override the internal voxie_input_t mouse state. More...
 
void drawCursor (point3d *pos, int inputType, int inputID, int col)
 draws a cursor unto the volumetric display at the position specified.
More...
 
void setMouseOrientation (int orientation)
 set the orientation of the user's intended position when using the mouse More...
 
int getMouseOrientation ()
 returns the orientation set for the mouse More...
 
void AddTouchKeyboardLayout (const touchkey_t *touchkey=default_touchkey, int sizeOfArray=sizeof(default_touchkey)/sizeof(touchkey_t))
 Add custom touch keys. (enable touch keyboard under 'Misc' menu tab) More...
 
int touchManualRead (int *touchIndex, int *xVal, int *yVal, int *packetState)
 ! reads out the current Touch input states - raw return codes from the voxiebox.dll use this function if you want to manage advanced touch input manually. More...
 
void setEnableTouchInput (bool option)
 ! set to run to allow the secondary (touch) to be used as an input device. More...
 
void setDrawTouchInput (bool option)
 boolean to enable / disable drawing the touch inputs unto the (secondary) touch screen More...
 
int getTouchDeltaX (int index=-1)
 returns the X delta movement of a touch point. More...
 
int getTouchDeltaY (int index=-1)
 returns the Y delta movement of a touch point. More...
 
int getTouchPosX (int index)
 returns the a touch point's X position. More...
 
int getTouchPosY (int index)
 returns the a touch point's Y position. More...
 
int getTouchState (int index)
 returns the touch point's state. More...
 
float getTouchRotationDelta ()
 returns a pinch's touch rotation delta (the amount the two points of the pinch have changed in distance) More...
 
float getTouchDistanceDelta ()
 returns a pinch's touch distance delta (the amount the two points of the pinch have changed in distance) More...
 
int getTouchPressState (point2d TLpos, point2d BRpos, bool drawCollision=false)
 checks if a touch input has been registered within a 2D box returns a positive number if touch has been detected More...
 
int getTouchPressStateCir (point2d CirPos, float radius, bool drawCollision=false)
 checks if a touch input has been registered within a 2D circle returns a positive number if touch has been detected More...
 
int getTouchPressIndex (point2d TLpos, point2d BRpos, bool drawCollision=false)
 checks if a touch input has been registered within a 2D box returns a positive number if touch has been detected More...
 
int getTouchPressIndexCir (point2d CirPos, float radius, bool drawCollision=false)
 checks if a touch input has been registered within a 2D circle returns the touch inputs index number More...
 
touchInput_tgetTouchInputStruct ()
 gets a pointer to the internal vxInputTypes.h::touchInput_t struct. More...
 
void setTouchInputStruct (touchInput_t *newTouchInput)
 Replaces the internal touchInput_t struct with a new one could be to make your own touch I/O. More...
 
void setTouchSensitivity (float newSensitivityValue)
 sets the touch sensitivity (1 is default. More...
 
float getTouchSensitivity ()
 returns the touch sensitivity (1 is default. the higher the value the more sensitivity) More...
 
void enableTouchFocusPinch (bool choice)
 Toggles focus pinch (off by default) if set to true if a pinch has been registered all other touch inputs are nulled. More...
 
int getTouchCurrentNoPress ()
 Returns the number of active touches currently on the touch screen.
 
void reportTouch (int posX, int posY)
 Shows a debug report for advanced touch input. More...
 
voxie_xbox_t getJoyStateRaw (int controllerID)
 Returns the game controller's state as voxie_xbox_t structure. Use the SpaceNavID to determine which one (0 = 1st, 1 = 2nd etc...)
 
int updateJoyStateRaw (int controllerID, voxie_xbox_t *vx)
 Updates the game controller's input state. Used to manage game controller inputs when setEnableLegacyJoyInput() is set to true. More...
 
void setJoyInputToXInput ()
 Sets VoxieBox class to use the XInput API to read joystick inputs (for modern game controllers).
 
void setJoyInputToDirectInput ()
 Set VoxieBox class to use the DirectInput API to read joystick inputs (for older game controllers). Uses joyGetPosEx function.
 
int getJoyButtonState (int controllerID)
 returns the game controllers button state. See vxInputTypes::JoyButtonCodes for details. More...
 
int getJoyButtonIsDown (int controllerID, int joyButtonCode)
 Returns 1 if controller's button is pressed down. See vxInputTypes::JoyButtonCodes for reference on Joy Button Codes
More...
 
int getJoyButtonOnDown (int controllerID, int joyButtonCode)
 Returns 1 if controller's button is just pressed. See vxInputTypes::JoyButtonCodes for reference on Joy Button Codes. More...
 
int getJoyButtonOnUp (int controllerID, int joyButtonCode)
 Returns 1 if controller's button is just released. See vxInputTypes::JoyButtonCodes for reference on Joy Button Codes. More...
 
float getJoyAnalogAxisValue (int controllerID, int axis)
 returns a single analog axis (control stick) from a game controller. Value as an float range between -1 and 1, 0 is centred. More...
 
point2d getJoyAnalogAxisValueP2D (int controllerID, int stick)
 returns the analog axis (control stick) from a game controller. Value as an Point2d range between -1 and 1, 0 is centred. More...
 
void setJoyVibrate (int controllerID, float leftMotorSpeed, float rightMotorSpeed)
 Activates vibration motors in XBox controller. XInput controllers only. To stop Be sure to call again with lmot=0.f, rmot=0.f! More...
 
int getJoyNum ()
 Returns the number of USB game controllers detected by the system. More...
 
double getJoyButtonDownTime (int controllerID, int joyButtonCode)
 returns a value in seconds of how long a controller's button has been held down for. Requires setEnableLegacyJoyInput() to be set to false to work.
More...
 
void reportJoy (int posX, int posY)
 reports the state of the game controllers on to the secondary (touch) screen More...
 
void setJoyDeadZone (double deadZoneValue)
 Sets the internal dead zone value for game controllers. (dead zone is the area where not input is detected). Value between 0 and 1. 0 = no deadzone. 1 = all deadzone. default is 0.3;. More...
 
double getJoyDeadZone ()
 Returns the internal gamepad's dead zone value. Default is 0.3. More...
 
float getJoyTriggerValue (int controllerID, int joyTriggerCode)
 Returns a controllers analog trigger value. 0 = 0% pressed ... 1 = 100% pressed. Presented as a float. More...
 
void setJoyOrientation (int controllerID, int orientation)
 Change the orientation of the users intended position when using a game controller. At what side are they facing towards the volumetric display. More...
 
int getJoyOrientation (int controllerID)
 returns the orientation set for a specific game controller More...
 
voxie_nav_t getNavStateRaw (int spaceNavID)
 Returns the 3DConnexion Space Navigator controller state as voxie_nav_t structure. Use the SpaceNavID to determine which one (0 = 1st, 1 = 2nd etc...)
 
int updateNavStateRaw (int spaceNavID, voxie_nav_t *nav)
 Copies 3DConnexion Space Navigator controller state to voxie_nav_t structure. More...
 
int getNavNum ()
 Note for a SpaceNav to be detected it must be moved (is detected when any of the SpaceNav's axis movements) More...
 
void reportNav (int posX, int posY, bool showCursor=true)
 Reports all SpaceNav input state onto the secondary (touch screen) More...
 
int getNavButtonState (int spaceNavID)
 Returns the button values (presented as binary of each button) for the Space Navigator. 0 = none, 1 = left, 2 = right, 3 = both. More...
 
int getNavPrevButtonState (int spaceNavID)
 Returns the previous button values. Used for a legacy way to create your own button functions. Useful if setEnableLegacyNavInput() is set to true. More...
 
point3d getNavPosition (int spaceNavID)
 Return a point3d of the Nav's tracked position. Used primary when the Space Nav is being used as a cursor. More...
 
point3d getNavAngleDelta (int spaceNavID)
 returns the Space Nav's angle input delta as a point3d. Range between -1 and 1. 0 being no change. More...
 
point3d getNavDirectionDelta (int spaceNavID)
 returns the Space Nav's direction input delta as a point3d. Range between -1 and 1. 0 being no change. More...
 
float getNavDirectionDeltaAxis (int spaceNavID, int axis)
 Returns a single axis of a Space Nav's direction delta (range is -1 to 1, 0 is centered). Axis 0 = x, 1 = y, 2 = z. More...
 
float getNavAngleDeltaAxis (int spaceNavID, int axis)
 returns a single axis of a spaceNav's angle delta (range is -1 to 1, 0 is centered). Axis 0 = x, 1 = y, 2 = z More...
 
int getNavButtonIsDown (int spaceNavID, int buttonCode)
 Returns 1 if particular Space Nav's button is being pressed. Button codes are based on vxInputTypes.h::NavButton(). 0 = left button, 1 = right button. More...
 
int getNavButtonOnUp (int spaceNavID, int buttonCode)
 Returns 1 if particular Space Nav's button has been just released from being held ('on up'). More...
 
int getNavButtonOnDown (int spaceNavID, int buttonCode)
 Returns 1 if particular Space Nav's button has just been pressed. Button codes are based on vxInputTypes.h::NavButton(). 0 = left button, 1 = right button. More...
 
double getNavButtonDownTime (int spaceNavID, int buttonCode)
 Returns in seconds how long a Space Nav's button has been held down, otherwise returns a 0. More...
 
int getNavDoubleClick (int spaceNavID, int buttonCode)
 Returns 1 if particular Space Nav's buttonCode has been clicked twice within the double click threshold. More...
 
void setNavDoubleClickThreshold (double timeThreshold)
 Set the time between Space Nav clicks to register a 'double click' (which triggers a true setting for getNavDoubleClick()) More...
 
double getNavDoubleClickThreshold ()
 
void setNavDeadZone (double deadZoneValue)
 Set the internal deadzone for Space Navigators. (dead zone is the area where not input is detected) More...
 
void setNavSensitivity (int spaceNavID, double newAmount)
 Set the Space Nav's sensitivity. Used to manage the Space Nav being used as a cursor. 0.0025 is default. Higher values increase sensitivity
More...
 
double getNavSensitivity (int spaceNavID)
 
double getNavDeadZone ()
 returns the internal dead one value for the Space Navigator
 
void setNavOrientation (int spaceNavID, int orientation)
 set the orientation of the user's intended position when using a Space Nav More...
 
int getNavOrientation (int spaceNavID)
 returns the orientation set for a specific Space Nav More...
 
void menuReset (int(*menu_update)(int id, char *st, double val, int how, void *userdata), void *userdata, char *bgImageFileName)
 Function used to reset the voxie menu and set a new custom menu update function (the menu which is on the secondary touch screen) More...
 
void menuAddTab (const char *st, int x, int y, int xs, int ys)
 Add custom menu tab on secondary (touch) screen menu (NOTE: there's only space for 2 more tabs on the 7" 1024x600 LCD screen) More...
 
void menuAddItem (const char *st, int x, int y, int xSize, int ySize, int id, int type, int state, int col, double startingVal, double minVal, double maxVal1, double minStepVal, double majStepVal)
 Add item to a menu tab. More...
 
void updateMenu (int id, const char *st, int state, double v)
 Once the menu is created, use this function to update a string, button status, or slider value. More...
 
int playSound (const char *fileName, int sourceChannel, int volumeLeft, int volumeRight, float playBackSpeed)
 Plays a sound (can be WAV, FLAC, MP3, M4A) More...
 
void updateSound (int handleID, int sourceChannel, int volumeLeft, int volumeRight, float playBackSpeed)
 Update a currently playing sound. More...
 
void updateSoundPosition (int handleID, double second, int seekType=SEEK_SET)
 Updates a sound's play position to . More...
 
void setAudioPlayCallBack (void(*userplayfunc)(int *sampleBuffer, int sampleRate))
 Define a custom audio callback function to play PCM / raw audio data. More...
 
void setAudioRecordCallBack (void(*userrecfunc)(int *sampleBuffer, int sampleRate))
 Define a custom audio callback function to record PCM audio data (not a file) More...
 
void mountZip (const char *fileName)
 MountZip - extracts and loads a .zip file into memory. More...
 
void captureVolumeAsPly ()
 Causes a screen capture of the volumetric buffer to occur on the next frame. Captured as a PLY file. More...
 
void captureVolumeAsPng ()
 Causes a screen capture of the volumetric buffer to occur on the next frame. Captured as a PNG file. More...
 
void captureVolume (const char *fileName, int volCapMode, int targetVPS)
 Causes a capture of the volumetric buffer to occur on the next frame, or video capture to start /stop. More...
 
void captureVolumeStop ()
 If volumetric recording is happening. call this function to stop.
 
__int64 getVxCppVersion ()
 returns a timestamp of the compile date of VxCpp.dll expressed as an __int64. (format: YYYYMMDDHHmmss) More...
 
int scrollCol (int offset=0)
 returns a scrolling color as an RGB hexadecimal value More...
 
void setColScrollSpeed (double speed)
 Set the speed of the internal color scroller default is 0.1. Value is how long in seconds before a color change. More...
 
HINSTANCE getVoxieBoxDLLHandle ()
 Returns the handle HINSTANCE of the VoxieBox.DLL which might be need access by other DLLs (such as DemView_API)
 
int clipInsideVolume (point3d *pos, float radius=0)
 Clips a point to ensures it is within the volumes display's bounds. More...
 
int pointSame (point3d *a, point3d *b, point3d accuracy)
 Compare two point3d with a degree of accuracy. returns true if the two points are the same within the accuracy amount specified. More...
 
int pointSame (point2d *a, point2d *b, point2d accuracy)
 Compare two point2d with a degree of accuracy. returns true if the two points are the same within the accuracy amount specified. More...
 
int colorHexDivide (int color, float divideAmount)
 
int tweenCol (int color, int speed, int destcolor)
 Tweens a color to the destination color. good for fade outs or tweens. More...
 
int brightenCol (int color, int amount)
 Brighten (saturate) a color by adding only RGB values if they are needed. More...
 
int randomCol ()
 returns a random color based on the RANDOM_COLOR defined in vxDataTypes.h
 
point3d randomPos ()
 returns a random position inside the volume
 
int sphereCollideChk (point3d *sphereAPos, double sphereARadius, point3d *sphereBPos, double sphereBRadius, bool showCollisionBox=false)
 Sphere collision check. Check if two spheres are touching. Returns 1 if collision is found otherwise returns 0. More...
 
int boxInsideCollideChk (point3d *LUTpos, point3d *RDBpos, point3d collisionPos, bool showCollisionBox=false)
 Box inside collision check. Check if a position is inside a box shape. boxTLU = Top, Left, Up, boxBRD = bottom, right, down. More...
 
int boxInsideCollideChk2D (point2d *TLpos, point2d *BRpos, point2d *collisionPos, bool showCollisionBox=false)
 Box inside collision check. Check if a position is inside a box shape. boxTLU = Top, Left, Up, boxBRD = bottom, right, down. More...
 
int ciricle2DChk (point2d *circlePos, float radius, point2d *collisionPos, int showCollisionBox=0)
 Circle inside collision check. Check if a position is inside a 2D circle. Can be used for the 2D or volumetric display. More...
 
int boxCollideChk (point3d *LUTpos1, point3d *RDBpos1, point3d *LUTpos2, point3d *RDBpos2, bool showCollisionBox=false)
 Box to Box collision check. Check if two box shapes colliding. boxTLU = Top, Left, Up, boxBRD = bottom, right, down. More...
 
int moveToPos (point3d *currentPos, point3d destinationPos, float speed, float accuracy)
 Updates/"moves" a point from the current position towards the destination point. Returns 1 if currentPos collides with destinnationPos otherwise returns a 0.
More...
 
void rotVex (float angInRaidans, point3d *a, point3d *b)
 Rotate two point3d vectors a & b around their common plane, by angle expressed in radians.
 
void rotVexD (float angInDegrees, point3d *a, point3d *b)
 Rotate two point3d vectors a & b around their common plane, by angle expressed in degrees.
 
void rotVex (float angInRaidans, point2d *a, point2d *b)
 Rotate two point2d vectors a & b around their common plane, by angle expressed in radians.
 
void rotVexD (float angInDegrees, point2d *a, point2d *b)
 Rotate two point2d vectors a & b around their common plane, by angle expressed in degrees.
 
void indicesCpyXYZ_2_UVC (inds_t *indiceArray, int indiceCount)
 Helper function for VoxieBox::DrawMeshExt copies indices.xyz values to indices.uvc values and removes the starting loop flags.
More...
 
int _kzaddstack (const char *fileName)
 Internal function for managing zip files.
 
void _kzuninit ()
 Internal function for managing zip files.
 
kzfind_t * _kzfindfilestart (const char *st)
 Internal function for managing zip files.
 
int _kzfindfile (kzfind_t *find, kzfileinfo_t *fileinfo)
 Internal function for managing zip files.
 
kzfile_t * _kzsetfil (FILE *fileName)
 Internal function for managing zip files.
 
kzfile_t * _kzopen (const char *st)
 Internal function for managing zip files.
 
kzfile_t * _kzopen_ext (const char *, const char *, const char *)
 Internal zip file management function. All 'kz...' functions are to do with Ken's zip file access.
 
unsigned int _kzread (kzfile_t *kzfile, void *buffer, unsigned int leng)
 Internal function for managing zip files.
 
unsigned int _kzfilelength (kzfile_t *kzfile)
 Internal function for managing zip files.
 
unsigned int _kztell (kzfile_t *kzfile)
 Internal function for managing zip files.
 
int _kzseek (kzfile_t *kzfile, int offset, int whence)
 Internal function for managing zip files.
 
int _kzgetc (kzfile_t *kzfile)
 Internal function for managing zip files.
 
int _kzeof (kzfile_t *kzfile)
 Internal function for managing zip files.
 
void _kzclose (kzfile_t *kzfile)
 Internal function for managing zip files.
 
int _kpgetdim (const char *buffer, int nby, int *xsiz, int *ysiz)
 Internal function for managing image files.
 
int _kprender (const char *buffer, int nby, INT_PTR fptr, int bpl, int xsiz, int ysiz, int xoff, int yoff)
 Internal function for managing image files.
 
int _kpzload (const char *fileName, INT_PTR *fptr, INT_PTR *bpl, INT_PTR *xsiz, INT_PTR *ysiz)
 Internal function for managing zip files.
 

Detailed Description

VoxieBox class.

Voxiebox.dll into a VoxieBox class.

All voxiebox.dll functions presented as class with additional helper functions included.

The VoxieBox class is all the voxiebox.dll functions, helper functions and internal variables to manage a Voxon volumetric application. The VoxieBox class can be interfaced with the IVoxieBox and used a pointer reference This allows the VoxieBox class to be used with OO principals and C++ development easier for Voxon applications.

Constructor & Destructor Documentation

◆ VoxieBox()

VoxieBox::VoxieBox ( )

VoxieBox constructor checks to see if another instance of VoxieBox has been created.

If not; then loads the internal voxie_wind_t struct (vw) into memory. Then calls VoxieBox:init() & initialise the data, loads settings from voxiebox.ini and voxie_menu_0.ini

Member Function Documentation

◆ AddTouchKeyboardLayout()

void VoxieBox::AddTouchKeyboardLayout ( const touchkey_t touchkey = default_touchkey,
int  sizeOfArray = sizeof(default_touchkey) / sizeof(touchkey_t) 
)
virtual

Add custom touch keys. (enable touch keyboard under 'Misc' menu tab)

pass through an array of const touchkey_t setup your own custom touch screen layout
Make sure 'touch controls' are enabled via on the misc. tab on the VoxieMenu
@params touchkey_t * touchkey       pointer to an array of const touchkey_t structs with definitions.
@params sizeOfArray             size of how many touch buttons in the array to add

Note : call touchAddCustomLayout(NULL,NULL) to return to default layout
each touchkey_t struct contains one key the params are

            char*   title       - the title of the key
            int     xpos        - the x position of where to draw the touch button
            int     ypos        - the y position of where to draw the touch button
            int     xsize       - the size or the horizontal length of the button written as pixels
            int     ysize       - the size or the horizontal length of the button written as pixels
            int     frontColor  - the hexadecimal color value for the button
            int     backColor   - the hexadecimal color value for the button's background. -1 for transparent
            int     scanCode    - the scancode / keyboard scan code * 256 + ASCII code (0 if N/A).

            Note special keycodes for mouse: Mouse:0x0000, LBut:0x0001, RBut:0x0002, MBut:0x0003

To make a custom function callback link the touchkey_t struct to a scancode that isn't being used for example (0x8080, 0x8181) Scan codes used: ASCII codes used: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 00 01 02 03 . . . . 08 09 . . . 0d . . 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f . . . . . . . . . . . 1b . . . . 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 20 . . . . . . 27 . . 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 30 31 32 33 34 35 36 37 38 39 . 3b . 3d . . 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f . . . . . . . . . . . . . . . . 50 51 52 53 . . . 57 58 . . . . . . . . . . . . . . . . . . 5b 5c 5d . . <–0x54..0x56 (3), 0x59..0x5a (2), 0x5e..0x5f (2) . . . . . . . . . . . . . . . . 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f . . . . . . . . . . . . . . . . 70 71 72 73 74 75 76 77 78 79 7a . . . . . <–0x7b..0x9b (33) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9c 9d . . . . . . . . . . . . . . . . . . <–0x9e..0xb4 (23) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . b5 . b7 b8 . . . . . . . . . . . . . . . . . . . . . . . <–0xb9..0xc4 (12) . . . . . c5 . c7 c8 c9 . cb . cd . cf . . . . . . . . . . . . . . . . d0 d1 d2 d3 . . . . . . . . . dd . . . . . . . . . . . . . . . . . . <–0xd4..0xdc (9), 0xde..0xff (34) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

            example:
            touchkey_t = { "Touch\nonly\nFunc0", 80,100,200,200,0x405060,-1,0x8080 };
            voxie->getKeyIsDown(0x80) { ... your custom function here ... }

to actually see the custom touch controls you need to have TOUCH CONTROLLS ENABLED by default they are turned off - they can be turned on by pressing the button in the 'misc' menu or adding 'touchcontrols=1' to voxiebox.ini

Implements IVoxieBox.

◆ boxCollideChk()

int VoxieBox::boxCollideChk ( point3d LUTpos1,
point3d RDBpos1,
point3d LUTpos2,
point3d RDBpos2,
bool  showCollisionBox = false 
)
virtual

Box to Box collision check. Check if two box shapes colliding. boxTLU = Top, Left, Up, boxBRD = bottom, right, down.

Parameters
LUTpospointer to the Left, Up, Top position of the first box.
RDBpospointer to the Right, Down, Bottom position of the first box.
LUTpospointer to the Left, Up, Top position of the second box.
RDBpospointer to the Right, Down, Bottom position of the second box.
showCollisionBoxFor debugging set to false by default. Set to true to render the collision box onto the volumetric display. (Note : The collision check must be called within the start and end frame)
Returns
1 if collision position is within (inside) the box otherwise returns 0 To check to just see if a position is inside of a box use boxInsideCollidChk()

Implements IVoxieBox.

◆ boxInsideCollideChk()

int VoxieBox::boxInsideCollideChk ( point3d LUTpos,
point3d RDBpos,
point3d  collisionPos,
bool  showCollisionBox = false 
)
virtual

Box inside collision check. Check if a position is inside a box shape. boxTLU = Top, Left, Up, boxBRD = bottom, right, down.

Parameters
LUTpospointer to the Left, Up, Top position of the box.
RDBpospointer to the Right, Down, Bottom position of the box.
collisionPosthe collision position to check.
showCollisionBoxFor debugging set to false by default. Set to true to render the collision box onto the volumetric display. (Note : The collision check must be called within the start and end frame)
Returns
1 if collision position is within (inside) the box otherwise returns 0

Implements IVoxieBox.

◆ boxInsideCollideChk2D()

int VoxieBox::boxInsideCollideChk2D ( point2d TLpos,
point2d BRpos,
point2d collisionPos,
bool  showCollisionBox = false 
)
virtual

Box inside collision check. Check if a position is inside a box shape. boxTLU = Top, Left, Up, boxBRD = bottom, right, down.

Parameters
TLpospointer to the Top, Left position of the box.
BRpospointer to the Bottom, Right position of the box.
collisionPosthe collision position to check.
showCollisionBoxFor debugging set to false by default. Set to true to render the collision box onto the volumetric display. (Note : The collision check must be called within the start and end frame)
Returns
1 if collision position is within (inside) the box otherwise returns 0

Implements IVoxieBox.

◆ breath() [1/2]

int VoxieBox::breath ( )
virtual

The 'update loop' for a VX application also updates voxie_input_t struct.

Call this once per frame to update variables in voxie_inputs_t structure. returns typically returns a 1. returns a 0 when the program wants to quit. run as a while loop " while (voxiebox::breath() )" using breath() with no parameters uses internal voxie_input_t structure (in) to input updates.

Note the VxCpp version of breath() also updates: the internal timers, checks if the hardware is a rotating or up / down display, calls other input checks (for nav, joy and keyboard), listens for key input to rotate the emulator screen, and the 'Esc' key to quit the application, tracks the mouse position and updates the rainbow color variable. (most of) These are common tasks a typical VX developer would have to do themselves.

Returns
typically returns a 1, returns a 0 when the program wants to quit.

Implements IVoxieBox.

◆ breath() [2/2]

int VoxieBox::breath ( voxie_inputs_t input)
virtual

A breath is a complete volume sweep.

Call this once per frame to update variables in voxie_inputs_t structure. returns typically returns a 1. returns a 0 when the program wants to quit. run as a while loop " while (voxiebox::breath() )" using breath() with no parameters uses internal voxie_input_t structure(in) to input updates.

Note the VxCpp version of breath() also updates: the internal timers, checks if the hardware is a rotating or up / down display, calls other input checks (for nav, joy and keyboard), listens for key input to rotate the emulator screen, and the 'Esc' key to quit the application, tracks the mouse position and updates the rainbow color variable. (most of) These are common tasks a typical VX developer would have to do themselves.

Parameters
inpointer to the voxie_inputs_t to update the input state ( voxie_inputs_t() manages the mouse input )
Returns
typically returns a 1, returns a 0 when the program wants to quit.

Implements IVoxieBox.

◆ brightenCol()

int VoxieBox::brightenCol ( int  color,
int  amount 
)
virtual

Brighten (saturate) a color by adding only RGB values if they are needed.

Parameters
colorthe color value to brighten
amountthe amount of color to add range (0 - 255) each value is 1 hex value.
Returns
the new brightened color value.

Implements IVoxieBox.

◆ captureVolume()

void VoxieBox::captureVolume ( const char *  fileName,
int  volumeCaptureMode,
int  targetVPS = 15 
)
virtual

Causes a capture of the volumetric buffer to occur on the next frame, or video capture to start /stop.

Parameters
fileNamethe file name of the capture - if null writes to the next available nonexistent numbered file: VOXIE0000.PNG, VOXIE0001.PNG, ..
volumeCaptureModethe capture mode to use. Off (Stop recording) = 0, Single PLY = 1, Video PLY = 2, Single PNG = 3, Single REC = 4, Video Rec = 5, Single VCB = 6, Video VCB = 7, Volume capture Net = 9;
targetVPSif Note : If fileName is NULL, writes to the next available nonexistent numbered file: VOXIE0000.PNG, VOXIE0001.PNG, ..

Implements IVoxieBox.

◆ captureVolumeAsPly()

void VoxieBox::captureVolumeAsPly ( )
virtual

Causes a screen capture of the volumetric buffer to occur on the next frame. Captured as a PLY file.

Writes to the next available nonexistent numbered file: VOXIE0000.PNG, VOXIE0001.PNG, .. will output in the current .exe folder unless VoxieBox.ini contains "volcapdir=" variable where a custom output directory can be set (default for voxiebox.ini is "volcapdir=c:\voxon\media\MyCaptures\"

Implements IVoxieBox.

◆ captureVolumeAsPng()

void VoxieBox::captureVolumeAsPng ( )
virtual

Causes a screen capture of the volumetric buffer to occur on the next frame. Captured as a PNG file.

Writes to the next available nonexistent numbered file: VOXIE0000.PNG, VOXIE0001.PNG, .. will output in the current .exe folder unless VoxieBox.ini contains "volcapdir=" variable where a custom output directory can be set (default for voxiebox.ini is "volcapdir=c:\voxon\media\MyCaptures\"

Implements IVoxieBox.

◆ ciricle2DChk()

int VoxieBox::ciricle2DChk ( point2d circlePos,
float  radius,
point2d collisionPos,
int  showCollisionBox = 0 
)
virtual

Circle inside collision check. Check if a position is inside a 2D circle. Can be used for the 2D or volumetric display.

Parameters
circlePospointer to circle's position
radiusthe size of the circle's collision box
collisionPosthe collision position to check.
showCollisionBoxshow Collision circle For debugging set to 0 by default. 1 is for the volumetric display. 2 is for touch screen.
Returns
1 if collision position is within (inside) the circle otherwise returns 0

Implements IVoxieBox.

◆ clipInsideVolume()

int VoxieBox::clipInsideVolume ( point3d pos,
float  radius = 0 
)
virtual

Clips a point to ensures it is within the volumes display's bounds.

Adjust a point if it is outside of the volume.

Parameters
pospointer of the point3d to check
radiusthe size of radius to check
Returns
in bits of what dimension is outside the range for Up/Down 1st bit x, 2nd bit y, 3rd bit z. For Spinner 1st bit x or y, 2nd bit z

Implements IVoxieBox.

◆ colorHexDivide()

int VoxieBox::colorHexDivide ( int  color,
float  divideAmount 
)
virtual
Parameters
colorthe RGB hexadecimal color to scale down
divideAmountthe mount to divide the color value.
Returns
the new scaled down color value as an RGB hexadecimal color value.

Implements IVoxieBox.

◆ debugBar()

double VoxieBox::debugBar ( int  posx,
int  posy,
double  currentVal,
double  maxVal,
double  minVal,
const char *  text,
int  type 
)
virtual

Draws a vertical bar for help tracking variables onto the secondary (touch) screen.

Parameters
posxthe x position for the debug bar
posythe y position for the debug bar
currentValthe current value (the variable you want to track) to pass to the debug bar
maxValthe max value to render to the debug bar
minValthe min value to render to the debug bar
textany text to place with the debug bar (the title)
typethe type of debug bar. 0 = default closer to max value is 'good'. 1 = closer to max value is 'bad', 2 = mini bar (smaller version with no text), 3 = mini bar centered at 0 for results that can be postive and negative
Returns
a float which is a percentage of how close the currentVal is to the maxVal

Implements IVoxieBox.

◆ debugDrawBoxFill()

void VoxieBox::debugDrawBoxFill ( int  xStartPos,
int  yStartPos,
int  xEndPos,
int  yEndPos,
int  col 
)
virtual

Draw filled rectangle on the secondary (touch) screen. Must be called between startFrame() & endFrame() functions.

Parameters
xStartPosleft most starting position of box
yStartPostop most starting position of box
xEndPosright most ending position of box
yEndPosbottom most ending position of box
col24-bit hexadecimal RGB color value

Implements IVoxieBox.

◆ debugDrawCircFill()

void VoxieBox::debugDrawCircFill ( int  xCenterPos,
int  yCenterPos,
int  radius,
int  col 
)
virtual

Draw filled circle on the secondary (touch) screen. Must be called between startFrame() & endFrame() functions.

Parameters
xCenterPosx horizontal circle's center position
yCenterPosy vertical circle's center position
radiusradius of circle. Size in pixels
col24-bit hexadecimal RGB color value

Implements IVoxieBox.

◆ debugDrawCircle()

void VoxieBox::debugDrawCircle ( int  xCenterPos,
int  yCenterPos,
int  radius,
int  col 
)
virtual

Draw circle on the secondary (touch) screen.

Must be called between startFrame() & endFrame() functions.

Parameters
yy coordinate of the circle's center.
xx coordinate of the circle's center.
radiusradius size in pixels.
col24-bit RGB color of the line.

Implements IVoxieBox.

◆ debugDrawHLine()

void VoxieBox::debugDrawHLine ( int  xStartPos,
int  xEndPos,
int  y,
int  col = 0xffffff 
)
virtual

Draws horizontal line on the secondary (touch) screen.

Drawing is always from left to right. Must be called between startFrame() & endFrame() functions.

Parameters
xStartPoscoordinate of the starting x pixel. Needs to be the left most pixel.
xEndPoscoordinate of the ending x pixel. Needs to be the right most pixel.
ycoordinate of the y pixel. Where the line is drawn on the y axis.
col24-bit RGB color of the line.

Implements IVoxieBox.

◆ debugDrawLine()

void VoxieBox::debugDrawLine ( float  xStartPos,
float  yStartPos,
float  xEndPos,
float  yEndPos,
int  col = 0xffffff 
)
virtual

Draws a line on the secondary (touch) screen.

Must be called between startFrame() & endFrame() functions.

Parameters
xStartPoscoordinate of the starting x pixel. Needs to be the left most pixel.
xEndPoscoordinate of the ending x pixel. Needs to be the right most pixel.
yStartPoscoordinate of the starting y pixel. Needs to be the left most pixel.
yEndPoscoordinate of the ending y pixel. Needs to be the right most pixel.
col24-bit RGB color of the line.

Implements IVoxieBox.

◆ debugDrawPix()

void VoxieBox::debugDrawPix ( int  x,
int  y,
int  col = 0xffffff 
)
virtual

Draws single pixel on the secondary (touch) screen.

Must be called within the startFrame() & endFrame() functions.

Parameters
xx position of pixel location
yy position of pixel location
col24-bit RGB color

Implements IVoxieBox.

◆ debugDrawTile()

void VoxieBox::debugDrawTile ( tiletype source,
int  xpos,
int  ypos 
)
virtual

Draws a texture onto the secondary (touch) screen.

Parameters
tiletype* source pointer to a tile type
intxpos the x position to render onto the secondary (touch) screen
intypos the y position to render onto the secondary (touch) screen

Tile must be fully within bounds of screen.

                    Note :  Alpha bytes (bits 24-31) of source pixels control what's drawn:
                    0: fully transparent (pixel is ignored)
                    1-254: blending in between (NOTE: will render slower than 0 or 255)
                    255: fully opaque (pixel is copied to screen)

                    @Example on how to create a tile type data (the pure pixel data from an image

                    // how to create a tile type to show onto the 2D screen.
                        tiletype example;                               // define new tiletype type
                    example.x = 800;                                // get the image's x dimension (look at the details of the file - Windows explorer -> properties)
                    example.y = 600;                                // get the image's y dimension (look at the details of the file - Windows explorer -> properties)
                    example.p = (example.x<<2);                     // define the pitch number of bytes per horizontal line (usually x*4 but may be higher or negative)
                    example.f = (INT_PTR)malloc(balls.p*balls.y);   // create pointer to 1st pixel
                    voxie->_kpzload((char*)"example.jpg", &example.f, &example.p, &example.x, &example.y);      // load the image into file memory pass in the pointers

                    to render your tiletype unto the 2D display call
                    voxie->debugDrawTile(&example, xposition, yposition);

Implements IVoxieBox.

◆ debugText()

void VoxieBox::debugText ( int  x,
int  y,
int  fcol,
int  bcol,
const char *  fmt,
  ... 
)
virtual

display text and/or variables unto to secondary (touch) screen. Supports in printf() format specifiers. -1 for transparent color

    @example debugText(100,100, 0xffffff, -1, "Integer value %d, float value %1.2f", myInt, myFloat);
       would display a white text message 100 pixels from the left and 100 pixels from the top of touch the screen.
    The message will say "Integer value X, float value Y" with X and Y being the values of those variables.
Parameters
xx position to render text on the secondary (touch) screen
yy position to render text on the secondary (touch) screen
fcolforeground color expressed as hexadecimal value (RGB) (-1 to indicate transparent)
bcolbackground color expressed as hexadecimal value (RGB) (-1 to indicate transparent)
fmtASCII null terminated text string (must be pre-formatted by caller).

Note: must be called within the start and end of the frame functions to appear.

Implements IVoxieBox.

◆ drawBox()

void VoxieBox::drawBox ( point3d  posLeftUpTop,
point3d  posRightDownBottom,
int  fillmode = 2,
int  col = 0xffffff 
)
virtual

Renders a rectangle / box on the volumetric display using 2 point3ds for coordinates.

Parameters
posLeftUpTopleft up top corner of the box
posRightDownBottombottom, right, down corner of the box
fillmodeThe fillmode type 0:dots, 1:lines, 2:surfaces, 3:solid
colRGB 24-bit hexadecimal color value

Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawCone() [1/2]

void VoxieBox::drawCone ( float  xStartPos,
float  yStartPos,
float  zStartPos,
float  startRadius,
float  xEndPos,
float  yEndPos,
float  zEndPos,
float  endRadius,
int  fillmode,
int  col = 0xffffff 
)
virtual

Renders a cone shape on the volumetric display with rounded ends (also capable of rendering a cylinder/sphere) using 6 floats for coordinates.

Parameters
xStartPosthe x position of starting point (1st sphere)
yStartPosthe y position of starting point (1st sphere)
zStartPosthe z position of starting point (1st sphere)
startRadiusthe radius size of the starting point (1st sphere)
xEndPosthe x position of ending point (2nd sphere)
yEndPosthe y position of ending point (2nd sphere)
zEndPosthe z position of ending point (2nd sphere)
endRadiusthe radius size of the ending point (2nd sphere)
fillmodethe type of fill 0=shell, 1=solid filled
colRGB 24-bit color

Shape is basically two spheres connected together like a tube.

Note: be careful with using the solid filled (fillmode 1) type as it can quite a performance hit. (draws many voxels) Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawCone() [2/2]

void VoxieBox::drawCone ( point3d  startPos,
float  startRadius,
point3d  endPos,
float  endRadius,
int  fillmode,
int  col = 0xffffff 
)
virtual

Renders a cone shape on the volumetric display with rounded ends (also capable of rendering a cylinder/sphere) using 2 point3ds for coordinates.

Parameters
startPosthe x,y,z position of starting point (1st sphere)
startRadiusthe radius size of the starting point (1st sphere)
endPosthe x,y,z position of ending point (2nd sphere)
endRadiusthe radius size of the ending point (2nd sphere)
fillmodethe type of fill 0=shell, 1=solid filled
colRGB 24-bit color

Shape is basically two spheres connected together like a tube.

Note: be careful with using the solid filled (fillmode 1) type as it can quite a performance hit. (draws many voxels) Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawCube()

void VoxieBox::drawCube ( point3d pos,
point3d rVector,
point3d dVector,
point3d fVector,
int  fillmode = 2,
int  col = 0xffffff 
)
virtual

Renders a cube using specified vectors to volumetric display. Similar to VoxieBox:drawModel() but only draws a cube.

Parameters
posposition for left-up-top corner
rVectorright vector
dVectordown vector
fVectorforward vector
fillmode0:dots, 1:edges/wire frame, 2:surfaces, 3:solid filled
col24-bit color as RGB hexadecimal

Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawCursor()

void VoxieBox::drawCursor ( point3d pos,
int  inputType,
int  inputID,
int  col 
)
virtual

draws a cursor unto the volumetric display at the position specified.

Draws a cursor on the display based on various input types that can be used. Supports custom positions or Mouse, Gamepad or SpaceNav

Parameters
posthe position of the cursor to track
inputTypethe input type (0 is mouse, 1 is spaceNav, 2 is Joystick, 3 is all three, 4 is none, 5 is filled state (so you can make your own) )
inputIDthe identification number of the input type (which SpaceNav or Joystick?)
colthe color of the cursor

Note : as with all drawing calls, Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawHeightMap()

float VoxieBox::drawHeightMap ( char *  fileName,
point3d pos,
point3d rVector,
point3d dVector,
point3d fVector,
int  colorKey,
int  reserved,
int  flags 
)
virtual

Renders a heightmap (.jpg, .png or tiletype data) onto the volumetric display.

A heightmap is a 2D image which also contains a height channel along side it. Open up some of the heightmap examples for a demo. Demview uses them to render all its information.

Parameters
fileNamefilename or pointer to 2d array containing image & heightmap stored alpha channel.
posthe position of the top-left corner of the heightmap.
rVectorthe right vector. rVector.x indicates how wide the height map is also holds rotational data
dVectorthe down vector. rVector.y indicates how long the height map is also holds rotational data
fVectorthe forward vector. fVector.z indicates the height the height map it also holds rotational data @
colorkeyARGB 32-bit color to be transparent (supported in nearest mode only)
flagsvarious flags to adjust render settings. see flags examples.
             @example of different flag settings to use
             (1<<0): reserved (height dither now controlled by vw.dither)
             (1<<1): 0=nearest filter , 1=bilinear filter  (recommended)
             (1<<2): 0=color dither off , 1=color dither on  (recommended)
             (1<<3): 0=filnam is filename string, 1=filnam is tiletype * or pointer to 2d array.
             (1<<4): 0=texture clamp    , 1=texture wrap
             (1<<5): 0=8-bit height     , 1=mapzen.com terrarium style height

Note : about scaling and sizing the rVector.z, dVector.z, fVector.x, fVector.y are all not used to render the heightMap but their values are important for storing rotational information. the height / scale of the heightmap is the difference between pos.z and fVector.z values. pos.z is height=0, pos.z+fVector.z is height=255

Returns
average height in middle region, range:{0..255} Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawLine() [1/2]

void VoxieBox::drawLine ( float  xStartPos,
float  yStartPos,
float  zStartPos,
float  xEndPos,
float  yEndPos,
float  zEndPos,
int  col = 0xffffff 
)
virtual

Renders a line on the volumetric display using 6 floats for coordinates.

Parameters
xStartPosx position for 1st (starting) point
yStartPosy position for 1st (starting) point
zStartPosz position for 1st (starting) point
xEndPosx position for 2nd (ending) point
yEndPosy position for 2nd (ending) point
zEndPosz position for 2nd (ending) point
col24-bit hexadecimal color value (RGB)

Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawLine() [2/2]

void VoxieBox::drawLine ( point3d  startPos,
point3d  endPos,
int  col = 0xffffff 
)
virtual

Renders a line on the volumetric display using point3d for coordinates.

Parameters
startPospoint3d of first (starting) position.
endPospoint3d of second (end) position.

Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawMesh()

void VoxieBox::drawMesh ( const char *  fileName,
poltex_t verticeList,
int  verticeNum,
int *  meshList,
int  meshNum,
int  flags,
int  col = 0xffffff 
)
virtual

Draws a mesh from a list of vertices can render in as dots, lines, polygons, or filled mesh.

Parameters
fileNamtexture filename or pointer to tiletype structure if (flags&8) or leave null for no texture Be sure to fill .u and .v fields of poltex_t when using a texture.
verticeListpointer to the list of vertices array (as a poltex_t data type)
verticeNummax number of vertices in the vertices array
meshListpointer to the list of facets as vertex indices or -1 to end current primitive and start next one, -2 to end loop
meshNumnumber of entries in mesh array
flagsmostly fill mode and texture settings +0:dots, +1:lines, +2:surfaces, +3:solid, +8:texnam is tiletype * instead of filename, +16 vertex shading
col24-bit hexadecimal base color value (RGB) (0x404040) is the natural value
    @example

     //Example for fillmode 0 (dots) mesh and meshn are ignored - pass 0's in their place.
     poltex_t vt[4]; int i = 0;
     vt[0].x =-0.8; vt[0].y =-0.8; vt[0].z = 0.0; vt[0].col = 0xffffff;
     vt[1].x =+0.8; vt[1].y =+0.8; vt[1].z = 0.0; vt[1].col = 0xffffff;
     vt[2].x =-0.8; vt[2].y =+0.8; vt[2].z = 0.0; vt[2].col = 0xffffff;
     vt[3].x =+0.8; vt[3].y =-0.8; vt[3].z = 0.0; vt[3].col = 0xffffff;
     voxie_drawmeshtex(&vf,0,vt,4,0,0,0,0xffffff);

     //Example for fillmode 1 (line list): wireframe 'X'
     poltex_t vt[4]; int mesh[6]; i = 0;
     vt[0].x =-0.8; vt[0].y =-0.8; vt[0].z = 0.0; vt[0].col = 0xffffff;
     vt[1].x =+0.8; vt[1].y =+0.8; vt[1].z = 0.0; vt[1].col = 0xffffff;
     vt[2].x =-0.8; vt[2].y =+0.8; vt[2].z = 0.0; vt[2].col = 0xffffff;
     vt[3].x =+0.8; vt[3].y =-0.8; vt[3].z = 0.0; vt[3].col = 0xffffff;
     mesh[i++] = 0; mesh[i++] = 1; mesh[i++] = -1; //-1 = end of line sequence
     mesh[i++] = 2; mesh[i++] = 3; mesh[i++] = -1;
     voxie_drawmeshtex(&vf,0,vt,4,mesh,i,1,0xffffff);

     //Example for fillmode 2 (polygon list) or fillmode 3 (solid filled): tetrahedron
     poltex_t vt[4]; int mesh[16], i = 0;
     vt[0].x =-0.4; vt[0].y =-0.4; vt[0].z =-0.4; vt[0].col = 0xffffff;
     vt[1].x =-0.4; vt[1].y =+0.4; vt[1].z =+0.4; vt[1].col = 0xffffff;
     vt[2].x =+0.4; vt[2].y =-0.4; vt[2].z =+0.4; vt[2].col = 0xffffff;
     vt[3].x =+0.4; vt[3].y =+0.4; vt[3].z =-0.4; vt[3].col = 0xffffff;
     mesh[i++] = 0; mesh[i++] = 1; mesh[i++] = 2; mesh[i++] = -1; //-1 = end of polygonal facet
     mesh[i++] = 1; mesh[i++] = 0; mesh[i++] = 3; mesh[i++] = -1;
     mesh[i++] = 2; mesh[i++] = 1; mesh[i++] = 3; mesh[i++] = -1;
     mesh[i++] = 0; mesh[i++] = 2; mesh[i++] = 3; mesh[i++] = -1;
     voxie_drawmeshtex(&vf,0,vt,4,mesh,i,2 (or 3) ,0xffffff);

     //Example for fillmode 2 (complex poly w/hole: 2-triangle donut)
     poltex_t vt[6]; int mesh[8], i = 0;
     vt[0].x =-0.75; vt[0].y =+0.50; vt[0].z = 0.0; vt[0].col = 0xffffff;  //     / \
     vt[1].x = 0.00; vt[1].y =-0.75; vt[1].z = 0.0; vt[1].col = 0xffffff;  //    / . \
     vt[2].x =+0.75; vt[2].y =+0.50; vt[2].z = 0.0; vt[2].col = 0xffffff;  //   / /_\ \
     vt[3].x =-0.25; vt[3].y =+0.25; vt[3].z = 0.0; vt[3].col = 0xffffff;  //  /       \
     vt[4].x = 0.00; vt[4].y =-0.25; vt[4].z = 0.0; vt[4].col = 0xffffff;  // /---------\
     vt[5].x =+0.25; vt[5].y =+0.25; vt[5].z = 0.0; vt[5].col = 0xffffff;
     mesh[i++] = 0; mesh[i++] = 1; mesh[i++] = 2; mesh[i++] = -2; //-2 = end loop
     mesh[i++] = 3; mesh[i++] = 4; mesh[i++] = 5; mesh[i++] = -1; //-1 = end polygonal facet
     voxie_drawmeshtex(&vf,0,vt,4,mesh,i,2 (or 3),0xffffff);


@example using a tile type graphics as texture 

        // draw a QUAD mesh using make a tile type as a texture
    static tiletype img = { 0 };
    int y = 0, x = 0;
    if (!img.f) { img.x = 512; img.y = 512; img.p = (INT_PTR)img.x * 4; img.f = (INT_PTR)malloc(img.p * img.y); }

    for (y = 0; y < img.y; y++)
        for (x = 0; x < img.x; x++)
        {
            int rgb24 = (128 << 16) + (y << 8) + x, hgt8 = sqrt(256.f * 256.f - (x - 256) * (x - 256) - (y - 256) * (y - 256));
            *(int*)(img.p * y + (x << 2) + img.f) = rgb24 + (hgt8 << 24);
        }

    float xf = -0.8;
    float xSize = 1.3;
    float yf = -0.99;
    float ySize = 1.3;
    float z = 0;

    poltex_t quadPol[4];
    int quadMesh[5];

    quadPol[0].x = xf;              quadPol[0].y = yf;                      quadPol[0].z = z;
    quadPol[1].x = xf + xSize;      quadPol[1].y = yf;                      quadPol[1].z = z;
    quadPol[2].x = xf + xSize;      quadPol[2].y = yf + (ySize * 1.53);     quadPol[2].z = z;
    quadPol[3].x = xf;              quadPol[3].y = yf + (ySize * 1.53);     quadPol[3].z = z;

    quadPol[0].u = 0;               quadPol[0].v = 0;               quadPol[0].col = 0x404040; // LEFT - TOP
    quadPol[1].u = 1;               quadPol[1].v = 0;               quadPol[1].col = 0x404040; // RIGHT - TOP
    quadPol[2].u = 1;               quadPol[2].v = 1;               quadPol[2].col = 0x404040; // RIGHT - BOT
    quadPol[3].u = 0;               quadPol[3].v = 1;               quadPol[3].col = 0x404040; // LEFT - BOT

    // map the mesh
    quadMesh[0] = 0;               quadMesh[1] = 1;             quadMesh[2] = 2;            quadMesh[3] = 3;            quadMesh[4] = -1;

    voxie->drawMesh((char*)&img, quadPol, 4, quadMesh, 5, 2 + 8, 0x404040); // filmode is 2 (draw surface) + 8 (use tile type as texture)

Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawMeshExt()

void VoxieBox::drawMeshExt ( const char *  fileName,
point3d VerticeXYZArray,
int  verticeXYZNum,
uvcol_t verticcUVCArray,
int  verticeUVCNum,
inds_t indiceArray,
int  indiceNum,
int  flags,
int  col 
)
virtual

Extended version of VoxieBox::drawMesh() Draws a mesh from a list of vertices comprised of XYZ array and UVC (texture and color) and managed by an indices inds_t can render in as dots, lines, polygons, or filled mesh.

Parameters
fileNamtexture filename or pointer to tiletype structure if (flags&8) or leave null for no texture Be sure to fill .u and .v fields of poltex_t when using a texture.
VerticeXYZArraypointer to the vertice positional array (as a point3d data type)
verticeXYZNummax number of vertice XYZ count (how long the array is)
verticeUVCpointer to the array of vertice UVI array (as a uvcol_t data type)
verticeUVCNummax number of vertice UVI count (how long the array is)
indiceArraypointer to the indice indexes (both XYZ and UVI) use .xyz + (1<<31) || .xyz + EXT_START_LOOP to signify the start of a new polygon loop.
indiceNumnumber of entries in indiceArray
flagsmostly fill mode and texture settings +0:dots, +1:lines, +2:surfaces, +3:solid, +8:texnam is tiletype * instead of filename, +16 vertex shading
colbase color 24-bit hexadecimal color value (RGB) (0x404040) is the natural value
@example

//voxie_drawmeshtex_ext() setup:
point3d verticeXYZ[8]; int vXYZCount;
uvcol_t verticeUVC[8]; int vUVCCount;
inds_t indices[40]; int indCount;

//voxie_drawmeshtex_ext() -- draw a diamond

// define vertice positions and vertice U,V and color values spread over 2 different arrays.
vXYZCount = 0; vUVCCount = 0;
verticeXYZ[vXYZCount].x = -0.3; verticeXYZ[vXYZCount].y = -0.3; verticeXYZ[vXYZCount].z = 0.0;  vXYZCount++; verticeUVC[vUVCCount].col = 0xff0000; verticeUVC[vUVCCount].u = 0; verticeUVC[vUVCCount].v = 0; vUVCCount++; //LTU
verticeXYZ[vXYZCount].x = +0.3; verticeXYZ[vXYZCount].y = -0.3; verticeXYZ[vXYZCount].z = 0.0;  vXYZCount++; verticeUVC[vUVCCount].col = 0xff0000; verticeUVC[vUVCCount].u = 1; verticeUVC[vUVCCount].v = 0; vUVCCount++; //RTU
verticeXYZ[vXYZCount].x = +0.3; verticeXYZ[vXYZCount].y = 0.3;  verticeXYZ[vXYZCount].z = 0.0;  vXYZCount++; verticeUVC[vUVCCount].col = 0xff0000; verticeUVC[vUVCCount].u = 1; verticeUVC[vUVCCount].v = 1; vUVCCount++; //RBU
verticeXYZ[vXYZCount].x = -0.3; verticeXYZ[vXYZCount].y = 0.3;  verticeXYZ[vXYZCount].z = 0.0;  vXYZCount++; verticeUVC[vUVCCount].col = 0xff0000; verticeUVC[vUVCCount].u = 0; verticeUVC[vUVCCount].v = 1; vUVCCount++; //LBU
verticeXYZ[vXYZCount].x = 0;    verticeXYZ[vXYZCount].y = 0;    verticeXYZ[vXYZCount].z = -0.3; vXYZCount++; verticeUVC[vUVCCount].col = 0xff00ff; verticeUVC[vUVCCount].u = 0; verticeUVC[vUVCCount].v = 0; vUVCCount++; //top mid
verticeXYZ[vXYZCount].x = 0;    verticeXYZ[vXYZCount].y = 0;    verticeXYZ[vXYZCount].z = -0.3; vXYZCount++; verticeUVC[vUVCCount].col = 0xff00ff; verticeUVC[vUVCCount].u = 1; verticeUVC[vUVCCount].v = 1; vUVCCount++; //top mid
verticeXYZ[vXYZCount].x = 0;    verticeXYZ[vXYZCount].y = 0;    verticeXYZ[vXYZCount].z = 0.3;  vXYZCount++; verticeUVC[vUVCCount].col = 0x00ff00; verticeUVC[vUVCCount].u = 0; verticeUVC[vUVCCount].v = 0; vUVCCount++; //bot mid
verticeXYZ[vXYZCount].x = 0;    verticeXYZ[vXYZCount].y = 0;    verticeXYZ[vXYZCount].z = 0.3;  vXYZCount++; verticeUVC[vUVCCount].col = 0x00ff00; verticeUVC[vUVCCount].u = 1; verticeUVC[vUVCCount].v = 1; vUVCCount++; //bot mid

// use the inds_t struct to set define the faces / indices the xyz and col values
// the difference with using drawmeshtex_ext is that instead of using a -1 at the end of the face you add a 1 to the last bit of the 32 bit interger ( +(1<<31) ) to signitfy the start of a new face / polygon index loop.
// this could be assigned to a variable aka EXT_END_LOOP = (1<<31) (as defined in vxDataTypes.h);

// you can use EXT_START_LOOP or +(1<<31) to signify start of polygon loops aka indices[indCount++].xyzi = 0 + (1<<31);

indCount = 0;
indices[indCount++].xyzi = 0 + EXT_START_LOOP; indices[indCount++].xyzi = 5; indices[indCount++].xyzi = 1; //draw top spike
indices[indCount++].xyzi = 1 + EXT_START_LOOP; indices[indCount++].xyzi = 4; indices[indCount++].xyzi = 2;
indices[indCount++].xyzi = 2 + EXT_START_LOOP; indices[indCount++].xyzi = 4; indices[indCount++].xyzi = 3;
indices[indCount++].xyzi = 3 + EXT_START_LOOP; indices[indCount++].xyzi = 5; indices[indCount++].xyzi = 0;
indices[indCount++].xyzi = 0 + EXT_START_LOOP; indices[indCount++].xyzi = 1; indices[indCount++].xyzi = 2; //draw base
indices[indCount++].xyzi = 2 + EXT_START_LOOP; indices[indCount++].xyzi = 3; indices[indCount++].xyzi = 0;
indices[indCount++].xyzi = 0 + EXT_START_LOOP; indices[indCount++].xyzi = 7; indices[indCount++].xyzi = 1; //draw bot spike
indices[indCount++].xyzi = 1 + EXT_START_LOOP; indices[indCount++].xyzi = 6; indices[indCount++].xyzi = 2;
indices[indCount++].xyzi = 2 + EXT_START_LOOP; indices[indCount++].xyzi = 6; indices[indCount++].xyzi = 3;
indices[indCount++].xyzi = 3 + EXT_START_LOOP; indices[indCount++].xyzi = 7; indices[indCount++].xyzi = 0;

// this simple for loop just copies the indices indexes to the uvci values and set the 32nd bit to be corrected
for (int i = 0; i < indCount; i++) { indices[i].uvci = indices[i].xyzi & ~EXT_START_LOOP; }

voxie->drawMeshExt((char*)"pattern.png", verticeXYZ, vXYZCount, verticeUVC, vUVCCount,  indices, indCount, 2 + vertexShadingFlag,
Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawModel()

int VoxieBox::drawModel ( const char *  fileName,
point3d pos,
point3d rVector,
point3d dVector,
point3d fVector,
int  col = 0x404040 
)
virtual

Renders 3D model (.obj, .ply, .stl, .kv6). Displays a filename mesh onto the volumetric display.

known as voxie_drawspr ("draw sprite") in the voxiebox.h / voxiebox.dll. Renamed to "draw model" as a more apt description.

Parameters
fileNamefilename. Cached internally. Currently supports .KV6,.STL,.OBJ,.PLY
posposition of center of model (pivot)
rVectorright vector set to {1,0,0} for a unwarped normal view
dVectordown vector set to {0,1,0} for an unwarped normal view
fVectorforward vector set to {0,0,1} for an unwarped normal view
colcolor multiplier. 24-bit color, each 8 bits scales intensity of respective component. 64=1.0 or no scale. Use 0x404040 for no change; 0x808080 to draw as double brightness, etc.. (currently ignored)
Returns
1=found file & valid, 0=bad file

Note : the col parameter works differently to most col values. As it is scaled 0x404040 is equal to 0xFFFFFF color values are scaled up by x 4. You can use VoxieBox::colorHexDivide(col, 4) to divide the intended color by a 4th to render it in its true color. This is useful when you want your model to be shown at the correct color.

For more options when using this function

See also
VoxieBox::drawModelExt Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawModelExt()

int VoxieBox::drawModelExt ( const char *  fileName,
point3d pos,
point3d rVector,
point3d dVector,
point3d fVector,
int  color,
float  forceScale,
float  fdrawratio,
int  flags 
)
virtual

Renders 3D model (.obj, .ply, .stl, .kv6) Displays a filename mesh onto the volumetric display. Extended from VoxieBox:drawModel.

Known as voxie_drawspr_ext ("draw sprite extended") in the voxiebox.h / voxiebox.dll. Renamed to "draw model extended" as a more apt description.

Parameters
fileNamefilename. Cached internally. Currently supports .KV6,.STL,.OBJ,.PLY
posposition of center of model (pivot)
rVectorright vector set to {1,0,0} for a unwarped normal view
dVectordown vector set to {0,1,0} for an unwarped normal view
fVectorforward vector set to {0,0,1} for an unwarped normal view
colcolor multiplier. 24-bit color, each 8 bits scales intensity of respective component. 64=1.0 or no scale. Use 0x404040 for no change; 0x808080 to draw as double brightness, etc.. (currently ignored)
forceScalefor STL files, forces scale factor (for alignment inside ZIP animations) Leave this 0.f typically.
fdrawratiofraction of model to draw (hack for animation)
flagsBit 0:0=normal, 1:wireframe
Returns
1=found file&valid, 0=bad file

Note : the col parameter works differently to most col values. As it is scaled 0x404040 is equal to 0xFFFFFF color values are scaled up by x 4. You can use VoxieBox::colorHexDivide(col, 4) to divide the intended color by a 4th to render it in its true color. This is useful when you want your model to be shown at the correct color.

For a more simpler function

See also
VoxieBox::drawModel Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawModelGetExtents()

int VoxieBox::drawModelGetExtents ( const char *  filename,
extents_t extentsPtr,
int  flags 
)
virtual

Returns the extents of a 3D model (.obj, .kv6, .stl etc...)

Works out the distance of what a 3d model extends to. Useful to help calculate the forceScale option found in VoxieBox::drawModelExt()

Parameters
filenameof the model object to analyze
extentsPtrpointer to the extents struct to write the data to
flagsBit 0:0=normal, 1:wireframe
See also
VoxieInput.h::extents_t and VoxieBox::drawModelExt()
Returns
a 1 if file found and valid, 0 if bad file

Implements IVoxieBox.

◆ drawPoly()

void VoxieBox::drawPoly ( pol_t pt,
int  ptCount,
int  col = 0xffffff 
)
virtual

Renders a filled polygon. Assumes points are in loop order and coplanar.

Parameters
ptpointer to the pol_t array (consists list of vertices and their 'next point index')
pt_countthe number of vertices in the pol_t array
p2is an index to the next point on the loop. Holes/multiple loops are supported.
col24-bit hexadecimal color value (RGB)
     @example For example, this would draw a flat draw a rectangle:
     pol_t pt[4];
     pt[0].x = 0.0; pt[0].y = 0.0; pt[0].z = 0.0; pt[0].p2 = 1;
     pt[1].x = 0.5; pt[1].y = 0.0; pt[1].z = 0.0; pt[1].p2 = 2;
     pt[2].x = 0.5; pt[2].y = 0.8; pt[2].z = 0.0; pt[2].p2 = 3;
     pt[3].x = 0.0; pt[3].y = 0.8; pt[3].z = 0.0; pt[3].p2 = 0;
    drawPoly(pol_t &pt, 4, 0xffffff);
See also
vxDataTypes.h::pol_t

Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawQuad()

void VoxieBox::drawQuad ( const char *  filename,
point3d pos,
float  width,
float  height,
float  hAng,
float  vAng,
float  twist,
int  col = 0x404040,
float  uValue = 1,
float  vValue = 1 
)
virtual

Renders a 2D textured (.png, .jpg... most image formats) quad (plane) onto the volumetric display. Useful to rendering 2D textures. Must be called between startFrame() & endFrame() functions.

Parameters
filenamethe filename / path for the texture to load (.png, .jpg... most image formats supported)
posthe center position of the quad to render
widthx dimension of the quad (how wide).
heighty dimension of the quad (how high).
hangthe horizontal angle (yaw) . 0 is front facing. 180 is facing the back of the display. presented in degrees.
hangthe vertical angle (pitch). 0 is horizontal facing. 90 is facing vertical. presented in degrees.
twisthow much 'twist' is in the quad. (roll) in the quad 0 is flat. presented in degrees.
colthe color value of the texture 0x404040 is the natural color from the texture anything less or more will add a tint to the texture.
uthe u value of the texture. Adjusting this stretches / the horizontal texture size. Default is 1
uthe v value of the texture. Adjusting this stretches / the vertical texture size. Default is 1

Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawSphere() [1/2]

void VoxieBox::drawSphere ( float  x,
float  y,
float  z,
float  radius,
int  fillmode,
int  col = 0xffffff 
)
virtual

renders a sphere on the volumetric display using 3 floats

Parameters
xx position of the sphere's center position
yy position of the sphere's center position
zz position of the sphere's center position
radiusthe radius (size) of the sphere
fillthe fill mode 0 = shell, 1 = filled
colthe color as a RGB hex value

Must be called between startFrame() & endFrame() functions. fillmode 1 (filled) will only color absolute colors ( 0xFF0000, 0x00FF00, 0xFFFF00, etc...)

Implements IVoxieBox.

◆ drawSphere() [2/2]

void VoxieBox::drawSphere ( point3d  pos,
float  radius,
int  fillmode,
int  col = 0xffffff 
)
virtual

renders a sphere on the volumetric display using a point3d for position

Parameters
posx,y,z position of the sphere's center position
radiusthe radius (size) of the sphere
fillthe fill mode 0 = shell, 1 = filled
colthe color as a RGB hex value

Must be called between startFrame() & endFrame() functions. fillmode 1 (filled) will only color absolute colors ( 0xFF0000, 0x00FF00, 0xFFFF00, etc...)

Implements IVoxieBox.

◆ drawText()

void VoxieBox::drawText ( point3d pos,
point3d rVector,
point3d dVector,
int  col,
const char *  fmt,
  ... 
)
virtual

Renders a string (printf-style) unto the volumetric display.

Used for displaying text on the volumetric display. Best to keep the text to be near the top or bottom of the display and flat for maximum readability

Parameters
posthe left, up, top position for the text to start.
rright vector use r.x value to set the width of the text. Set r.y and r.z to 0 for straight text
ddown vector use d.y value to set the height of the text. Set d.x and d.z to 0 for straight text
colint hex color value. (0xRGB)
fmt*Extension for C/C++ allowing use of this function printf-style. Example '(char*) Hello World Show a int d", myInt'

Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawTextExt()

void VoxieBox::drawTextExt ( point3d pos,
point3d rVector,
point3d dVector,
float  size,
int  col,
const char *  fmt,
  ... 
)
virtual

Renders a string (printf-style) unto the volumetric display w/ addition parameter to set size / radial width.

Used for displaying text on the volumetric display. Best to keep the text to be near the top or bottom of the display and flat for maximum readability

Parameters
posthe left, up, top position for the text to start.
rright vector use r.x value to set the width of the text. Set r.y and r.z to 0 for straight text
ddown vector use d.y value to set the height of the text. Set d.x and d.z to 0 for straight text @oaram size the radius of the font.
colint hex color value. (0xRGB)
fmt*Extension for C/C++ allowing use of this function printf-style. Example '(char*) Hello World Show a int d", myInt'

Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawTextSimp()

void VoxieBox::drawTextSimp ( point3d pos,
float  textWidth,
float  textHeight,
float  hang,
float  vang,
float  tilt,
int  col,
const char *  fmt,
  ... 
)
virtual

Renders a string (printf-style) unto the volumetric display. Simple syntax.

Used for displaying text on the volumetric display. Best to keep the text to be near the top or bottom of the display and flat for maximum readability

Parameters
posthe left, up, top position for the text to start.
textWidthwidth of the text
textHeightheight of the text
hanghorizontal angle expressed in degrees
vangvertical angle expressed in degrees
tiltthe tilt of the text expressed in degrees
colcol int hex color value. (0xRGB)
fmt*Extension for C/C++ allowing use of this function printf-style. Example '(char*) Hello World Show a int d", myInt'

Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawVox() [1/2]

void VoxieBox::drawVox ( float  x,
float  y,
float  z,
int  col = 0xffffff 
)
virtual

Renders a single voxel onto the volumetric using 3 floats for coordinates.

Draw single voxel at specified location.

Parameters
xx position of the voxel's location
yy position of the voxel's location
zz position of the voxel's location
col24-bit hexadecimal color value

NOTE: The intensity of each color component in col is used for dithering, meaning a voxel might not plot if the intensity of the color component is less than 255. This is by design to allow shades. If you want the voxel to always plot, use 255's in each color component.

Must be called between startFrame() & endFrame() functions.

Implements IVoxieBox.

◆ drawVox() [2/2]

void VoxieBox::drawVox ( point3d  pos,
int  col = 0xffffff 
)
virtual

Renders a single voxel onto the volumetric using a single point3d for coordinates.

Draw single voxel at specified location.

Parameters
posx,y,z position of the voxel's location
col24-bit hexadecimal color value

NOTE: The intensity of each color component in col is used for dithering, meaning a voxel might not plot if the intensity of the color component is less than 255. This is by design to allow shades. If you want the voxel to always plot, use 255's in each color component.

Implements IVoxieBox.

◆ enableTouchFocusPinch()

void VoxieBox::enableTouchFocusPinch ( bool  choice)
virtual

Toggles focus pinch (off by default) if set to true if a pinch has been registered all other touch inputs are nulled.

Parameters
choiceset to true or false to enable or disable focus pinch

Implements IVoxieBox.

◆ flushGfx()

void VoxieBox::flushGfx ( void  )
virtual

Flush all graphics commands on internal buffer, causing all graphics commands to actually execute and complete.

This might be used if one wanted to do some low level access to the voxel buffer. For advanced users only.

Implements IVoxieBox.

◆ freeGfx()

void VoxieBox::freeGfx ( const char *  fileName)
virtual

Frees a filename from VoxieBox.dll internal cache (any filename passed to voxie_drawmeshtex() / drawMesh, voxie_drawheimap() / drawHeightMap, voxie_drawspr() / drawModel)

Parameters
fileNamethe file path and file name of the file to remove from the internal cache NOTE: Pass a '*' file name to remove entire internal cache

Implements IVoxieBox.

◆ getAspect()

point3d VoxieBox::getAspect ( )
virtual

Returns all the internal voxie_wind_t's aspect ratio values as a point3d (x,y,z)

Returns
returns all the internal voxie_wind_t's aspect ratio values as a point3d (x,y,z)

Implements IVoxieBox.

◆ getAspectX()

float VoxieBox::getAspectX ( )
virtual

Returns the internal voxie_wind_t's aspect X ratio.

Returns
returns the internal voxie_wind_t's aspect X ratio (default is 1)

Implements IVoxieBox.

◆ getAspectY()

float VoxieBox::getAspectY ( )
virtual

Returns the internal voxie_wind_t's aspect Y ratio.

Returns
returns the internal voxie_wind_t's aspect Y ratio (default is 1)

Implements IVoxieBox.

◆ getAspectZ()

float VoxieBox::getAspectZ ( )
virtual

Returns the internal voxie_wind_t's aspect Z ratio.

Returns
returns the internal voxie_wind_t's aspect Z ratio (default is .40)

Implements IVoxieBox.

◆ getDeltaTime()

double VoxieBox::getDeltaTime ( )
virtual

Returns delta time (the time between volume updates) delta time is CPU speed dependent and can be used to make ensure timing is consistent between various computers / systems.

Returns
in seconds the delta time (time between volume updates)

Implements IVoxieBox.

◆ getJoyAnalogAxisValue()

float VoxieBox::getJoyAnalogAxisValue ( int  controllerID,
int  axis 
)
virtual

returns a single analog axis (control stick) from a game controller. Value as an float range between -1 and 1, 0 is centred.

Parameters
controllerIDthe controller ID you want to check (0 = player 1, 1 = player 2... etc)
axisthe controller's Axis to check (vxInputTypes.h::ControllerAxis) 0 left stick x, 1 left stick y, 2 right stick x, 3 right stick y
Returns
the single analog axis as a float. Range between -1 and 1, 0 is centred. To get both the X and Y values together
See also
getJoyAnalogAxisValueP2D()

Implements IVoxieBox.

◆ getJoyAnalogAxisValueP2D()

point2d VoxieBox::getJoyAnalogAxisValueP2D ( int  controllerID,
int  stick 
)
virtual

returns the analog axis (control stick) from a game controller. Value as an Point2d range between -1 and 1, 0 is centred.

Parameters
controllerIDthe controller ID you want to check (0 = player 1, 1 = player 2... etc)
stick0 for left stick, 1 for right stick
Returns
the XY analog axis as a Point2d. Range between -1 and 1, 0 is centred. To get a single dimension
See also
getJoyAnalogAxisValue()

Implements IVoxieBox.

◆ getJoyButtonDownTime()

double VoxieBox::getJoyButtonDownTime ( int  controllerID,
int  joyButtonCode 
)
virtual

returns a value in seconds of how long a controller's button has been held down for. Requires setEnableLegacyJoyInput() to be set to false to work.

Parameters
controllerIDWhich game controller to check(0 - 3)
joyButtonCodeWhich button press to check
    JOY_DPAD_UP = 0,            //!< bit 0 value 1          Digital Dpad Up
     JOY_DPAD_DOWN = 1,         //!< bit 1 value 2          Digital Dpad Down
     JOY_DPAD_LEFT = 2,         //!< bit 2 value 4          Digital Dpad Left
     JOY_DPAD_RIGHT = 3,            //!< bit 3 value 8          Digital Dpad Right
     JOY_START = 4,             //!< bit 4 value 16         Start Button
     JOY_BACK = 5,              //!< bit 5 value 32         Back Button
     JOY_LEFT_THUMB = 6,            //!< bit 6 value 64         Left Thumb Stick Button (when you press 'down' on the left analog stick)
     JOY_RIGHT_THUMB = 7,       //!< bit 7 value 128        Right Thumb Stick Button (when you press 'down' on the right analog stick)
     JOY_LEFT_SHOULDER = 8,     //!< bit 8 value 256        Left Shoulder Bumper Button - not the Shoulder triggers are analog
     JOY_RIGHT_SHOULDER = 9,        //!< bit 9 value 512        Right Shoulder Bumper Button - not the Shoulder triggers are analog
     JOY_A = 12,                    //!< bit 12 value 1,024     The 'A' Button on a standard Xbox Controller
     JOY_B = 13,                    //!< bit 13 value 2,048     The 'B' Button on a standard Xbox Controller
     JOY_X = 14,                    //!< bit 14 value 4,096     The 'X' Button on a standard Xbox Controller
     JOY_Y = 15                 //!< bit 15 value 8,192     The 'Y' Button on a standard Xbox Controller
Returns
a value in seconds of how long controller's button has been held. Returns 0 if not button is not being pressed.

Implements IVoxieBox.

◆ getJoyButtonIsDown()

int VoxieBox::getJoyButtonIsDown ( int  controllerID,
int  joyButtonCode 
)
virtual

Returns 1 if controller's button is pressed down. See vxInputTypes::JoyButtonCodes for reference on Joy Button Codes

Parameters
controllerIDWhich game controller to check (0 - 3)
joyButtonCodeWhich button press to check
    JOY_DPAD_UP             = 0,    //!< bit 0 value 1          Digital Dpad Up
     JOY_DPAD_DOWN          = 1,    //!< bit 1 value 2          Digital Dpad Down
     JOY_DPAD_LEFT          = 2,    //!< bit 2 value 4          Digital Dpad Left
        JOY_DPAD_RIGHT          = 3,    //!< bit 3 value 8          Digital Dpad Right
     JOY_START              = 4,    //!< bit 4 value 16         Start Button
    JOY_BACK                = 5,    //!< bit 5 value 32         Back Button
    JOY_LEFT_THUMB          = 6,    //!< bit 6 value 64         Left Thumb Stick Button (when you press 'down' on the left analog stick)
    JOY_RIGHT_THUMB         = 7,    //!< bit 7 value 128        Right Thumb Stick Button (when you press 'down' on the right analog stick)
    JOY_LEFT_SHOULDER       = 8,    //!< bit 8 value 256        Left Shoulder Bumper Button - not the Shoulder triggers are analog
    JOY_RIGHT_SHOULDER      = 9,    //!< bit 9 value 512        Right Shoulder Bumper Button - not the Shoulder triggers are analog
    JOY_A                   = 12,   //!< bit 12 value 1,024     The 'A' Button on a standard Xbox Controller
    JOY_B                   = 13,   //!< bit 13 value 2,048     The 'B' Button on a standard Xbox Controller
    JOY_X                   = 14,   //!< bit 14 value 4,096     The 'X' Button on a standard Xbox Controller
    JOY_Y                   = 15    //!< bit 15 value 8,192     The 'Y' Button on a standard Xbox Controller
Returns
1 if controller's button is held down and 0 if not

Implements IVoxieBox.

◆ getJoyButtonOnDown()

int VoxieBox::getJoyButtonOnDown ( int  controllerID,
int  joyButtonCode 
)
virtual

Returns 1 if controller's button is just pressed. See vxInputTypes::JoyButtonCodes for reference on Joy Button Codes.

Parameters
controllerIDWhich game controller to check (0 - 3)
joyButtonCodeWhich button press to check
    JOY_DPAD_UP             = 0,    //!< bit 0 value 1          Digital Dpad Up
     JOY_DPAD_DOWN          = 1,    //!< bit 1 value 2          Digital Dpad Down
     JOY_DPAD_LEFT          = 2,    //!< bit 2 value 4          Digital Dpad Left
        JOY_DPAD_RIGHT          = 3,    //!< bit 3 value 8          Digital Dpad Right
     JOY_START              = 4,    //!< bit 4 value 16         Start Button
    JOY_BACK                = 5,    //!< bit 5 value 32         Back Button
    JOY_LEFT_THUMB          = 6,    //!< bit 6 value 64         Left Thumb Stick Button (when you press 'down' on the left analog stick)
    JOY_RIGHT_THUMB         = 7,    //!< bit 7 value 128        Right Thumb Stick Button (when you press 'down' on the right analog stick)
    JOY_LEFT_SHOULDER       = 8,    //!< bit 8 value 256        Left Shoulder Bumper Button - not the Shoulder triggers are analog
    JOY_RIGHT_SHOULDER      = 9,    //!< bit 9 value 512        Right Shoulder Bumper Button - not the Shoulder triggers are analog
    JOY_A                   = 12,   //!< bit 12 value 1,024     The 'A' Button on a standard Xbox Controller
    JOY_B                   = 13,   //!< bit 13 value 2,048     The 'B' Button on a standard Xbox Controller
    JOY_X                   = 14,   //!< bit 14 value 4,096     The 'X' Button on a standard Xbox Controller
    JOY_Y                   = 15    //!< bit 15 value 8,192     The 'Y' Button on a standard Xbox Controller
Returns
1 if controller's button is just pressed 0 if not.

Note : this function works differently to 'IsDown' is down just registers if the button is being pressed while on down is the first instance of the button being pressed before it is released again.

Implements IVoxieBox.

◆ getJoyButtonOnUp()

int VoxieBox::getJoyButtonOnUp ( int  controllerID,
int  joyButtonCode 
)
virtual

Returns 1 if controller's button is just released. See vxInputTypes::JoyButtonCodes for reference on Joy Button Codes.

Parameters
controllerIDWhich game controller to check (0 - 3)
joyButtonCodeWhich button press to check
    JOY_DPAD_UP             = 0,    //!< bit 0 value 1          Digital Dpad Up
     JOY_DPAD_DOWN          = 1,    //!< bit 1 value 2          Digital Dpad Down
     JOY_DPAD_LEFT          = 2,    //!< bit 2 value 4          Digital Dpad Left
        JOY_DPAD_RIGHT          = 3,    //!< bit 3 value 8          Digital Dpad Right
     JOY_START              = 4,    //!< bit 4 value 16         Start Button
    JOY_BACK                = 5,    //!< bit 5 value 32         Back Button
    JOY_LEFT_THUMB          = 6,    //!< bit 6 value 64         Left Thumb Stick Button (when you press 'down' on the left analog stick)
    JOY_RIGHT_THUMB         = 7,    //!< bit 7 value 128        Right Thumb Stick Button (when you press 'down' on the right analog stick)
    JOY_LEFT_SHOULDER       = 8,    //!< bit 8 value 256        Left Shoulder Bumper Button - not the Shoulder triggers are analog
    JOY_RIGHT_SHOULDER      = 9,    //!< bit 9 value 512        Right Shoulder Bumper Button - not the Shoulder triggers are analog
    JOY_A                   = 12,   //!< bit 12 value 1,024     The 'A' Button on a standard Xbox Controller
    JOY_B                   = 13,   //!< bit 13 value 2,048     The 'B' Button on a standard Xbox Controller
    JOY_X                   = 14,   //!< bit 14 value 4,096     The 'X' Button on a standard Xbox Controller
    JOY_Y                   = 15    //!< bit 15 value 8,192     The 'Y' Button on a standard Xbox Controller
Returns
1 if controller's button is just released 0 if not.

Implements IVoxieBox.

◆ getJoyButtonState()

int VoxieBox::getJoyButtonState ( int  controllerID)
virtual

returns the game controllers button state. See vxInputTypes::JoyButtonCodes for details.

Parameters
controllerIDthe ID number of the controller to check (0 = 1st, 1 = 2nd, 2 = 3rd, 4th)
Returns
the controls button state. Each bit represents a button.
See also
vxInputTypes::JoyButtonCodes for details.
       JOY_DPAD_UP          = 0,    //!< bit 0 value 1          Digital Dpad Up
       JOY_DPAD_DOWN            = 1,    //!< bit 1 value 2          Digital Dpad Down
       JOY_DPAD_LEFT            = 2,    //!< bit 2 value 4          Digital Dpad Left
       JOY_DPAD_RIGHT       = 3,    //!< bit 3 value 8          Digital Dpad Right
       JOY_START                = 4,    //!< bit 4 value 16         Start Button
       JOY_BACK             = 5,    //!< bit 5 value 32         Back Button
       JOY_LEFT_THUMB       = 6,    //!< bit 6 value 64         Left Thumb Stick Button (when you press 'down' on the left analog stick)
       JOY_RIGHT_THUMB      = 7,    //!< bit 7 value 128        Right Thumb Stick Button (when you press 'down' on the right analog stick)
       JOY_LEFT_SHOULDER        = 8,    //!< bit 8 value 256        Left Shoulder Bumper Button - not the Shoulder triggers are analog
       JOY_RIGHT_SHOULDER   = 9,    //!< bit 9 value 512        Right Shoulder Bumper Button - not the Shoulder triggers are analog
       JOY_A                    = 12,   //!< bit 12 value 1,024     The 'A' Button on a standard Xbox Controller
       JOY_B                    = 13,   //!< bit 13 value 2,048     The 'B' Button on a standard Xbox Controller
       JOY_X                    = 14,   //!< bit 14 value 4,096     The 'X' Button on a standard Xbox Controller
       JOY_Y                    = 15    //!< bit 15 value 8,192     The 'Y' Button on a standard Xbox Controller

Implements IVoxieBox.

◆ getJoyDeadZone()

double VoxieBox::getJoyDeadZone ( )
virtual

Returns the internal gamepad's dead zone value. Default is 0.3.

Returns
Returns the internal gamepad's dead zone value. Default is 0.3

Implements IVoxieBox.

◆ getJoyNum()

int VoxieBox::getJoyNum ( )
virtual

Returns the number of USB game controllers detected by the system.

Returns
Returns the number of USB game controllers detected by the system.

Implements IVoxieBox.

◆ getJoyOrientation()

int VoxieBox::getJoyOrientation ( int  controllerID)
virtual

returns the orientation set for a specific game controller

Parameters
controllerIDthe joy's ID of which one you want to return its orientation information
Returns
0 = front (normal), 1 = 180 ' (behind), 2 = 90 ' CCW (right side), 3 = 90 ' CW (left side)

Implements IVoxieBox.

◆ getJoyTriggerValue()

float VoxieBox::getJoyTriggerValue ( int  controllerID,
int  joyTriggerCode 
)
virtual

Returns a controllers analog trigger value. 0 = 0% pressed ... 1 = 100% pressed. Presented as a float.

Parameters
controllerIDthe ID number of the controller you want to adjust (0 = port 1,1 = port 2, 2 = port 3, 3 = port 4)
joyTriggerCodethe trigger to check 0 = left, 1 = right.
Returns
a number between 0 and 1 which represents the analog's trigger value. 0 not pressed, 1 is fully pressed.

Implements IVoxieBox.

◆ getKeyDownTime()

double VoxieBox::getKeyDownTime ( int  scancode)
virtual

return the time (in seconds) The scancode's key has been held down for requires VoxieBox::setEnableLegacyKeyInput() to be set to false to work

Parameters
scancodeeach key has a unique scancode key. For a list scancodes see vxInputTypes.h::Keys
Returns
in seconds the duration of the key's being held down. Returns -1 if legacyKeyInput is enabled

Note: VoxieBox::setEnableLegacyKeyInput() to be set to false to work otherwise will always return -1;

Implements IVoxieBox.

◆ getKeyIsDown()

int VoxieBox::getKeyIsDown ( int  scancode)
virtual

returns 1 if the scancode's key is held down (pressed). For scancodes see vxInputTypes.h::Keys

Parameters
scancodeeach key has a unique scancode key. For a list scancodes see vxInputTypes.h::Keys
Returns
0 = no press, 1 = is down. Note : Does not return 1 'on down' for the specific on down function
See also
VoxieBox::getKeyOnDown().

Implements IVoxieBox.

◆ getKeyOnDown()

int VoxieBox::getKeyOnDown ( int  scancode)
virtual

returns a 1 if the scancode's key is just pressed. Requires VoxieBox::setEnableLegacyKeyInput() set to false to work. For scancodes see vxInputTypes.h::Keys

Parameters
scancodeeach key has a unique scancode key. For a list scancodes see vxInputTypes.h::Keys
Returns
1 if key has just been pressed otherwise returns 0
See also
voxieInputTypes.h::keys

Implements IVoxieBox.

◆ getKeyOnUp()

int VoxieBox::getKeyOnUp ( int  scancode)
virtual

returns a 1 if the scancode's key is just released. Requires VoxieBox::setEnableLegacyKeyInput() set to false to work. For scancodes see vxInputTypes.h::Keys

Parameters
scancodeeach key has a unique scancode key. For a list scancodes see vxInputTypes.h::Keys
Returns
1 if key has just been released otherwise returns 0. Returns -1 if legacyKeyInput is enabled

Note: VoxieBox::setEnableLegacyKeyInput() to be set to false to work otherwise will always return -1

See also
voxieInputTypes.h::keys

Implements IVoxieBox.

◆ getKeyState()

int VoxieBox::getKeyState ( int  scancode)
virtual

returns a key's input state (0 = no press, 1 = just pressed, 3 = held down) see vxInputTypes.h::Keys for scancodes

Parameters
scancodeeach key has a unique scancode key. For a list scancodes see vxInputTypes.h::Keys

vxInputTypes.h contains an enum for all the scancodes which all start with the prefix 'KB_'

Returns
0 = no press, no change, 1 = just pressed, 3 = held down.

Implements IVoxieBox.

◆ getKeyStream()

int VoxieBox::getKeyStream ( )
virtual

Returns buffered ASCII keyboard input.

Useful for typing stuff like your name, for example. You may continue to call this function in a while loop until it returns 0. This function only works when setEnableLegacyKeyInput() is set to true. Otherwise use getKeyHistory() instead.

Returns
0: buffer is empty otherwise bits 7-0: ASCII code ('A'=65,'a'=97,'0'=48,etc..) bits 15-8: Keyboard Scan Code bit 16: Left Shift was down at time of this keypress bit 17: Right Shift was down at time of this keypress bit 18: Left Ctrl was down at time of this keypressdrawSphere bit 19: Right Ctrl was down at time of this keypress bit 20: Left Alt was down at time of this keypress bit 21: Right Alt was down at time of this keypress

Implements IVoxieBox.

◆ getMouseButtonDownTime()

double VoxieBox::getMouseButtonDownTime ( int  buttonCode)
virtual

Returns the mount of time (in seconds) a mouse's button has been pressed.

Parameters
buttonCodethe mouse button code to check (0 = left, 1 = right, 2 = middle)
Returns
in seconds the mount of time that button has been pressed.

Implements IVoxieBox.

◆ getMouseButtonIsDown()

int VoxieBox::getMouseButtonIsDown ( int  buttonCode)
virtual

Returns the state of mouse's buttonCode.

Returns
1 if currently pressed down and 0 if not being pressed.
Parameters
buttonCodethe buttonCode for the button to check. 0 = Left, 1 = Right, 2 = Center (mouse wheel button).

Implements IVoxieBox.

◆ getMouseButtonOnDown()

int VoxieBox::getMouseButtonOnDown ( int  buttonCode)
virtual

Returns the state of mouse's buttonCode.

Returns
1 if button has been pressed during this update frame otherwise 0 if not just pressed.
Parameters
buttonCodethe buttonCode for the button to check. 0 = Left, 1 = Right, 2 = Center (mouse wheel button). Note : This input check is for the instance of it being just pressed. It will return 0 if you held down a button.

Implements IVoxieBox.

◆ getMouseButtonOnUp()

int VoxieBox::getMouseButtonOnUp ( int  buttonCode)
virtual

Checks to see if desired MoustButton has been just released ('on up')

Parameters
buttonCodethe mouse button code you wish to check for (0 = left, 1 = right, 2 = both)
Returns
true if just released otherwise false

Implements IVoxieBox.

◆ getMouseButtonState()

int VoxieBox::getMouseButtonState ( )
virtual

Returns the internal mouse button state. Reads from the internal (in) voxie_input_t.

Returns
Returns the internal mouse button state. Reads from the internal (in) voxie_input_t.

Implements IVoxieBox.

◆ getMouseDelta()

point3d VoxieBox::getMouseDelta ( )
virtual

Returns the internal mouse's X,Y and Z delta movements as a point3d. Reads from the internal (in) voxie_input_t.

Returns
Returns the internal mouse's X,Y and Z delta movements as a point3d. Reads from the internal (in) voxie_input_t.

Implements IVoxieBox.

◆ getMouseDoubleClick()

int VoxieBox::getMouseDoubleClick ( int  buttonCode)
virtual

Returns 1 if particular Mouse's buttonCode has been clicked twice within the double click threshold.

Parameters
buttonCodethe mouse's button code to check (0 = left, 1 = right, 2 = middle)
Returns
1 if double click has been registered otherwise return 0.

To adjust double click threshold

See also
setMouseoubleClickThreshold()

Implements IVoxieBox.

◆ getMouseDoubleClickThreshold()

double VoxieBox::getMouseDoubleClickThreshold ( )
virtual

Returns the mouse double click threshold. (how quickly 2 mouse clicks signify a 'double click'). Presented in seconds.

Returns
Returns the mouse double click threshold. (how quickly 2 mouse clicks signify a 'double click'). Presented in seconds.

Implements IVoxieBox.

◆ getMouseOrientation()

int VoxieBox::getMouseOrientation ( )
virtual

returns the orientation set for the mouse

Parameters
spaceNavIDthe SpaceNav's ID of which one you want to return its orientation information
Returns
0 = front (normal), 1 = 180 ' (behind), 2 = 90 ' CCW (right side), 3 = 90 ' CW (left side)

Implements IVoxieBox.

◆ getMousePosition()

point3d VoxieBox::getMousePosition ( )
virtual
Returns
returns the internal mouse position as a point3d (x, y, z)

Implements IVoxieBox.

◆ getMousePrevButtonState()

int VoxieBox::getMousePrevButtonState ( )
virtual

Returns the internal mouse previous button state. Reads from the internal (in) voxie_input_t.

Could be used to write your own input functions.

Returns
Returns the internal mouse previous button state. Reads from the internal (in) voxie_input_t.

Implements IVoxieBox.

◆ getMouseState()

voxie_inputs_t VoxieBox::getMouseState ( )
virtual

returns the internal (in) voxie_inputs_t struct.

could be useful for users who want access to what the internal mouse inputs variables are at the internal voxie_inputs_t (which really just hold the mouse input variables) when updated when breath() is called. you can use setMouseState to override these values.

Returns
the internal mouse state as a voxie_inputs_t

Implements IVoxieBox.

◆ getMouseXDelta()

int VoxieBox::getMouseXDelta ( )
virtual

Returns the internal mouse's X delta movement. Reads from internal (in) voxie_input_t.

Returns
Returns the internal mouse's X delta movement. Reads from internal (in) voxie_input_t.

Implements IVoxieBox.

◆ getMouseXYSensitivity()

float VoxieBox::getMouseXYSensitivity ( )
virtual

Returns the current mouse XY sensitivity. Default is 0.001.

Returns
Returns the current mouse XY sensitivity. Default is 0.001

Implements IVoxieBox.

◆ getMouseYDelta()

int VoxieBox::getMouseYDelta ( )
virtual

Returns the internal mouse's Y delta movement. Reads from the internal (in) voxie_input_t.

Returns
Returns the internal mouse's Y delta movement. Reads from the internal (in) voxie_input_t.

Implements IVoxieBox.

◆ getMouseZDelta()

int VoxieBox::getMouseZDelta ( )
virtual

Returns the internal mouse's Z delta movement. Reads from the internal (in) voxie_input_t.

Returns
Returns the internal mouse's Z delta movement. Reads from the internal (in) voxie_input_t.

Implements IVoxieBox.

◆ getMouseZSensitivity()

float VoxieBox::getMouseZSensitivity ( )
virtual

Returns the current mouse Z sensitivity. Default is 0.0005.

Returns
Returns the current mouse Z sensitivity. Default is 0.0005

Implements IVoxieBox.

◆ getNavAngleDelta()

point3d VoxieBox::getNavAngleDelta ( int  spaceNavID)
virtual

returns the Space Nav's angle input delta as a point3d. Range between -1 and 1. 0 being no change.

Parameters
spaceNavIDthe ID number of the Space Nav to check (0 - 3)
Returns
the angle delta (what angle input has been altered since the last volume update)

Implements IVoxieBox.

◆ getNavAngleDeltaAxis()

float VoxieBox::getNavAngleDeltaAxis ( int  spaceNavID,
int  axis 
)
virtual

returns a single axis of a spaceNav's angle delta (range is -1 to 1, 0 is centered). Axis 0 = x, 1 = y, 2 = z

Parameters
spaceNavIDthe space Nav's id to fetch
axisthe axis to get the angle information 0 = x, 1 = y 2 = z;
Returns
Returns a single axis of a Space Nav's angle delta (range is -1 to 1, 0 is centered)

Implements IVoxieBox.

◆ getNavButtonDownTime()

double VoxieBox::getNavButtonDownTime ( int  spaceNavID,
int  buttonCode 
)
virtual

Returns in seconds how long a Space Nav's button has been held down, otherwise returns a 0.

Parameters
SpaceNavIDthe ID number of the Space Nav to check (0 = 1st detected, 1 = 2nd detected etc)
buttonCodethe button code to check based on vxInputTypes.h::NavButton(). 0 = left button, 1 = right button.
Returns
in seconds how long a Space Nav's button has been held down, otherwise returns a 0.

Implements IVoxieBox.

◆ getNavButtonIsDown()

int VoxieBox::getNavButtonIsDown ( int  spaceNavID,
int  buttonCode 
)
virtual

Returns 1 if particular Space Nav's button is being pressed. Button codes are based on vxInputTypes.h::NavButton(). 0 = left button, 1 = right button.

Parameters
SpaceNavIDthe ID number of the Space Nav to check (0 = 1st detected, 1 = 2nd detected etc)
buttonCodethe button code to check based on vxInputTypes.h::NavButton(). 0 = left button, 1 = right button.
Returns
1 if particular button is currently being pressed otherwise 0.

Implements IVoxieBox.

◆ getNavButtonOnDown()

int VoxieBox::getNavButtonOnDown ( int  spaceNavID,
int  buttonCode 
)
virtual

Returns 1 if particular Space Nav's button has just been pressed. Button codes are based on vxInputTypes.h::NavButton(). 0 = left button, 1 = right button.

Parameters
SpaceNavIDthe ID number of the Space Nav to check (0 = 1st detected, 1 = 2nd detected etc)
buttonCodethe button code to check based on vxInputTypes.h::NavButton(). 0 = left button, 1 = right button.
Returns
1 if particular button has just been pressed, otherwise 0. This function is 'on pressed' it will call 1 on being pressed and then 0 after the first instance of a press.

Implements IVoxieBox.

◆ getNavButtonOnUp()

int VoxieBox::getNavButtonOnUp ( int  spaceNavID,
int  buttonCode 
)
virtual

Returns 1 if particular Space Nav's button has been just released from being held ('on up').

Parameters
SpaceNavIDthe ID number of the Space Nav to check (0 = 1st detected, 1 = 2nd detected etc)
buttonCodethe button code to check based on vxInputTypes.h::NavButton(). 0 = left button, 1 = right button.
Returns
1 if button is just released, otherwise 0

Implements IVoxieBox.

◆ getNavButtonState()

int VoxieBox::getNavButtonState ( int  spaceNavID)
virtual

Returns the button values (presented as binary of each button) for the Space Navigator. 0 = none, 1 = left, 2 = right, 3 = both.

Parameters
SpaceNavIDthe ID number of the Space Nav to check (0 = 1st detected, 1 = 2nd detected etc)
Returns
bits 0 and 1 are the left and right buttons respectfully, 0 = no button pressed, 1 = left button pressed, 2 = right button pressed, 3 = both buttons pressed

Implements IVoxieBox.

◆ getNavDirectionDelta()

point3d VoxieBox::getNavDirectionDelta ( int  spaceNavID)
virtual

returns the Space Nav's direction input delta as a point3d. Range between -1 and 1. 0 being no change.

Parameters
spaceNavIDthe ID number of the Space Nav to check (0 - 3)
Returns
the direction delta (what direction input has been altered since the last volume update)

Implements IVoxieBox.

◆ getNavDirectionDeltaAxis()

float VoxieBox::getNavDirectionDeltaAxis ( int  spaceNavID,
int  axis 
)
virtual

Returns a single axis of a Space Nav's direction delta (range is -1 to 1, 0 is centered). Axis 0 = x, 1 = y, 2 = z.

Parameters
spaceNavIDthe space Nav's id to fetch
axisthe axis to get the direction information 0 = x, 1 = y 2 = z;
Returns
Returns a single axis of a Space Nav's direction delta (range is -1 to 1, 0 is centered)

Implements IVoxieBox.

◆ getNavDoubleClick()

int VoxieBox::getNavDoubleClick ( int  spaceNavID,
int  buttonCode 
)
virtual

Returns 1 if particular Space Nav's buttonCode has been clicked twice within the double click threshold.

Parameters
buttonCodethe Space Nav's button code to check (0 = left, 1 = right, 2 = both)
Returns
1 if double click has been registered otherwise return 0.

To adjust click hold threshold

See also
getNavDoubleClickThreshold()

Implements IVoxieBox.

◆ getNavDoubleClickThreshold()

double VoxieBox::getNavDoubleClickThreshold ( )
virtual
Returns
returns the internal Space Nav double click threshold value. (Used to determine if a 'double click' has been detected)

Implements IVoxieBox.

◆ getNavNum()

int VoxieBox::getNavNum ( )
virtual

Note for a SpaceNav to be detected it must be moved (is detected when any of the SpaceNav's axis movements)

Returns
returns the number of SpaceNavs detected by the system.

Implements IVoxieBox.

◆ getNavOrientation()

int VoxieBox::getNavOrientation ( int  spaceNavID)
virtual

returns the orientation set for a specific Space Nav

Parameters
spaceNavIDthe SpaceNav's ID of which one you want to return its orientation information
Returns
0 = front (normal), 1 = 180 ' (behind), 2 = 90 ' CCW (right side), 3 = 90 ' CW (left side)

Implements IVoxieBox.

◆ getNavPosition()

point3d VoxieBox::getNavPosition ( int  spaceNavID)
virtual

Return a point3d of the Nav's tracked position. Used primary when the Space Nav is being used as a cursor.

Parameters
spaceNavIDthe ID number of the Space Nav to check (0 = 1st detected, 1 = 2nd detected etc)
Returns
a point3d of the internally tracked Space Nav position

Implements IVoxieBox.

◆ getNavPrevButtonState()

int VoxieBox::getNavPrevButtonState ( int  spaceNavID)
virtual

Returns the previous button values. Used for a legacy way to create your own button functions. Useful if setEnableLegacyNavInput() is set to true.

Parameters
spaceNavIDthe ID number of the Space Nav to check (0 = 1st detected, 1 = 2nd detected etc)
Returns
the button values from the previous volume update.

Implements IVoxieBox.

◆ getNavSensitivity()

double VoxieBox::getNavSensitivity ( int  spaceNavID)
virtual
Returns
Returns the current Space Nav internal sensitivity setting
Parameters
spaceNavIDthe ID number of the Space Nav to check (0 = 1st detected, 1 = 2nd detected etc)
Returns
returns the current Space Nav internal sensitivity setting. Number between 1 and 0.0001.

Implements IVoxieBox.

◆ getTime()

double VoxieBox::getTime ( )
virtual

Returns the running time (in seconds) from program execution till present.

Returns
in seconds the running time (in seconds) from program execution till present.

Implements IVoxieBox.

◆ getTouchDeltaX()

int VoxieBox::getTouchDeltaX ( int  index = -1)
virtual

returns the X delta movement of a touch point.

To determine what touch point an index is used.

Parameters
indexthe index of the touch point to check
Returns
a pixel horizontal X location of the touch point Note : If index = -1 the global delta is used (the sum of all touch inputs deltas)

Implements IVoxieBox.

◆ getTouchDeltaY()

int VoxieBox::getTouchDeltaY ( int  index = -1)
virtual

returns the Y delta movement of a touch point.

To determine what touch point an index is used.

Parameters
indexthe index of the touch point to check
Returns
a pixel horizontal Y location of the touch point Note : If index = -1 the global delta is used (the sum of all touch inputs deltas)

Implements IVoxieBox.

◆ getTouchDistanceDelta()

float VoxieBox::getTouchDistanceDelta ( )
virtual

returns a pinch's touch distance delta (the amount the two points of the pinch have changed in distance)

Returns
float in pixels of distance

Implements IVoxieBox.

◆ getTouchInputStruct()

touchInput_t * VoxieBox::getTouchInputStruct ( )
virtual

gets a pointer to the internal vxInputTypes.h::touchInput_t struct.

Returns
a touchInput_t * pointer

Implements IVoxieBox.

◆ getTouchPosX()

int VoxieBox::getTouchPosX ( int  index)
virtual

returns the a touch point's X position.

To determine what touch point an index is used

Parameters
indexthe index of the touch point to check
Returns
a pixel vertical X location of the touch point Note : A for loop (i = 0; i < TOUCH_MAX; i++) can be used to iterate though all the touch points

Implements IVoxieBox.

◆ getTouchPosY()

int VoxieBox::getTouchPosY ( int  index)
virtual

returns the a touch point's Y position.

To determine what touch point an index is used

Parameters
indexthe index of the touch point to check
Returns
a pixel vertical Y location of the touch point Note : A for loop (i = 0; i < TOUCH_MAX; i++) can be used to iterate though all the touch points

Implements IVoxieBox.

◆ getTouchPressIndex()

int VoxieBox::getTouchPressIndex ( point2d  TLpos,
point2d  BRpos,
bool  drawCollision = false 
)
virtual

checks if a touch input has been registered within a 2D box returns a positive number if touch has been detected

Parameters
TLposthe top left point of the rectangle to check within
BRposthe bottom right point of the rectangle to check within
drawCollisionset to true to draw the collision box on the secondary (touch) screen
Returns
the touch input index number

Implements IVoxieBox.

◆ getTouchPressIndexCir()

int VoxieBox::getTouchPressIndexCir ( point2d  CirPos,
float  radius,
bool  drawCollision = false 
)
virtual

checks if a touch input has been registered within a 2D circle returns the touch inputs index number

Parameters
CirPosthe X Y circle position
radiusthe radius of the circle.
drawCollisionset to true to draw the collision box on the secondary (touch) screen
Returns
the touch input index number

Implements IVoxieBox.

◆ getTouchPressState()

int VoxieBox::getTouchPressState ( point2d  TLpos,
point2d  BRpos,
bool  drawCollision = false 
)
virtual

checks if a touch input has been registered within a 2D box returns a positive number if touch has been detected

Parameters
TLposthe top left point of the rectangle to check within
BRposthe bottom right point of the rectangle to check within
drawCollisionset to true to draw the collision box on the secondary (touch) screen
Returns
0 = no touch, 1 = touch is down, 2 = touch is held, 3 = touch just pressed 4 = touch on up.

Implements IVoxieBox.

◆ getTouchPressStateCir()

int VoxieBox::getTouchPressStateCir ( point2d  CirPos,
float  radius,
bool  drawCollision = false 
)
virtual

checks if a touch input has been registered within a 2D circle returns a positive number if touch has been detected

Parameters
CirPosthe X Y circle position
radiusthe radius of the circle.
drawCollisionset to true to draw the collision box on the secondary (touch) screen
Returns
0 = no touch, 1 = touch is down, 2 = touch is held, 3 = touch just pressed 4 = touch on up.

Implements IVoxieBox.

◆ getTouchRotationDelta()

float VoxieBox::getTouchRotationDelta ( )
virtual

returns a pinch's touch rotation delta (the amount the two points of the pinch have changed in distance)

Returns
float in radians of rotation

Implements IVoxieBox.

◆ getTouchSensitivity()

float VoxieBox::getTouchSensitivity ( )
virtual

returns the touch sensitivity (1 is default. the higher the value the more sensitivity)

Returns
float value of sensitivity.

Implements IVoxieBox.

◆ getTouchState()

int VoxieBox::getTouchState ( int  index)
virtual

returns the touch point's state.

Requires to know which touch point index to check

Parameters
indexthe index of the touch point to check
Returns
0 = not pressed, 1 = is down, 2 = is held, 3 = just pressed, 4 = on up

Implements IVoxieBox.

◆ getVPS()

double VoxieBox::getVPS ( )
virtual

Returns the system's current VPS (volumes per second).

Returns
the current VPS value. At least 15 VPS on a Up/Down system and At least 30 VPS for a Spinner is recommended.

Implements IVoxieBox.

◆ getVxCppVersion()

__int64 VoxieBox::getVxCppVersion ( )
virtual

returns a timestamp of the compile date of VxCpp.dll expressed as an __int64. (format: YYYYMMDDHHmmss)

Returns compile date and time of VxCpp.dll as a 64-bit int in this format: year*1e10 + month*1e8 + day*1e6 + hour*1e4 + minute*1e2 + second For example, April 8, 2024 at 16:38:44 would be: 20240408163844

Implements IVoxieBox.

◆ indicesCpyXYZ_2_UVC()

void VoxieBox::indicesCpyXYZ_2_UVC ( inds_t indiceArray,
int  indiceCount 
)
virtual

Helper function for VoxieBox::DrawMeshExt copies indices.xyz values to indices.uvc values and removes the starting loop flags.

Parameters
indiceArraythe indiceArray to pass in
indiiceCountthe number of indices within the array

Implements IVoxieBox.

◆ init()

int VoxieBox::init ( )
virtual

Initializes and updates voxiebox.dll's voxie window (voxie_wind_t)

The voxie window is the struct which holds all the settings and values to do with the volumetric display.

See also
vxDataTypes.h::voxie_wind_t

This function is called first time by the VoxieBox constructor. So there is no need for a developer to initialise it But can be used to update the voxie_window if the VoxieBox class's vw (voxie_wind_t) has been updated. On the first call, this function sets up the window and starts the hardware motor. On later calls, it can be used to override some parameters of the vw (voxie_window_t) structure.

For example: vw.useJoy = 0; voxie_init(&vw); would change the joystick input method to direct input (joyInfoEx) emulation regardless of the setting in voxiebox.ini. if voxie_init returns -1 the function returns an error could not initialise or update

Returns
0 if Initialization or updating is successful. -1 if an error

Note : This function always passing in the VoxieBox class's voxie_wind_t which is known as 'vw'

Implements IVoxieBox.

◆ menuAddItem()

void VoxieBox::menuAddItem ( const char *  label,
int  x,
int  y,
int  xSize,
int  ySize,
int  id,
int  type,
int  state,
int  col,
double  startingVal,
double  minVal,
double  maxVal,
double  minStepVal,
double  majStepVal 
)
virtual

Add item to a menu tab.

Use this function to add a new menu item to the menu's tab. See the enum from vxInputTypes.h::menuTypes for a list of menu item to add.

Parameters
labelname of text/button/slider
xstarting x position for menu item
ystarting y position for menu item
xSizehorizontal size of item
ySizevertical size of item
iduser-defined low integer (use enum to differentiate easily). Assign a unique number (ID) so the menu item can be recalled by other functions
typethe type of menu item to create see vxInputTypes.h::menuTypes MENU_TEXT: text (decoration only) MENU_LINE: line (decoration only) MENU_BUTTON_MIDDLE+3: push button (single button) MENU_BUTTON_MIDDLE+1: push button (first in group - auto-depresses others so only 1 on) MENU_BUTTON_MIDDLE : push button (in middle of group) MENU_BUTTON_MIDDLE+2: push button (last in group - auto-depresses others so only 1 on) MENU_HSLIDER: horizontal slider MENU_VSLIDER: vertical slider MENU_EDIT: edit text box MENU_EDIT_DO: edit text box, click next item on 'Enter' MENU_TOGGLE: combo box (w/o the drop down). Useful for saving space in dialog. Specify multiple strings in 'st' using \r as separator. MENU_PICKFILE: file selector. Specify type in 2nd string. Ex: "Browse\r*.kv6"
colcolor of item (typically 0xffffff)
startingValthe starting value of menu item
minValmin value
maxValmax value
minStepValminor step in value increase/decrease amount
majStepValmajor step in value increase/decrease amount

Implements IVoxieBox.

◆ menuAddTab()

void VoxieBox::menuAddTab ( const char *  st,
int  x,
int  y,
int  xs,
int  ys 
)
virtual

Add custom menu tab on secondary (touch) screen menu (NOTE: there's only space for 2 more tabs on the 7" 1024x600 LCD screen)

Parameters
stname of tab
xhorizontal position for the tab item area
yvertical position for tab item area
xswidth in pixels of the tab item area
ysheight in pixels of the tab item area

menu functions only needs to be called once. Not every volume/frame.

Implements IVoxieBox.

◆ menuReset()

void VoxieBox::menuReset ( int(*)(int id, char *st, double val, int how, void *userdata)  menu_update,
void *  userdata,
char *  bgImageFileName 
)
virtual

Function used to reset the voxie menu and set a new custom menu update function (the menu which is on the secondary touch screen)

This function is essential if you want to make your own menu tabs as you'll need to create a function which holds all your menu's logic The menu_update function is where a user makes their own function which manages the menu's input.

Parameters
menu_updatecallback function to handle interaction updates. See example user function below.
userdataa pointer to a user-defined structure (optional / for convenience only).
bgImageFileNamean image file to be used as background (should be 1024x600 for the LCD display)

The menu_update( int id, char *st, double val. int how, void * userdata) is called every time a menu button is pressed. each menu item has an id and passes through certain values depending on its item type.

             Parameters for the menu_update() custom function:
                 id = the id for the menu item which is calling the function.
                 st = the custom pointer char array being passed in from the menu item. (for user edit box (MENU_EDIT))
                 val = the custom val passed in from the menu item this is how slider values are passed in
                how = tells how button or slider was changed: (0:enter, 1:left/right arrow, 2:click button, 3:drag slider, 4:slider arrow)
                userdata = pointer to user-defined structure (helpful to avoid global variables)



       @example Example of custom menu call back function
      enum {MENU_SPEED_BUTTON_1,MENU_SPEED_BUTTON_2,MENU_SPEED_BUTTON_3,MENU_SPEED_SLIDER,MENU_FILE};
      static int gspeed = 1;
       static int user_menu_update(int id, char *st, double v, int how, void *userdata)
        {
            switch (id)
            {
            case MENU_SPEED_BUTTON_1: gspeed = 1; break; (MENU_SPEED_BUTTON_1 (1) is menuAddItem's id - defined when the menu item was created)
            case MENU_SPEED_BUTTON_2: gspeed = 2; break;
            case MENU_SPEED_BUTTON_3: gspeed = 3; break;
            case MENU_SPEED_SLIDER: gspeed = (int)v; break;
            case MENU_FILE: printf("File:%s\n", st); break; //NOTE:don't use printf in graphical app :P
            }
            return(1);
        }

       At some point in your VX program (usually before your breath() update loop). call menuReset and define your call back function. menuReset(user_menu_update, 0, (char*)"test.png");

Note: call with voxie_menu_reset(0,0); to remove the user menu

Implements IVoxieBox.

◆ mountZip()

void VoxieBox::mountZip ( const char *  filename)
virtual

MountZip - extracts and loads a .zip file into memory.

Once a zip has been mounted all file names which are withing the zip folder can be referenced as if they were in the local directory Example you have a zip file with 'example.png' within it. Once you mount that zip you refer 'example.png' in your program to access that file

Parameters
filenamethe path and filename of the zip file to mount. (path is relative)

Implements IVoxieBox.

◆ moveToPos()

int VoxieBox::moveToPos ( point3d currentPos,
point3d  destinationPos,
float  speed,
float  accuracy 
)
virtual

Updates/"moves" a point from the current position towards the destination point. Returns 1 if currentPos collides with destinnationPos otherwise returns a 0.

Parameters
currentPospoint3d pointer to the current position
currentPospoint3d to the destination position
speedthe speed in which the point is traveling
accuracythe accuracy to determine if the current position has reached the destination Pos
Returns
1 if currentPos has arrived at the destinationPos (within the accuracy provided) otherwise 0

Implements IVoxieBox.

◆ playSound()

int VoxieBox::playSound ( const char *  fileName,
int  sourceChannel,
int  volumeLeft,
int  volumeRight,
float  playBackSpeed 
)
virtual

Plays a sound (can be WAV, FLAC, MP3, M4A)

Parameters
fileNamefilename (WAV, FLAC, MP3 or M4A) of sound to play
sourceChannelwhich channel of the audio file extract (0 left, 1 right, -1 stereo, -2 left + right)
volumeLeft% of full volume to left channel {0..100, although may exceed 100}
volumeRight% of full volume to right channel {0..100, although may exceed 100}
playBackSpeedfrequency scaling. use 1.0 for default sample rate, 2.0 for 1 octave up, 0.5 for 1 octave down... etc
Returns
a handle int of 0..MAX if success. Use this as a handle passed to voxie_playsound_update(). -1 if file not found or other error related to loading. -2 if none of the MAX audio voice slots were free. New sounds don't play if list is full.

Implements IVoxieBox.

◆ pointSame() [1/2]

int VoxieBox::pointSame ( point2d a,
point2d b,
point2d  accuracy = { 0.001, 0.001 } 
)
virtual

Compare two point2d with a degree of accuracy. returns true if the two points are the same within the accuracy amount specified.

Parameters
apointer to the 1st point2d to compare
bpointer to the 2nd point2d to compare
accuracythe accuracy to compare the two points
Returns
true if the two points are the same within the accuracy amount specified

Implements IVoxieBox.

◆ pointSame() [2/2]

int VoxieBox::pointSame ( point3d a,
point3d b,
point3d  accuracy = { 0.001, 0.001, 0.001 } 
)
virtual

Compare two point3d with a degree of accuracy. returns true if the two points are the same within the accuracy amount specified.

Parameters
apointer to the 1st point3d to compare
bpointer to the 2nd point3d to compare
accuracythe accuracy to compare the two points
Returns
true if the two points are the same within the accuracy amount specified

Implements IVoxieBox.

◆ quitLoop()

void VoxieBox::quitLoop ( )
virtual

Call this to tell Voxiebox library you want to exit the breath() loop and quit the application.

forces VoxieBox::breath() to return non-zero on its next call.

By default a clean exit is set to true (VoxieBox::setEnsureCleanExitOnQuitLoop()) if VoxieBox::setEnsureCleanExitOnQuitLoop() is set to true. VoxieBox::endFrame() is called and GFX stored in memory is cleared.

Implements IVoxieBox.

◆ reportJoy()

void VoxieBox::reportJoy ( int  posX,
int  posY 
)
virtual

reports the state of the game controllers on to the secondary (touch) screen

Parameters
posXthe X position to render the report
posYthe Y position to render the report

Implements IVoxieBox.

◆ reportKeyboard()

void VoxieBox::reportKeyboard ( int  posX,
int  posY 
)
virtual

Reports the state of the keyboard on to the secondary (touch) screen. Used to help with debugging/.

Parameters
posXthe X position to render the report
poxYthe Y position to render the report

Implements IVoxieBox.

◆ reportMouse()

void VoxieBox::reportMouse ( int  posX,
int  posY,
bool  showCursor = true 
)
virtual

Reports mouse input state information onto secondary (touch) screen.

This report uses the internal voxie_input_t struct as reference (this could be overwritten with VoxieBox::setMouseState)

Parameters
posXthe pixel x (horizontal) position to display the report
posYthe pixel y (vertical) position to display the report
showCursorif true shows the mouse cursor on the volumetric display. Set to true by default

Implements IVoxieBox.

◆ reportNav()

void VoxieBox::reportNav ( int  posX,
int  posY,
bool  showCursor = true 
)
virtual

Reports all SpaceNav input state onto the secondary (touch screen)

Parameters
posXthe horizontal position to display the report
posYthe vertical position to display the report
showCursor(true by default) draw the cursor of the position of the SpaceNav

Note: Space Navs are only detected by the system after an inital movement.

Implements IVoxieBox.

◆ reportTouch()

void VoxieBox::reportTouch ( int  posX,
int  posY 
)
virtual

Shows a debug report for advanced touch input.

Parameters
posXthe horizontal X position of the secondary (touch) screen to display the report
posXthe vertical Y position of the secondary (touch) screen to display the report

Implements IVoxieBox.

◆ reportVoxieFrame() [1/2]

void VoxieBox::reportVoxieFrame ( int  posX,
int  posY 
)
virtual

Exposes some of the variables from the internal voxie_frame_t onto the secondary (touch) screen.

Intended for debug purposes

Parameters
posXthe X position of the report
posYthe Y position of the report

Implements IVoxieBox.

◆ reportVoxieFrame() [2/2]

void VoxieBox::reportVoxieFrame ( int  posX,
int  posY,
voxie_frame_t VF 
)

Exposes some of the variables a voxie_frame_t struct onto the secondary (touch) screen.

Intended for debug purposes

Parameters
posXthe X position of the report
posYthe Y position of the report
VFa pointer for the voxie_frame_t struct to report on

◆ reportVoxieWind() [1/2]

void VoxieBox::reportVoxieWind ( int  posX,
int  posY 
)
virtual

Exposes all the variables from the internal (vw) voxie_wind_t onto the secondary (touch) screen.

Intended for debug purposes

Parameters
posXthe X position of the report
posYthe Y position of the report

Implements IVoxieBox.

◆ reportVoxieWind() [2/2]

void VoxieBox::reportVoxieWind ( int  posX,
int  posY,
voxie_wind_t VW 
)

Exposes all the variables of a voxie_wind_t struct onto the secondary (touch) screen.

Intended for debug purposes

Parameters
posXthe X position of the report
posYthe Y position of the report
VWa pointer fo the voxie_wind_t struct to report on

◆ scrollCol()

int VoxieBox::scrollCol ( int  offSet = 0)
virtual

returns a scrolling color as an RGB hexadecimal value

Parameters
offSetoffset (any whole number) to offset the color cycle to a different period in the cycle
Returns
color as an RGB hexadecimal value

Implements IVoxieBox.

◆ setAspect()

void VoxieBox::setAspect ( point3d  newAspect)
virtual

Set all the internal voxie_wind_t's aspect ratio values and update the voxie_wind_t.

Parameters
newAspectthe new aspect ratios for the volumetric display.

Implements IVoxieBox.

◆ setAspectX()

void VoxieBox::setAspectX ( float  newAspectX)
virtual

Set the internal voxie_wind_t's X aspect ratio value and update the voxie_wind_t.

Parameters
newAspectXthe new Aspect X value to apply. th

Implements IVoxieBox.

◆ setAspectY()

void VoxieBox::setAspectY ( float  newAspectY)
virtual

Set the internal voxie_wind_t's Y aspect ratio value and update the voxie_wind_t.

Parameters
newAspectYthe new Aspect Y value to apply. th

Implements IVoxieBox.

◆ setAspectZ()

void VoxieBox::setAspectZ ( float  newAspectZ)
virtual

Set the internal voxie_wind_t's Z aspect ratio value and update the voxie_wind_t.

Parameters
newAspectZthe new Aspect Z value to apply. th

Implements IVoxieBox.

◆ setAudioPlayCallBack()

void VoxieBox::setAudioPlayCallBack ( void(*)(int *sampleBuffer, int sampleRate)  userplayfunc)
virtual

Define a custom audio callback function to play PCM / raw audio data.

This function is used to play PCM / audio data (not a file).

If used, this function will be called from a separate thread, every 3ms (for Voxiebox mode), or every 20ms (for emulated mode). Format is set by Voxiebox library. To get sample rate and number of channels, read samprate and nchans from the voxie_wind_t structure after the call to voxie_init(). The sample format is always signed 32-bit integers, with the PCM located in the least significant 24 bits.

Parameters
userplayfuncthe custom call back function
*sampleBufferthe sample audio buffer passed in from memory
sampleRatethe sample rate of the audio (determined by the voxie_wind_t vw.playsamprate)
     @example // An example of an custom audio callback.
               // Once called this function will always be called on a separate thread. Use a global variable to turn it on / off
           static int gPlaySound = -1; // if this is set to 0 it will mute. It will play when set to -1
           static int frequencyToPlay = 26162; // middle C note
           static void simplemix (int *ibuf, int nsamps)
           {
               static int cnt[2];
               int i, c; // c is number of channels to play (vw.playnchans)

                   for(i=0;i<nsamps;i++,ibuf+=vw.playnchans)
                   for(c=min(vw.playnchans,2)-1;c>=0;c--)
                   { ibuf[c] = ((cnt[c]&(1<<20))-(1<<19))&gPlaySound; cnt[c] += frequencyToPlay; }
           }


     Now that a custom audio callback has been defined. Call it within your VX program and it should play.
Note : The playback function will continue to be called until stopped. To kill the call back overwrite the user function with a 0 by writing playPCMData(0) in your program.

Implements IVoxieBox.

◆ setAudioRecordCallBack()

void VoxieBox::setAudioRecordCallBack ( void(*)(int *sampleBuffer, int sampleRate)  userrecfunc)
virtual

Define a custom audio callback function to record PCM audio data (not a file)

this function is used to capture audio from the device. How to use this function is still being documented important voxie_wind_t variables to have set before recording.

Parameters
userplayfuncthe custom call back function
recsampraterecording sample rate - to use, must write before voxie_init()
recnchansnumber of audio channels in recording callback

Implements IVoxieBox.

◆ setColScrollSpeed()

void VoxieBox::setColScrollSpeed ( double  speed)
virtual

Set the speed of the internal color scroller default is 0.1. Value is how long in seconds before a color change.

Parameters
speedhow long in seconds before a color change.

Implements IVoxieBox.

◆ setDrawTouchInput()

void VoxieBox::setDrawTouchInput ( bool  option)

boolean to enable / disable drawing the touch inputs unto the (secondary) touch screen

Parameters
optionset to true to enable drawing and to false to not draw.

◆ setEnableTouchInput()

void VoxieBox::setEnableTouchInput ( bool  option)
virtual

! set to run to allow the secondary (touch) to be used as an input device.

if you don't allow this any touch on the touchscreen will open up the voxieMenu

Parameters
optionset to true or false to enable

Implements IVoxieBox.

◆ setGlobalShader()

void VoxieBox::setGlobalShader ( float  horizontalAngle,
float  verticalAngle,
float  amplitude 
)
virtual

changes the global normal vector (vw.normhax) for shading.

Pass in three 0's to disable. Alters the global normal vector for shading. Shading only works with models which have vertices Pass 3 0's to disable shading.

Parameters
horizontalAnglethe horizontal angle -180 to 180
verticalAnglethe vertical angle -90 to 90
amplitudethe amplitude (intensity) 0 to 100

Implements IVoxieBox.

◆ setJoyDeadZone()

void VoxieBox::setJoyDeadZone ( double  deadZoneValue)
virtual

Sets the internal dead zone value for game controllers. (dead zone is the area where not input is detected). Value between 0 and 1. 0 = no deadzone. 1 = all deadzone. default is 0.3;.

Parameters
deadZoneValuethe value to set the deadzone threshold a number between 0 and 1 0 no deadzone... 1 deadzone everywhere default is 0.3

Implements IVoxieBox.

◆ setJoyOrientation()

void VoxieBox::setJoyOrientation ( int  controllerID,
int  orientation 
)
virtual

Change the orientation of the users intended position when using a game controller. At what side are they facing towards the volumetric display.

Parameters
controllerIDthe ID number of the controller you want to adjust (0,1,2,3)
orientationof the controller 0 = front, 1 = 180 ' (behind), 2 = 90 ' CCW (right side), 3 = 90 ' CW (left side)

Implements IVoxieBox.

◆ setJoyVibrate()

void VoxieBox::setJoyVibrate ( int  controllerID,
float  leftMotorSpeed,
float  rightMotorSpeed 
)
virtual

Activates vibration motors in XBox controller. XInput controllers only. To stop Be sure to call again with lmot=0.f, rmot=0.f!

Parameters
idwhich controller to set (0-3)
leftMotorSpeedleft motor speed (0.f-1.f, 0.f=off)
rightMotorSpeedright motor speed (0.f-1.f, 0.f=off)

Implements IVoxieBox.

◆ setLeds()

void VoxieBox::setLeds ( int  dispNum,
int  r,
int  g,
int  b 
)
virtual

Set LEDs values on projector hardware.

WARNING: Be careful not to overheat projector! Range per component: 0:darkest, 255:brightest WARNING: Be careful not to overheat projector!

Parameters
dispNumthe display's number to adjust
rthe LED value for the red channel {0..128} (go over 128 at your own risk!)
gthe LED value for the green channel {0..128} (go over 128 at your own risk!)
bthe LED value for the blue channel {0..128} (go over 128 at your own risk!)

Implements IVoxieBox.

◆ setMaskPlane()

void VoxieBox::setMaskPlane ( float  x0,
float  y0,
float  z0,
float  nx,
float  ny,
float  nz 
)
virtual

Call after each VoxieBox::setView() to mask off a plane of a specified thickness.

Used for viewing a slice of a scene.

Parameters
x0x point on the center of the mask plane
y0y point on the center of the mask plane
z0z point on the center of the mask plane
nxThe normal vector; the magnitude of this vector determines the thickness of the plane.
nyThe normal vector; the magnitude of this vector determines the thickness of the plane.
nzThe normal vector; the magnitude of this vector determines the thickness of the plane.

Implements IVoxieBox.

◆ setMouseDoubleClickThreshold()

void VoxieBox::setMouseDoubleClickThreshold ( double  timeThreshold)
virtual

Set the time between mouse clicks to register a 'double click' (which triggers a true setting for getMouseDoubleClick())

Parameters
timeThresholdthe time in seconds for 2 clicks to register as a 'double click' Note use with VoxieBox::getMouseDoubleClick() to register double clicks.
See also
VoxieBox::getMouseDoubleClick()
VoxieBox::getMouseDoubleClickThreshold()

Implements IVoxieBox.

◆ setMouseOrientation()

void VoxieBox::setMouseOrientation ( int  orientation)
virtual

set the orientation of the user's intended position when using the mouse

Parameters
orientationthe orientation of the controller 0 = front, 1 = 180 ' (behind), 2 = 90 ' CCW (right side), 3 = 90 ' CW (left side)

Implements IVoxieBox.

◆ setMousePosition()

void VoxieBox::setMousePosition ( point3d  newPos)
virtual

Overrides internal mouse position with a new point3d position.

Useful to jump / move the mouse cursor to a specific part of the display.

Parameters
newPos(x, y, z) positional information of where to set new mouse position

Implements IVoxieBox.

◆ setMouseState()

void VoxieBox::setMouseState ( voxie_inputs_t  newMouse)
virtual

Override the internal voxie_input_t mouse state.

Probably not that useful but its here for some advanced use case see voxie_inputs_t to understand the mouse structure*

Parameters
newMousethe new mouse settings to pass in (pass in a full voxie_inputs_t struct)

Implements IVoxieBox.

◆ setNavDeadZone()

void VoxieBox::setNavDeadZone ( double  deadZoneValue)
virtual

Set the internal deadzone for Space Navigators. (dead zone is the area where not input is detected)

Parameters
deadZoneValuenew value to set deadzone. For Space Navigators between 0 and 350. default is 0.1

Implements IVoxieBox.

◆ setNavDoubleClickThreshold()

void VoxieBox::setNavDoubleClickThreshold ( double  timeThreshold)
virtual

Set the time between Space Nav clicks to register a 'double click' (which triggers a true setting for getNavDoubleClick())

Parameters
timeThresholdthe time in seconds for 2 clicks to register as a 'double click' Note use with VoxieBox::getNavDoubleClick() to register double clicks.
See also
VoxieBox::getNavDoubleClick()
VoxieBox::getNavDoubleClickThreshold()

Implements IVoxieBox.

◆ setNavOrientation()

void VoxieBox::setNavOrientation ( int  spaceNavID,
int  orientation 
)
virtual

set the orientation of the user's intended position when using a Space Nav

Parameters
spaceNavIDthe ID number of the spaceNav you want to edit (0,1,2,3)
orientationthe orientation of the controller 0 = front, 1 = 180 ' (behind), 2 = 90 ' CCW (right side), 3 = 90 ' CW (left side)

Implements IVoxieBox.

◆ setNavSensitivity()

void VoxieBox::setNavSensitivity ( int  spaceNavID,
double  newAmount 
)
virtual

Set the Space Nav's sensitivity. Used to manage the Space Nav being used as a cursor. 0.0025 is default. Higher values increase sensitivity

Parameters
spaceNavIDthe ID number of the Space Nav to check (0 = 1st detected, 1 = 2nd detected etc)
newAmountthe new sensitivity amount. 0.0025 is default. Higher values increase sensitivity

Implements IVoxieBox.

◆ setProject()

void VoxieBox::setProject ( int  dispNum,
int  dir,
float  x,
float  y,
int  z,
float *  xo,
float *  yo 
)
virtual

Advanced utility function for keystone calibration (used by graphcalc and keystone calibration in voxiedemo) see the source code for voxiedemo.c for an understanding of how this works.

Parameters
dispdisplay number: {0..vw.dispnum-1}
dirdirection. 1=forward, -1=inverse
xx input point; {-1.f .. +1.f}
yy input point; {-1.f .. +1.f}
zinput plane: {0 .. vw.framepervol*24-1}
xoxo keystone adjusted output point
yoyo keystone adjusted output point

Implements IVoxieBox.

◆ setTouchInputStruct()

void VoxieBox::setTouchInputStruct ( touchInput_t newTouchInput)
virtual

Replaces the internal touchInput_t struct with a new one could be to make your own touch I/O.

Parameters
newTouchInput* pointer to the new touchInput_t struct to replace

Implements IVoxieBox.

◆ setTouchSensitivity()

void VoxieBox::setTouchSensitivity ( float  newSensitivityValue)
virtual

sets the touch sensitivity (1 is default.

the higher the value the more sensitivity)

Returns
float value of sensitivity.
Parameters
newSensitivityValuethe new sensitivity value.

Implements IVoxieBox.

◆ setView() [1/2]

void VoxieBox::setView ( float  xMin,
float  yMin,
float  zMin,
float  xMax,
float  yMax,
float  zMax 
)
virtual

Set a custom view.

Usually you'll pass in the voxie windows's (voxie_wind_t) aspect values but it can be used like 'camera' and be moved around by passing in different values.

You may call this function any number of times during rendering. This function is called automatically during the VoxieBox::startFrame() function. it is passed with internal vw voxie_window_t aspect ratio values.

Checks to see if invertZAxis is enabled and applies swap if needed

Parameters
xMinminimum x resolution (left)
yMinminimum y resolution (up)
zMinminimum z resolution (top)
xMaxmaximum x resolution (right)
yMaxmaximum y resolution (down)
zMaxmaximum z resolution (bottom)

Implements IVoxieBox.

◆ setView() [2/2]

void VoxieBox::setView ( point3d  LUT,
point3d  RDB 
)
virtual

Same setView() but using point3D for coordinates instead of 6 floats.

Parameters
LUTthe Left, Upper, Top position
RDBthe Right, Down, Bottom position

Implements IVoxieBox.

◆ showVPS()

double VoxieBox::showVPS ( int  posX,
int  posY 
)
virtual

Displays volumes per second (volumetric equivalent of 'FPS') and version info on the secondary (touch) screen.

Parameters
posXX position for output
posYY position for output
Returns
VPS amount

Implements IVoxieBox.

◆ sphereCollideChk()

int VoxieBox::sphereCollideChk ( point3d sphereAPos,
double  sphereARadius,
point3d sphereBPos,
double  sphereBRadius,
bool  showCollisionBox = false 
)
virtual

Sphere collision check. Check if two spheres are touching. Returns 1 if collision is found otherwise returns 0.

Parameters
sphereAPospointer of first sphere's position
sphereARadiusfirst sphere's radius
sphereBPospointer of second sphere's position
sphereBRadiussecond sphere's radius
showCollisionBoxFor debugging set to false by default. Set to true to render the collision box onto the volumetric display. (Note : The collision check must be called within the start and end frame)
Returns
1 if there is a collision and 0 if not

Implements IVoxieBox.

◆ startFrame()

void VoxieBox::startFrame ( )
virtual

start building the frame buffer.

All volumetric and secondary (touch) screen draw calls need to happen between VoxieBox::startFrame() and VoxieBox::endFrame() the startframe() function prepares the vxTypes::voxie_frame_t struct to start a new frame and empty out the voxel buffer. any draw call used after this point is loaded into the voxel buffer. the startFrame() function uses the internal vf voxie_frame_t to manage its voxel data. It is possible for a developer to write directly to the vf for their own low-level drawing.

The startFrame function also sets the view to the correct aspect ration (traditionally a user would call 'voxie_setview()' after the frame to set the views dimensions) the startFrame function also draws a border around the display (if VoxieBox::setBorder() has been set to true)

Implements IVoxieBox.

◆ touchManualRead()

int VoxieBox::touchManualRead ( int *  touchIndex,
int *  xVal,
int *  yVal,
int *  packetState 
)
virtual

! reads out the current Touch input states - raw return codes from the voxiebox.dll use this function if you want to manage advanced touch input manually.

Parameters
touchIndexindex of finger in this packet
xValthe x value coordinate of touch instance
yValthe y value coordinate of touch instance
packetStateif (packetState&1): this is 1st packet in path if (packetState&2): this is last packet in path ('touchIndex' will not exist in later calls)
Returns
0:no more data left (touchIndex,xVal,yVal,packetState not written) 1:got more data (touchIndex,xVal,yVal,packetState written)
   @example    This function should be called in a while loop until 0 is returned, ex:
               while (voxie_touch_read(&i,&x,&y,&j)) { //process i,x,y,j }

Implements IVoxieBox.

◆ tweenCol()

int VoxieBox::tweenCol ( int  color,
int  speed,
int  destcolor 
)
virtual

Tweens a color to the destination color. good for fade outs or tweens.

Parameters
colorthe color value to tween.
speedthe speed or rate of the color change
destcolorthe destination color. The color to tween to.
Returns
returns a new color value that is one step closer to the destination color.

Implements IVoxieBox.

◆ updateJoyStateRaw()

int VoxieBox::updateJoyStateRaw ( int  controllerID,
voxie_xbox_t vx 
)
virtual

Updates the game controller's input state. Used to manage game controller inputs when setEnableLegacyJoyInput() is set to true.

Use this function to manually update gamepad inputs. The return state is designed to be used within a for loop. This function is only needed when setEnableLegacyJoyInput() is set to true

Parameters
idwhich controller to query (0-3)
voxie_xbox_tstructure to be filled in by function (if successful)
Returns
1 = success (safe to check next controller (id+1)) , 0=fail

Implements IVoxieBox.

◆ updateMenu()

void VoxieBox::updateMenu ( int  id,
const char *  st,
int  state,
double  v 
)
virtual

Once the menu is created, use this function to update a string, button status, or slider value.

In the menu item. It will change the menu items for any id values that match. If st is null, it will be left alone. 'state' is the status of a menu button (0=up, 1=down), and 'v' is the value for sliders. If a field is not applicable, just pass a 0.

Parameters
idthe menu item
stchanging the text (if applicable)
statethe state of the item (if applicable)
vthe value (if applicable)

Implements IVoxieBox.

◆ updateNavStateRaw()

int VoxieBox::updateNavStateRaw ( int  spaceNavID,
voxie_nav_t nav 
)
virtual

Copies 3DConnexion Space Navigator controller state to voxie_nav_t structure.

Parameters
idwhich controller to query (ignored for now)
navstructure to be filled in by function (if successful)
Returns
1=success (safe to check next controller (id+1)), 0=fail

Works similar to VoxieBox::updateJoyStateRaw() use if setEnableLegacyNavInput() is set to true. Otherwise Nav updates are maintained by VxCpp.dll

Implements IVoxieBox.

◆ updateSound()

void VoxieBox::updateSound ( int  handleID,
int  sourceChannel,
int  volumeLeft,
int  volumeRight,
float  playBackSpeed 
)
virtual

Update a currently playing sound.

Use a returned voxie::playSound value as the handle (an int that is assigned to that specific sound) update a sound is great for fades or adjusting volumes set the volperc0, or volperc1 use to a negative number to turn off the sound and free it from memory.

Parameters
handlethe current sound to handleID to effect (use the int that gets returned when using VoxieBox::playSound() )
sourceChannelwhich channel of WAV or FLAC to extract (0 left, 1 right, -1 stereo, -2 left + right)
volumeLeft% of full volume to left channel {0..100, although may exceed 100} set to -1 to turn off
volumeRight% of full volume to right channel {0..100, although may exceed 100} set to -1 to turn off
playBackSpeedfrequency scaling. use 1.0 for default sample rate, 2.0 for 1 octave up, 0.5 for 1 octave down... etc

Implements IVoxieBox.

◆ updateSoundPosition()

void VoxieBox::updateSoundPosition ( int  handleID,
double  second,
int  seekType = SEEK_SET 
)
virtual

Updates a sound's play position to .

Requires the audio's handle ID

Parameters
handleIDthe handleID for the audio (when VoxieBox::playSound is called it returns an int value which is its handleID)
secondthe time in seconds to move the sound position to. Can use the decimal for exact position
seekTypethe seek type SEEK_SET (0), SEEK_CUR(1), SEEK_END(2). Most cases SEEK_SET (value of 0). Works similar to the fseek() function

Implements IVoxieBox.


The documentation for this class was generated from the following files: