FbxQuaternion.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. //------------------------------------------------------------------------------
  2. // <auto-generated />
  3. //
  4. // This file was automatically generated by SWIG (http://www.swig.org).
  5. // Version 3.0.12
  6. //
  7. // Do not make changes to this file unless you know what you are doing--modify
  8. // the SWIG interface file instead.
  9. //------------------------------------------------------------------------------
  10. namespace Autodesk.Fbx {
  11. public class FbxQuaternion : global::System.IDisposable {
  12. private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal FbxQuaternion(global::System.IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  17. }
  18. internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FbxQuaternion obj) {
  19. return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~FbxQuaternion() {
  22. Dispose();
  23. }
  24. public virtual void Dispose() {
  25. lock(this) {
  26. if (swigCPtr.Handle != global::System.IntPtr.Zero) {
  27. if (swigCMemOwn) {
  28. swigCMemOwn = false;
  29. NativeMethods.delete_FbxQuaternion(swigCPtr);
  30. }
  31. swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
  32. }
  33. global::System.GC.SuppressFinalize(this);
  34. }
  35. }
  36. public FbxQuaternion() : this(NativeMethods.new_FbxQuaternion__SWIG_0(), true) {
  37. }
  38. public FbxQuaternion(FbxQuaternion pV) : this(NativeMethods.new_FbxQuaternion__SWIG_1(FbxQuaternion.getCPtr(pV)), true) {
  39. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  40. }
  41. public FbxQuaternion(double pX, double pY, double pZ, double pW) : this(NativeMethods.new_FbxQuaternion__SWIG_2(pX, pY, pZ, pW), true) {
  42. }
  43. public FbxQuaternion(double pX, double pY, double pZ) : this(NativeMethods.new_FbxQuaternion__SWIG_3(pX, pY, pZ), true) {
  44. }
  45. public FbxQuaternion(FbxVector4 pAxis, double pDegree) : this(NativeMethods.new_FbxQuaternion__SWIG_4(pAxis, pDegree), true) {
  46. }
  47. private double GetAtUnchecked(int pIndex) {
  48. double ret = NativeMethods.FbxQuaternion_GetAtUnchecked(swigCPtr, pIndex);
  49. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  50. return ret;
  51. }
  52. private void SetAtUnchecked(int pIndex, double pValue) {
  53. NativeMethods.FbxQuaternion_SetAtUnchecked(swigCPtr, pIndex, pValue);
  54. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  55. }
  56. public void Set(double pX, double pY, double pZ, double pW) {
  57. NativeMethods.FbxQuaternion_Set__SWIG_0(swigCPtr, pX, pY, pZ, pW);
  58. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  59. }
  60. public void Set(double pX, double pY, double pZ) {
  61. NativeMethods.FbxQuaternion_Set__SWIG_1(swigCPtr, pX, pY, pZ);
  62. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  63. }
  64. private FbxQuaternion operator_Add(double pValue) {
  65. FbxQuaternion ret = new FbxQuaternion(NativeMethods.FbxQuaternion_operator_Add__SWIG_0(swigCPtr, pValue), true);
  66. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  67. return ret;
  68. }
  69. private FbxQuaternion operator_Sub(double pValue) {
  70. FbxQuaternion ret = new FbxQuaternion(NativeMethods.FbxQuaternion_operator_Sub__SWIG_0(swigCPtr, pValue), true);
  71. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  72. return ret;
  73. }
  74. private FbxQuaternion operator_Mul(double pValue) {
  75. FbxQuaternion ret = new FbxQuaternion(NativeMethods.FbxQuaternion_operator_Mul__SWIG_0(swigCPtr, pValue), true);
  76. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  77. return ret;
  78. }
  79. private FbxQuaternion operator_Div(double pValue) {
  80. FbxQuaternion ret = new FbxQuaternion(NativeMethods.FbxQuaternion_operator_Div__SWIG_0(swigCPtr, pValue), true);
  81. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  82. return ret;
  83. }
  84. private FbxQuaternion operator_Negate() {
  85. FbxQuaternion ret = new FbxQuaternion(NativeMethods.FbxQuaternion_operator_Negate(swigCPtr), true);
  86. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  87. return ret;
  88. }
  89. private FbxQuaternion operator_Add(FbxQuaternion pQuaternion) {
  90. FbxQuaternion ret = new FbxQuaternion(NativeMethods.FbxQuaternion_operator_Add__SWIG_1(swigCPtr, FbxQuaternion.getCPtr(pQuaternion)), true);
  91. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  92. return ret;
  93. }
  94. private FbxQuaternion operator_Sub(FbxQuaternion pQuaternion) {
  95. FbxQuaternion ret = new FbxQuaternion(NativeMethods.FbxQuaternion_operator_Sub__SWIG_1(swigCPtr, FbxQuaternion.getCPtr(pQuaternion)), true);
  96. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  97. return ret;
  98. }
  99. private FbxQuaternion operator_Mul(FbxQuaternion pOther) {
  100. FbxQuaternion ret = new FbxQuaternion(NativeMethods.FbxQuaternion_operator_Mul__SWIG_1(swigCPtr, FbxQuaternion.getCPtr(pOther)), true);
  101. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  102. return ret;
  103. }
  104. private FbxQuaternion operator_Div(FbxQuaternion pOther) {
  105. FbxQuaternion ret = new FbxQuaternion(NativeMethods.FbxQuaternion_operator_Div__SWIG_1(swigCPtr, FbxQuaternion.getCPtr(pOther)), true);
  106. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  107. return ret;
  108. }
  109. public FbxQuaternion Product(FbxQuaternion pOther) {
  110. FbxQuaternion ret = new FbxQuaternion(NativeMethods.FbxQuaternion_Product(swigCPtr, FbxQuaternion.getCPtr(pOther)), true);
  111. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  112. return ret;
  113. }
  114. public double DotProduct(FbxQuaternion pQuaternion) {
  115. double ret = NativeMethods.FbxQuaternion_DotProduct(swigCPtr, FbxQuaternion.getCPtr(pQuaternion));
  116. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  117. return ret;
  118. }
  119. public void Normalize() {
  120. NativeMethods.FbxQuaternion_Normalize(swigCPtr);
  121. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  122. }
  123. public void Conjugate() {
  124. NativeMethods.FbxQuaternion_Conjugate(swigCPtr);
  125. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  126. }
  127. public double Length() {
  128. double ret = NativeMethods.FbxQuaternion_Length(swigCPtr);
  129. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  130. return ret;
  131. }
  132. public void Inverse() {
  133. NativeMethods.FbxQuaternion_Inverse(swigCPtr);
  134. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  135. }
  136. public void SetAxisAngle(FbxVector4 pAxis, double pDegree) {
  137. NativeMethods.FbxQuaternion_SetAxisAngle(swigCPtr, pAxis, pDegree);
  138. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  139. }
  140. public FbxQuaternion Slerp(FbxQuaternion pOther, double pWeight) {
  141. FbxQuaternion ret = new FbxQuaternion(NativeMethods.FbxQuaternion_Slerp(swigCPtr, FbxQuaternion.getCPtr(pOther), pWeight), true);
  142. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  143. return ret;
  144. }
  145. public void ComposeSphericalXYZ(FbxVector4 pEuler) {
  146. NativeMethods.FbxQuaternion_ComposeSphericalXYZ(swigCPtr, pEuler);
  147. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  148. }
  149. public FbxVector4 DecomposeSphericalXYZ() {
  150. var ret = NativeMethods.FbxQuaternion_DecomposeSphericalXYZ(swigCPtr);
  151. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  152. return ret;
  153. }
  154. private bool _equals(FbxQuaternion pV) {
  155. bool ret = NativeMethods.FbxQuaternion__equals(swigCPtr, FbxQuaternion.getCPtr(pV));
  156. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  157. return ret;
  158. }
  159. public int Compare(FbxQuaternion pQ2, double pThreshold) {
  160. int ret = NativeMethods.FbxQuaternion_Compare__SWIG_0(swigCPtr, FbxQuaternion.getCPtr(pQ2), pThreshold);
  161. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  162. return ret;
  163. }
  164. public int Compare(FbxQuaternion pQ2) {
  165. int ret = NativeMethods.FbxQuaternion_Compare__SWIG_1(swigCPtr, FbxQuaternion.getCPtr(pQ2));
  166. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  167. return ret;
  168. }
  169. public double GetAt(int index) { return this[index]; }
  170. public void SetAt(int index, double value) { this[index] = value; }
  171. public double this[int index] {
  172. get {
  173. if (index < 0 || index >= 4) { throw new System.ArgumentOutOfRangeException("index"); }
  174. return GetAtUnchecked(index);
  175. }
  176. set {
  177. if (index < 0 || index >= 4) { throw new System.ArgumentOutOfRangeException("index"); }
  178. SetAtUnchecked(index, value);
  179. }
  180. }
  181. public double X { get { return GetAtUnchecked(0); } set { SetAtUnchecked(0, value); } }
  182. public double Y { get { return GetAtUnchecked(1); } set { SetAtUnchecked(1, value); } }
  183. public double Z { get { return GetAtUnchecked(2); } set { SetAtUnchecked(2, value); } }
  184. public double W { get { return GetAtUnchecked(3); } set { SetAtUnchecked(3, value); } }
  185. public static FbxQuaternion operator * (FbxQuaternion a, FbxQuaternion b) {
  186. return a.operator_Mul(b);
  187. }
  188. public static FbxQuaternion operator * (FbxQuaternion a, double b) {
  189. return a.operator_Mul(b);
  190. }
  191. public static FbxQuaternion operator * (double a, FbxQuaternion b) {
  192. return b.operator_Mul(a);
  193. }
  194. public static FbxQuaternion operator / (FbxQuaternion a, FbxQuaternion b) {
  195. return a.operator_Div(b);
  196. }
  197. public static FbxQuaternion operator / (FbxQuaternion a, double b) {
  198. return a.operator_Div(b);
  199. }
  200. public static FbxQuaternion operator + (FbxQuaternion a, FbxQuaternion b) {
  201. return a.operator_Add(b);
  202. }
  203. public static FbxQuaternion operator - (FbxQuaternion a, FbxQuaternion b) {
  204. return a.operator_Sub(b);
  205. }
  206. public static FbxQuaternion operator + (FbxQuaternion a, double b) {
  207. return a.operator_Add(b);
  208. }
  209. public static FbxQuaternion operator - (FbxQuaternion a, double b) {
  210. return a.operator_Sub(b);
  211. }
  212. public static FbxQuaternion operator - (FbxQuaternion a) {
  213. return a.operator_Negate();
  214. }
  215. public bool Equals(FbxQuaternion other) {
  216. if (object.ReferenceEquals(other, null)) { return false; }
  217. return _equals(other);
  218. }
  219. public override bool Equals(object obj){
  220. if (object.ReferenceEquals(obj, null)) { return false; }
  221. /* is obj a subclass of this type; if so use our Equals */
  222. var typed = obj as FbxQuaternion;
  223. if (!object.ReferenceEquals(typed, null)) {
  224. return this.Equals(typed);
  225. }
  226. /* are we a subclass of the other type; if so use their Equals */
  227. if (typeof(FbxQuaternion).IsSubclassOf(obj.GetType())) {
  228. return obj.Equals(this);
  229. }
  230. /* types are unrelated; can't be a match */
  231. return false;
  232. }
  233. public static bool operator == (FbxQuaternion a, FbxQuaternion b) {
  234. if (object.ReferenceEquals(a, b)) { return true; }
  235. if (object.ReferenceEquals(a, null) || object.ReferenceEquals(b, null)) { return false; }
  236. return a.Equals(b);
  237. }
  238. public static bool operator != (FbxQuaternion a, FbxQuaternion b) {
  239. return !(a == b);
  240. }
  241. public override int GetHashCode() {
  242. int ret = NativeMethods.FbxQuaternion_GetHashCode(swigCPtr);
  243. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  244. return ret;
  245. }
  246. public override string ToString() {
  247. return string.Format("<{0},{1},{2},{3}>", X, Y, Z, W);
  248. }
  249. }
  250. }