razerHydraFrame.cpp
Engine/source/platform/input/razerHydra/razerHydraFrame.cpp
Public Functions
DefineEngineMethod(RazerHydraFrame , getControllerButton1 , bool , (S32 index) , "@brief Get the button 1 state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Button 1 state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerButton2 , bool , (S32 index) , "@brief Get the button 2 state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Button 2 state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerButton3 , bool , (S32 index) , "@brief Get the button 3 state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Button 3 state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerButton4 , bool , (S32 index) , "@brief Get the button 4 state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Button 4 state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerCount , S32 , () , "@brief Get the number of controllers defined in this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">frame.\n\n</a>" "@return The number of defined <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controllers.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerDocked , bool , (S32 index) , "@brief Get the docked state of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return True <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the requested controller is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">docked.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerEnabled , bool , (S32 index) , "@brief Get the enabled state of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return True <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the requested controller is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">enabled.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerPos , Point3I , (S32 index) , "@brief Get the position of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "The position is the controller's integer position converted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "Torque 3D coordinates (in millimeters).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return <a href="/coding/file/netconnection_8cpp/#netconnection_8cpp_1ae574f06961639ed9111572f1c3b69a21a1e2f89e867cd91c3de2ea9fbd2ef96a3">Integer</a> position of the requested controller (in millimeters).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerRawPos , Point3F , (S32 index) , "@brief Get the raw position of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "The raw position is the controller's floating point position converted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "Torque 3D coordinates (in millimeters).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Raw position of the requested controller (in millimeters).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerRawTransform , TransformF , (S32 index) , "@brief Get the raw transform of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return The raw position and rotation of the requested controller (in Torque 3D coordinates).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerRot , AngAxisF , (S32 index) , "@brief Get the rotation of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "The Razer Hydra controller rotation as converted into the Torque 3D" "coordinate <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">system.\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Rotation of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerRotAxis , Point2F , (S32 index) , "@brief Get the axis rotation of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "This is the axis rotation of the controller as <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the controller were <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> gamepad thumb stick. " "Imagine <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> stick coming out the top of the controller and tilting the controller front, back , " "left and right controls that stick. The values returned along the x and y stick " "axis are normalized from -1.0 <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> 1.0 with the maximum controller tilt angle <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> these " "values as defined by $<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">RazerHydra::MaximumAxisAngle.\n</a>" " @param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" " @return Axis rotation of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">RazerHydra::MaximumAxisAngle\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerSequenceNum , S32 , (S32 index) , "@brief Get the controller sequence <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">number.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return The sequence number of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerShoulderButton , bool , (S32 index) , "@brief Get the shoulder button state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Shoulder button state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerStartButton , bool , (S32 index) , "@brief Get the start button state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Start button state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerThumbButton , bool , (S32 index) , "@brief Get the thumb button state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Thumb button state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerThumbStick , Point2F , (S32 index) , "@brief Get the thumb stick values of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "The thumb stick values are in the range of -1.0..1.0\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Thumb stick values of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerTransform , TransformF , (S32 index) , "@brief Get the transform of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return The position and rotation of the requested controller (in Torque 3D coordinates).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerTrigger , F32 , (S32 index) , "@brief Get the trigger <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "The trigger <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> is in the range of -1.0..1.0\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return <a href="/coding/class/classtrigger/">Trigger</a> <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getFrameInternalId , S32 , () , "@brief Provides the internal ID <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">frame.\n\n</a>" "@return Internal ID of this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">frame.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getFrameRealTime , S32 , () , "@brief Get the real time that this frame was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">generated.\n\n</a>" "@return Real time of this frame in <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">milliseconds.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getFrameSimTime , S32 , () , "@brief Get the sim time that this frame was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">generated.\n\n</a>" "@return Sim time of this frame in <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">milliseconds.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , isFrameValid , bool , () , "@brief Checks <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> this frame is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">valid.\n\n</a>" "@return True <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the frame is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">valid.\n\n</a>" )
Detailed Description
Public Functions
DefineEngineMethod(RazerHydraFrame , getControllerButton1 , bool , (S32 index) , "@brief Get the button 1 state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Button 1 state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerButton2 , bool , (S32 index) , "@brief Get the button 2 state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Button 2 state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerButton3 , bool , (S32 index) , "@brief Get the button 3 state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Button 3 state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerButton4 , bool , (S32 index) , "@brief Get the button 4 state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Button 4 state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerCount , S32 , () , "@brief Get the number of controllers defined in this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">frame.\n\n</a>" "@return The number of defined <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controllers.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerDocked , bool , (S32 index) , "@brief Get the docked state of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return True <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the requested controller is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">docked.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerEnabled , bool , (S32 index) , "@brief Get the enabled state of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return True <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the requested controller is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">enabled.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerPos , Point3I , (S32 index) , "@brief Get the position of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "The position is the controller's integer position converted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "Torque 3D coordinates (in millimeters).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return <a href="/coding/file/netconnection_8cpp/#netconnection_8cpp_1ae574f06961639ed9111572f1c3b69a21a1e2f89e867cd91c3de2ea9fbd2ef96a3">Integer</a> position of the requested controller (in millimeters).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerRawPos , Point3F , (S32 index) , "@brief Get the raw position of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "The raw position is the controller's floating point position converted <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "Torque 3D coordinates (in millimeters).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Raw position of the requested controller (in millimeters).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerRawTransform , TransformF , (S32 index) , "@brief Get the raw transform of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return The raw position and rotation of the requested controller (in Torque 3D coordinates).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerRot , AngAxisF , (S32 index) , "@brief Get the rotation of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "The Razer Hydra controller rotation as converted into the Torque 3D" "coordinate <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">system.\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Rotation of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerRotAxis , Point2F , (S32 index) , "@brief Get the axis rotation of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "This is the axis rotation of the controller as <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the controller were <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> gamepad thumb stick. " "Imagine <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> stick coming out the top of the controller and tilting the controller front, back , " "left and right controls that stick. The values returned along the x and y stick " "axis are normalized from -1.0 <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> 1.0 with the maximum controller tilt angle <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> these " "values as defined by $<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">RazerHydra::MaximumAxisAngle.\n</a>" " @param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" " @return Axis rotation of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">RazerHydra::MaximumAxisAngle\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerSequenceNum , S32 , (S32 index) , "@brief Get the controller sequence <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">number.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return The sequence number of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerShoulderButton , bool , (S32 index) , "@brief Get the shoulder button state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Shoulder button state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerStartButton , bool , (S32 index) , "@brief Get the start button state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Start button state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerThumbButton , bool , (S32 index) , "@brief Get the thumb button state <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Thumb button state requested controller as true or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">false.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerThumbStick , Point2F , (S32 index) , "@brief Get the thumb stick values of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "The thumb stick values are in the range of -1.0..1.0\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return Thumb stick values of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerTransform , TransformF , (S32 index) , "@brief Get the transform of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return The position and rotation of the requested controller (in Torque 3D coordinates).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getControllerTrigger , F32 , (S32 index) , "@brief Get the trigger <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" "The trigger <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> is in the range of -1.0..1.0\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param index The controller index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" "@return <a href="/coding/class/classtrigger/">Trigger</a> <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of the requested <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">controller.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getFrameInternalId , S32 , () , "@brief Provides the internal ID <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">frame.\n\n</a>" "@return Internal ID of this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">frame.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getFrameRealTime , S32 , () , "@brief Get the real time that this frame was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">generated.\n\n</a>" "@return Real time of this frame in <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">milliseconds.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , getFrameSimTime , S32 , () , "@brief Get the sim time that this frame was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">generated.\n\n</a>" "@return Sim time of this frame in <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">milliseconds.\n\n</a>" )
DefineEngineMethod(RazerHydraFrame , isFrameValid , bool , () , "@brief Checks <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> this frame is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">valid.\n\n</a>" "@return True <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the frame is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">valid.\n\n</a>" )
IMPLEMENT_CONOBJECT(RazerHydraFrame )
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#include "platform/input/razerHydra/razerHydraFrame.h" 25#include "platform/input/razerHydra/razerHydraUtil.h" 26#include "console/engineAPI.h" 27#include "math/mAngAxis.h" 28#include "math/mTransform.h" 29 30U32 RazerHydraFrame::smNextInternalFrameId = 0; 31 32IMPLEMENT_CONOBJECT(RazerHydraFrame); 33 34RazerHydraFrame::RazerHydraFrame() 35{ 36 clear(); 37} 38 39RazerHydraFrame::~RazerHydraFrame() 40{ 41 clear(); 42 43 for(U32 i=0; i<RazerHydraConstants::MaxControllers; ++i) 44 { 45 mControllerData[i].mEnabled = false; 46 } 47} 48 49 50void RazerHydraFrame::initPersistFields() 51{ 52 Parent::initPersistFields(); 53} 54 55bool RazerHydraFrame::onAdd() 56{ 57 if (!Parent::onAdd()) 58 return false; 59 60 return true; 61} 62 63void RazerHydraFrame::onRemove() 64{ 65 Parent::onRemove(); 66} 67 68void RazerHydraFrame::clear() 69{ 70 mFrameValid = false; 71} 72 73void RazerHydraFrame::copyFromFrame(const sixenseAllControllerData& frame, const F32& maxAxisRadius) 74{ 75 clear(); 76 77 // Calling this method automatically makes this a valid frame 78 mFrameValid = true; 79 80 mFrameInternalId = smNextInternalFrameId; 81 ++smNextInternalFrameId; 82 mFrameSimTime = Sim::getCurrentTime(); 83 mFrameRealTime = Platform::getRealMilliseconds(); 84 85 // Process the controllers 86 for(U32 i=0; i<RazerHydraConstants::MaxControllers; ++i) 87 { 88 const sixenseControllerData& controller = frame.controllers[i]; 89 ControllerData& data = mControllerData[i]; 90 91 // General controller data 92 data.mEnabled = controller.enabled; 93 data.mIsDocked = controller.is_docked; 94 data.mSequenceNum = controller.sequence_number; 95 96 // Controller position 97 RazerHydraUtil::convertPosition(controller.pos, data.mRawPos); 98 data.mPos.x = (S32)mFloor(data.mRawPos.x); 99 data.mPos.y = (S32)mFloor(data.mRawPos.y); 100 data.mPos.z = (S32)mFloor(data.mRawPos.z); 101 102 // Controller rotation 103 RazerHydraUtil::convertRotation(controller.rot_mat, data.mRot); 104 data.mRotQuat.set(data.mRot); 105 106 // Controller as axis rotation 107 RazerHydraUtil::calculateAxisRotation(data.mRot, maxAxisRadius, data.mRotAxis); 108 109 // Controller thumb stick 110 data.mThumbStick.x = controller.joystick_x; 111 data.mThumbStick.y = controller.joystick_y; 112 113 // Trigger 114 data.mTrigger = controller.trigger; 115 116 // Controller buttons 117 data.mShoulder = controller.buttons & SIXENSE_BUTTON_BUMPER; 118 data.mThumb = controller.buttons & SIXENSE_BUTTON_JOYSTICK; 119 data.mStart = controller.buttons & SIXENSE_BUTTON_START; 120 data.mButton1 = controller.buttons & SIXENSE_BUTTON_1; 121 data.mButton2 = controller.buttons & SIXENSE_BUTTON_2; 122 data.mButton3 = controller.buttons & SIXENSE_BUTTON_3; 123 data.mButton4 = controller.buttons & SIXENSE_BUTTON_4; 124 } 125} 126 127//----------------------------------------------------------------------------- 128 129DefineEngineMethod( RazerHydraFrame, isFrameValid, bool, ( ),, 130 "@brief Checks if this frame is valid.\n\n" 131 "@return True if the frame is valid.\n\n") 132{ 133 return object->isFrameValid(); 134} 135 136DefineEngineMethod( RazerHydraFrame, getFrameInternalId, S32, ( ),, 137 "@brief Provides the internal ID for this frame.\n\n" 138 "@return Internal ID of this frame.\n\n") 139{ 140 return object->getFrameInternalId(); 141} 142 143DefineEngineMethod( RazerHydraFrame, getFrameSimTime, S32, ( ),, 144 "@brief Get the sim time that this frame was generated.\n\n" 145 "@return Sim time of this frame in milliseconds.\n\n") 146{ 147 return object->getFrameSimTime(); 148} 149 150DefineEngineMethod( RazerHydraFrame, getFrameRealTime, S32, ( ),, 151 "@brief Get the real time that this frame was generated.\n\n" 152 "@return Real time of this frame in milliseconds.\n\n") 153{ 154 return object->getFrameRealTime(); 155} 156 157DefineEngineMethod( RazerHydraFrame, getControllerCount, S32, ( ),, 158 "@brief Get the number of controllers defined in this frame.\n\n" 159 "@return The number of defined controllers.\n\n") 160{ 161 return RazerHydraConstants::MaxControllers; 162} 163 164DefineEngineMethod( RazerHydraFrame, getControllerEnabled, bool, ( S32 index ),, 165 "@brief Get the enabled state of the controller.\n\n" 166 "@param index The controller index to check.\n" 167 "@return True if the requested controller is enabled.\n\n") 168{ 169 return object->getEnabled(index); 170} 171 172DefineEngineMethod( RazerHydraFrame, getControllerDocked, bool, ( S32 index ),, 173 "@brief Get the docked state of the controller.\n\n" 174 "@param index The controller index to check.\n" 175 "@return True if the requested controller is docked.\n\n") 176{ 177 return object->getDocked(index); 178} 179 180DefineEngineMethod( RazerHydraFrame, getControllerSequenceNum, S32, ( S32 index ),, 181 "@brief Get the controller sequence number.\n\n" 182 "@param index The controller index to check.\n" 183 "@return The sequence number of the requested controller.\n\n") 184{ 185 return object->getSequenceNum(index); 186} 187 188DefineEngineMethod( RazerHydraFrame, getControllerRawPos, Point3F, ( S32 index ),, 189 "@brief Get the raw position of the requested controller.\n\n" 190 "The raw position is the controller's floating point position converted to " 191 "Torque 3D coordinates (in millimeters).\n" 192 "@param index The controller index to check.\n" 193 "@return Raw position of the requested controller (in millimeters).\n\n") 194{ 195 return object->getRawPos(index); 196} 197 198DefineEngineMethod( RazerHydraFrame, getControllerPos, Point3I, ( S32 index ),, 199 "@brief Get the position of the requested controller.\n\n" 200 "The position is the controller's integer position converted to " 201 "Torque 3D coordinates (in millimeters).\n" 202 "@param index The controller index to check.\n" 203 "@return Integer position of the requested controller (in millimeters).\n\n") 204{ 205 return object->getPos(index); 206} 207 208DefineEngineMethod( RazerHydraFrame, getControllerRot, AngAxisF, ( S32 index ),, 209 "@brief Get the rotation of the requested controller.\n\n" 210 "The Razer Hydra controller rotation as converted into the Torque 3D" 211 "coordinate system.\n" 212 "@param index The controller index to check.\n" 213 "@return Rotation of the requested controller.\n\n") 214{ 215 AngAxisF aa(object->getRot(index)); 216 return aa; 217} 218 219DefineEngineMethod( RazerHydraFrame, getControllerRawTransform, TransformF, ( S32 index ),, 220 "@brief Get the raw transform of the requested controller.\n\n" 221 "@param index The controller index to check.\n" 222 "@return The raw position and rotation of the requested controller (in Torque 3D coordinates).\n\n") 223{ 224 const Point3F& pos = object->getRawPos(index); 225 const QuatF& qa = object->getRotQuat(index); 226 227 AngAxisF aa(qa); 228 aa.axis.normalize(); 229 230 TransformF trans(pos, aa); 231 return trans; 232} 233 234DefineEngineMethod( RazerHydraFrame, getControllerTransform, TransformF, ( S32 index ),, 235 "@brief Get the transform of the requested controller.\n\n" 236 "@param index The controller index to check.\n" 237 "@return The position and rotation of the requested controller (in Torque 3D coordinates).\n\n") 238{ 239 const Point3I& pos = object->getPos(index); 240 const QuatF& qa = object->getRotQuat(index); 241 242 AngAxisF aa(qa); 243 aa.axis.normalize(); 244 245 TransformF trans; 246 trans.mPosition = Point3F(pos.x, pos.y, pos.z); 247 trans.mOrientation = aa; 248 249 return trans; 250} 251 252DefineEngineMethod( RazerHydraFrame, getControllerRotAxis, Point2F, ( S32 index ),, 253 "@brief Get the axis rotation of the requested controller.\n\n" 254 "This is the axis rotation of the controller as if the controller were a gamepad thumb stick. " 255 "Imagine a stick coming out the top of the controller and tilting the controller front, back, " 256 "left and right controls that stick. The values returned along the x and y stick " 257 "axis are normalized from -1.0 to 1.0 with the maximum controller tilt angle for these " 258 "values as defined by $RazerHydra::MaximumAxisAngle.\n" 259 "@param index The controller index to check.\n" 260 "@return Axis rotation of the requested controller.\n\n" 261 "@see RazerHydra::MaximumAxisAngle\n") 262{ 263 return object->getRotAxis(index); 264} 265 266DefineEngineMethod( RazerHydraFrame, getControllerThumbStick, Point2F, ( S32 index ),, 267 "@brief Get the thumb stick values of the requested controller.\n\n" 268 "The thumb stick values are in the range of -1.0..1.0\n" 269 "@param index The controller index to check.\n" 270 "@return Thumb stick values of the requested controller.\n\n") 271{ 272 return object->getThumbStick(index); 273} 274 275DefineEngineMethod( RazerHydraFrame, getControllerTrigger, F32, ( S32 index ),, 276 "@brief Get the trigger value for the requested controller.\n\n" 277 "The trigger value is in the range of -1.0..1.0\n" 278 "@param index The controller index to check.\n" 279 "@return Trigger value of the requested controller.\n\n") 280{ 281 return object->getTrigger(index); 282} 283 284DefineEngineMethod( RazerHydraFrame, getControllerShoulderButton, bool, ( S32 index ),, 285 "@brief Get the shoulder button state for the requested controller.\n\n" 286 "@param index The controller index to check.\n" 287 "@return Shoulder button state requested controller as true or false.\n\n") 288{ 289 return object->getShoulder(index); 290} 291 292DefineEngineMethod( RazerHydraFrame, getControllerThumbButton, bool, ( S32 index ),, 293 "@brief Get the thumb button state for the requested controller.\n\n" 294 "@param index The controller index to check.\n" 295 "@return Thumb button state requested controller as true or false.\n\n") 296{ 297 return object->getThumb(index); 298} 299 300DefineEngineMethod( RazerHydraFrame, getControllerStartButton, bool, ( S32 index ),, 301 "@brief Get the start button state for the requested controller.\n\n" 302 "@param index The controller index to check.\n" 303 "@return Start button state requested controller as true or false.\n\n") 304{ 305 return object->getStart(index); 306} 307 308DefineEngineMethod( RazerHydraFrame, getControllerButton1, bool, ( S32 index ),, 309 "@brief Get the button 1 state for the requested controller.\n\n" 310 "@param index The controller index to check.\n" 311 "@return Button 1 state requested controller as true or false.\n\n") 312{ 313 return object->getButton1(index); 314} 315 316DefineEngineMethod( RazerHydraFrame, getControllerButton2, bool, ( S32 index ),, 317 "@brief Get the button 2 state for the requested controller.\n\n" 318 "@param index The controller index to check.\n" 319 "@return Button 2 state requested controller as true or false.\n\n") 320{ 321 return object->getButton2(index); 322} 323 324DefineEngineMethod( RazerHydraFrame, getControllerButton3, bool, ( S32 index ),, 325 "@brief Get the button 3 state for the requested controller.\n\n" 326 "@param index The controller index to check.\n" 327 "@return Button 3 state requested controller as true or false.\n\n") 328{ 329 return object->getButton3(index); 330} 331 332DefineEngineMethod( RazerHydraFrame, getControllerButton4, bool, ( S32 index ),, 333 "@brief Get the button 4 state for the requested controller.\n\n" 334 "@param index The controller index to check.\n" 335 "@return Button 4 state requested controller as true or false.\n\n") 336{ 337 return object->getButton4(index); 338} 339