2
0

CD6Joint.generated.cs 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Physics
  7. * @{
  8. */
  9. /// <summary>
  10. /// Represents the most customizable type of joint. This joint type can be used to create all other built-in joint types,
  11. /// and to design your own custom ones, but is less intuitive to use. Allows a specification of a linear constraint (for
  12. /// example for slider), twist constraint (rotating around X) and swing constraint (rotating around Y and Z). It also
  13. /// allows you to constrain limits to only specific axes or completely lock specific axes.
  14. /// </summary>
  15. [ShowInInspector]
  16. public partial class D6Joint : Joint
  17. {
  18. private D6Joint(bool __dummy0) { }
  19. protected D6Joint() { }
  20. /// <summary>Returns the current rotation of the joint around the X axis.</summary>
  21. [ShowInInspector]
  22. [NativeWrapper]
  23. public Radian Twist
  24. {
  25. get
  26. {
  27. Radian temp;
  28. Internal_getTwist(mCachedPtr, out temp);
  29. return temp;
  30. }
  31. }
  32. /// <summary>Returns the current rotation of the joint around the Y axis.</summary>
  33. [ShowInInspector]
  34. [NativeWrapper]
  35. public Radian SwingY
  36. {
  37. get
  38. {
  39. Radian temp;
  40. Internal_getSwingY(mCachedPtr, out temp);
  41. return temp;
  42. }
  43. }
  44. /// <summary>Returns the current rotation of the joint around the Z axis.</summary>
  45. [ShowInInspector]
  46. [NativeWrapper]
  47. public Radian SwingZ
  48. {
  49. get
  50. {
  51. Radian temp;
  52. Internal_getSwingZ(mCachedPtr, out temp);
  53. return temp;
  54. }
  55. }
  56. /// <summary>Determines the linear limit used for constraining translation degrees of freedom.</summary>
  57. [ShowInInspector]
  58. [NativeWrapper]
  59. public LimitLinear LimitLinear
  60. {
  61. get
  62. {
  63. LimitLinear temp;
  64. Internal_getLimitLinear(mCachedPtr, out temp);
  65. return temp;
  66. }
  67. set { Internal_setLimitLinear(mCachedPtr, ref value); }
  68. }
  69. /// <summary>
  70. /// Determines the angular limit used for constraining the twist (rotation around X) degree of freedom.
  71. /// </summary>
  72. [ShowInInspector]
  73. [NativeWrapper]
  74. public LimitAngularRange LimitTwist
  75. {
  76. get
  77. {
  78. LimitAngularRange temp;
  79. Internal_getLimitTwist(mCachedPtr, out temp);
  80. return temp;
  81. }
  82. set { Internal_setLimitTwist(mCachedPtr, ref value); }
  83. }
  84. /// <summary>
  85. /// Determines the cone limit used for constraining the swing (rotation around Y and Z) degree of freedom.
  86. /// </summary>
  87. [ShowInInspector]
  88. [NativeWrapper]
  89. public LimitConeRange LimitSwing
  90. {
  91. get
  92. {
  93. LimitConeRange temp;
  94. Internal_getLimitSwing(mCachedPtr, out temp);
  95. return temp;
  96. }
  97. set { Internal_setLimitSwing(mCachedPtr, ref value); }
  98. }
  99. /// <summary>Returns the drive's target position relative to the joint's first body.</summary>
  100. [ShowInInspector]
  101. [NativeWrapper]
  102. public Vector3 DrivePosition
  103. {
  104. get
  105. {
  106. Vector3 temp;
  107. Internal_getDrivePosition(mCachedPtr, out temp);
  108. return temp;
  109. }
  110. }
  111. /// <summary>Returns the drive's target rotation relative to the joint's first body.</summary>
  112. [ShowInInspector]
  113. [NativeWrapper]
  114. public Quaternion DriveRotation
  115. {
  116. get
  117. {
  118. Quaternion temp;
  119. Internal_getDriveRotation(mCachedPtr, out temp);
  120. return temp;
  121. }
  122. }
  123. /// <summary>Returns the drive's target linear velocity.</summary>
  124. [ShowInInspector]
  125. [NativeWrapper]
  126. public Vector3 DriveLinearVelocity
  127. {
  128. get
  129. {
  130. Vector3 temp;
  131. Internal_getDriveLinearVelocity(mCachedPtr, out temp);
  132. return temp;
  133. }
  134. }
  135. /// <summary>Returns the drive's target angular velocity.</summary>
  136. [ShowInInspector]
  137. [NativeWrapper]
  138. public Vector3 DriveAngularVelocity
  139. {
  140. get
  141. {
  142. Vector3 temp;
  143. Internal_getDriveAngularVelocity(mCachedPtr, out temp);
  144. return temp;
  145. }
  146. }
  147. /// <summary>Returns motion constraint for the specified axis.</summary>
  148. public D6JointMotion GetMotion(D6JointAxis axis)
  149. {
  150. return Internal_getMotion(mCachedPtr, axis);
  151. }
  152. /// <summary>
  153. /// Allows you to constrain motion of the specified axis. Be aware that when setting drives for a specific axis you must
  154. /// also take care not to constrain its motion in a conflicting way (for example you cannot add a drive that moves the
  155. /// joint on X axis, and then lock the X axis).
  156. ///
  157. /// Unlocking translations degrees of freedom allows the bodies to move along the subset of the unlocked axes. (for
  158. /// example unlocking just one translational axis is the equivalent of a slider joint.)
  159. ///
  160. /// Angular degrees of freedom are partitioned as twist (around X axis) and swing (around Y and Z axes). Different
  161. /// effects can be achieves by unlocking their various combinations: - If a single degree of angular freedom is unlocked
  162. /// it should be the twist degree as it has extra options for that case (for example for a hinge joint). - If both swing
  163. /// degrees are unlocked but twist is locked the result is a zero-twist joint. - If one swing and one twist degree of
  164. /// freedom are unlocked the result is a zero-swing joint (for example an arm attached at the elbow) - If all angular
  165. /// degrees of freedom are unlocked the result is the same as the spherical joint.
  166. /// </summary>
  167. public void SetMotion(D6JointAxis axis, D6JointMotion motion)
  168. {
  169. Internal_setMotion(mCachedPtr, axis, motion);
  170. }
  171. /// <summary>
  172. /// Determines a drive that will attempt to move the specified degree(s) of freedom to the wanted position and velocity.
  173. /// </summary>
  174. public D6JointDrive GetDrive(D6JointDriveType type)
  175. {
  176. D6JointDrive temp;
  177. Internal_getDrive(mCachedPtr, type, out temp);
  178. return temp;
  179. }
  180. /// <summary>
  181. /// Determines a drive that will attempt to move the specified degree(s) of freedom to the wanted position and velocity.
  182. /// </summary>
  183. public void SetDrive(D6JointDriveType type, D6JointDrive drive)
  184. {
  185. Internal_setDrive(mCachedPtr, type, ref drive);
  186. }
  187. /// <summary>Sets the drive's target position and rotation relative to the joint's first body.</summary>
  188. public void SetDriveTransform(Vector3 position, Quaternion rotation)
  189. {
  190. Internal_setDriveTransform(mCachedPtr, ref position, ref rotation);
  191. }
  192. /// <summary>Sets the drive's target linear and angular velocities.</summary>
  193. public void SetDriveVelocity(Vector3 linear, Vector3 angular)
  194. {
  195. Internal_setDriveVelocity(mCachedPtr, ref linear, ref angular);
  196. }
  197. [MethodImpl(MethodImplOptions.InternalCall)]
  198. private static extern D6JointMotion Internal_getMotion(IntPtr thisPtr, D6JointAxis axis);
  199. [MethodImpl(MethodImplOptions.InternalCall)]
  200. private static extern void Internal_setMotion(IntPtr thisPtr, D6JointAxis axis, D6JointMotion motion);
  201. [MethodImpl(MethodImplOptions.InternalCall)]
  202. private static extern void Internal_getTwist(IntPtr thisPtr, out Radian __output);
  203. [MethodImpl(MethodImplOptions.InternalCall)]
  204. private static extern void Internal_getSwingY(IntPtr thisPtr, out Radian __output);
  205. [MethodImpl(MethodImplOptions.InternalCall)]
  206. private static extern void Internal_getSwingZ(IntPtr thisPtr, out Radian __output);
  207. [MethodImpl(MethodImplOptions.InternalCall)]
  208. private static extern void Internal_getLimitLinear(IntPtr thisPtr, out LimitLinear __output);
  209. [MethodImpl(MethodImplOptions.InternalCall)]
  210. private static extern void Internal_setLimitLinear(IntPtr thisPtr, ref LimitLinear limit);
  211. [MethodImpl(MethodImplOptions.InternalCall)]
  212. private static extern void Internal_getLimitTwist(IntPtr thisPtr, out LimitAngularRange __output);
  213. [MethodImpl(MethodImplOptions.InternalCall)]
  214. private static extern void Internal_setLimitTwist(IntPtr thisPtr, ref LimitAngularRange limit);
  215. [MethodImpl(MethodImplOptions.InternalCall)]
  216. private static extern void Internal_getLimitSwing(IntPtr thisPtr, out LimitConeRange __output);
  217. [MethodImpl(MethodImplOptions.InternalCall)]
  218. private static extern void Internal_setLimitSwing(IntPtr thisPtr, ref LimitConeRange limit);
  219. [MethodImpl(MethodImplOptions.InternalCall)]
  220. private static extern void Internal_getDrive(IntPtr thisPtr, D6JointDriveType type, out D6JointDrive __output);
  221. [MethodImpl(MethodImplOptions.InternalCall)]
  222. private static extern void Internal_setDrive(IntPtr thisPtr, D6JointDriveType type, ref D6JointDrive drive);
  223. [MethodImpl(MethodImplOptions.InternalCall)]
  224. private static extern void Internal_getDrivePosition(IntPtr thisPtr, out Vector3 __output);
  225. [MethodImpl(MethodImplOptions.InternalCall)]
  226. private static extern void Internal_getDriveRotation(IntPtr thisPtr, out Quaternion __output);
  227. [MethodImpl(MethodImplOptions.InternalCall)]
  228. private static extern void Internal_setDriveTransform(IntPtr thisPtr, ref Vector3 position, ref Quaternion rotation);
  229. [MethodImpl(MethodImplOptions.InternalCall)]
  230. private static extern void Internal_getDriveLinearVelocity(IntPtr thisPtr, out Vector3 __output);
  231. [MethodImpl(MethodImplOptions.InternalCall)]
  232. private static extern void Internal_getDriveAngularVelocity(IntPtr thisPtr, out Vector3 __output);
  233. [MethodImpl(MethodImplOptions.InternalCall)]
  234. private static extern void Internal_setDriveVelocity(IntPtr thisPtr, ref Vector3 linear, ref Vector3 angular);
  235. }
  236. /** @} */
  237. }