CD6Joint.generated.cs 8.8 KB

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