CD6Joint.generated.cs 8.8 KB

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