Ocean
JSSquareMatrix4.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_INTERACTION_JS_SQUARE_MATRIX_4_H
9 #define META_OCEAN_INTERACTION_JS_SQUARE_MATRIX_4_H
10 
13 
14 namespace Ocean
15 {
16 
17 namespace Interaction
18 {
19 
20 namespace JavaScript
21 {
22 
23 /**
24  * This class implements a wrapper for a JavaScript SquareMatrix4 object.
25  * @ingroup interactionjs
26  */
27 class OCEAN_INTERACTION_JS_EXPORT JSSquareMatrix4 : public JSObject<JSSquareMatrix4, SquareMatrix4>
28 {
29  friend class JSObject<JSSquareMatrix4, SquareMatrix4>;
30  friend class JSLibrary;
31 
32  public:
33 
34  /**
35  * Definition of ids for individual functions.
36  */
37  enum FunctionId : unsigned int
38  {
39  /**
40  * Adds two matrices.
41  * <pre>
42  * SquareMatrix4 = SquareMatrix4.add(SquareMatrix4)
43  * </pre>
44  */
46 
47  /**
48  * Determines the matrix's determinant.
49  * <pre>
50  * Number = SquareMatrix4.determinant()
51  * </pre>
52  */
54 
55  /**
56  * Inverts this matrix.
57  * <pre>
58  * Boolean = SquareMatrix4.invert()
59  * </pre>
60  */
62 
63  /**
64  * Returns the inverted matrix of this matrix.
65  * <pre>
66  * SquareMatrix4 = SquareMatrix4.inverted()
67  * </pre>
68  */
70 
71  /**
72  * Returns whether two matrices are equal up to some epsilon.
73  * <pre>
74  * Boolean = SquareMatrix4.isEqual(SquareMatrix4)
75  * </pre>
76  */
78 
79  /**
80  * Multiplies two matrices, mutiplies this matrix with a vector, or multiplies this matrix with a scalar.
81  * <pre>
82  * SquareMatrix4 = SquareMatrix4.multiply(SquareMatrix4)
83  * SquareMatrix4 = SquareMatrix4.multiply(HomogenousMatrix4)
84  * Vector3 = SquareMatrix4.multiply(Vector3)
85  * Vector4 = SquareMatrix4.multiply(Vector4)
86  * SquareMatrix4 = SquareMatrix4.multiply(Number)
87  * </pre>
88  */
90 
91  /**
92  * Returns a string with the values of this matrix.
93  * <pre>
94  * String = SquareMatrix4.string()
95  * </pre>
96  */
98 
99  /**
100  * Subtracts two matrices.
101  * <pre>
102  * SquareMatrix4 = SquareMatrix4.subtract(SquareMatrix4)
103  * </pre>
104  */
106 
107  /**
108  * Returns the trace of this matrix.
109  * <pre>
110  * Number = SquareMatrix4.trace()
111  * </pre>
112  */
114 
115  /**
116  * Transposes this matrix.
117  * <pre>
118  * SquareMatrix4.transpose()
119  * </pre>
120  */
122 
123  /**
124  * Returns the transposed matrix of this matrix.
125  * <pre>
126  * SquareMatrix4 = SquareMatrix4.transposed()
127  * </pre>
128  */
129  FI_TRANSPOSED
130  };
131 
132  public:
133 
134  /**
135  * Returns the JavaScript name of this object.
136  * @return The object's JavaScript name
137  */
138  static inline const char* objectName();
139 
140  protected:
141 
142  /**
143  * Creates the function template and object template for this object.
144  */
145  static void createFunctionTemplate();
146 };
147 
148 inline const char* JSSquareMatrix4::objectName()
149 {
150  return "SquareMatrix4";
151 }
152 
153 }
154 
155 }
156 
157 }
158 
159 #endif // META_OCEAN_INTERACTION_JS_SQUARE_MATRIX_3_H
This class implements the java script interaction library object.
Definition: JSLibrary.h:32
This class implements the base class for all native wrapper of JavaScript objects.
Definition: JSObject.h:31
This class implements a wrapper for a JavaScript SquareMatrix4 object.
Definition: JSSquareMatrix4.h:28
static void createFunctionTemplate()
Creates the function template and object template for this object.
static const char * objectName()
Returns the JavaScript name of this object.
Definition: JSSquareMatrix4.h:148
FunctionId
Definition of ids for individual functions.
Definition: JSSquareMatrix4.h:38
@ FI_SUBTRACT
Subtracts two matrices.
Definition: JSSquareMatrix4.h:105
@ FI_ADD
Adds two matrices.
Definition: JSSquareMatrix4.h:45
@ FI_INVERT
Inverts this matrix.
Definition: JSSquareMatrix4.h:61
@ FI_TRACE
Returns the trace of this matrix.
Definition: JSSquareMatrix4.h:113
@ FI_INVERTED
Returns the inverted matrix of this matrix.
Definition: JSSquareMatrix4.h:69
@ FI_DETERMINANT
Determines the matrix's determinant.
Definition: JSSquareMatrix4.h:53
@ FI_STRING
Returns a string with the values of this matrix.
Definition: JSSquareMatrix4.h:97
@ FI_MULTIPLY
Multiplies two matrices, mutiplies this matrix with a vector, or multiplies this matrix with a scalar...
Definition: JSSquareMatrix4.h:89
@ FI_IS_EQUAL
Returns whether two matrices are equal up to some epsilon.
Definition: JSSquareMatrix4.h:77
@ FI_TRANSPOSE
Transposes this matrix.
Definition: JSSquareMatrix4.h:121
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15