Ocean
JSHomogenousMatrix4.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_HOMOGENOUS_MATRIX_4_H
9 #define META_OCEAN_INTERACTION_JS_HOMOGENOUS_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 HomogenousMatrix4 object.
25  * @ingroup interactionjs
26  */
27 class OCEAN_INTERACTION_JS_EXPORT JSHomogenousMatrix4 : public JSObject<JSHomogenousMatrix4, HomogenousMatrix4>
28 {
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  * Determines the matrix's determinant.
41  * <pre>
42  * Number = HomogenousMatrix4.determinant()
43  * </pre>
44  */
46 
47  /**
48  * Inverts this matrix.
49  * <pre>
50  * Boolean = HomogenousMatrix4.invert()
51  * </pre>
52  */
54 
55  /**
56  * Returns the inverted matrix of this matrix.
57  * <pre>
58  * HomogenousMatrix4 = HomogenousMatrix4.inverted()
59  * </pre>
60  */
62 
63  /**
64  * Returns an interpolated matrix.
65  * <pre>
66  * HomogenousMatrix4 = HomogenousMatrix4.interpolate(HomogenousMatrix4, Number)
67  * </pre>
68  */
70 
71  /**
72  * Returns whether two matrices are equal up to some epsilon.
73  * <pre>
74  * Boolean = HomogenousMatrix4.isEqual(HomogenousMatrix4)
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  * HomogenousMatrix4 = HomogenousMatrix4.multiply(HomogenousMatrix4)
83  * Vector3 = HomogenousMatrix4.multiply(Vector3)
84  * Vector4 = HomogenousMatrix4.multiply(Vector4)
85  * HomogenousMatrix4 = HomogenousMatrix4.multiply(Rotation)
86  * HomogenousMatrix4 = HomogenousMatrix4.multiply(Quaternion)
87  * HomogenousMatrix4 = HomogenousMatrix4.multiply(Euler)
88  * </pre>
89  */
91 
92  /**
93  * Returns the rotation of this matrix.
94  * <pre>
95  * Rotation = HomogenousMatrix4.rotation()
96  * </pre>
97  */
99 
100  /**
101  * Returns the scale of this matrix.
102  * <pre>
103  * Vector3 = HomogenousMatrix4.scale()
104  * </pre>
105  */
107 
108  /**
109  * Sets the rotation of this matrix matrix.
110  * <pre>
111  * HomogenousMatrix4.setRotation(Rotation)
112  * HomogenousMatrix4.setRotation(Quaternion)
113  * HomogenousMatrix4.setRotation(Euler)
114  * HomogenousMatrix4.setRotation(SquareMatrix3)
115  * HomogenousMatrix4.setRotation(HomogenousMatrix4)
116  * </pre>
117  */
119 
120  /**
121  * Sets the translation of this matrix matrix.
122  * <pre>
123  * HomogenousMatrix4.setTranslation(Vector3)
124  * HomogenousMatrix4.setTranslation(HomogenousMatrix4)
125  * </pre>
126  */
128 
129  /**
130  * Returns a string with the values of this matrix.
131  * <pre>
132  * String = HomogenousMatrix4.string()
133  * </pre>
134  */
136 
137  /**
138  * Returns the trace of this matrix.
139  * <pre>
140  * Number = HomogenousMatrix4.trace()
141  * </pre>
142  */
144 
145  /**
146  * Returns the translation of this matrix.
147  * <pre>
148  * Vector3 = HomogenousMatrix4.translation()
149  * </pre>
150  */
152 
153  /**
154  * Returns the transposed matrix of this matrix.
155  * <pre>
156  * SquareMatrix4 = HomogenousMatrix4.transposed()
157  * </pre>
158  */
160 
161  /**
162  * Returns the x-axis of this matrix.
163  * <pre>
164  * Vector3 = HomogenousMatrix4.xAxis()
165  * </pre>
166  */
168 
169  /**
170  * Returns the y-axis of this matrix.
171  * <pre>
172  * Vector3 = HomogenousMatrix4.yAxis()
173  * </pre>
174  */
176 
177  /**
178  * Returns the z-axis of this matrix.
179  * <pre>
180  * Vector3 = HomogenousMatrix4.zAxis()
181  * </pre>
182  */
183  FI_Z_AXIS
184  };
185 
186  public:
187 
188  /**
189  * Returns the JavaScript name of this object.
190  * @return The object's JavaScript name
191  */
192  static inline const char* objectName();
193 
194  protected:
195 
196  /**
197  * Creates the function template and object template for this object.
198  */
199  static void createFunctionTemplate();
200 };
201 
203 {
204  return "HomogenousMatrix4";
205 }
206 
207 }
208 
209 }
210 
211 }
212 
213 #endif // META_OCEAN_INTERACTION_JS_HOMOGENOUS_MATRIX_4_H
This class implements a wrapper for a JavaScript HomogenousMatrix4 object.
Definition: JSHomogenousMatrix4.h:28
static void createFunctionTemplate()
Creates the function template and object template for this object.
FunctionId
Definition of ids for individual functions.
Definition: JSHomogenousMatrix4.h:38
@ FI_TRACE
Returns the trace of this matrix.
Definition: JSHomogenousMatrix4.h:143
@ FI_X_AXIS
Returns the x-axis of this matrix.
Definition: JSHomogenousMatrix4.h:167
@ FI_SCALE
Returns the scale of this matrix.
Definition: JSHomogenousMatrix4.h:106
@ FI_ROTATION
Returns the rotation of this matrix.
Definition: JSHomogenousMatrix4.h:98
@ FI_TRANSPOSED
Returns the transposed matrix of this matrix.
Definition: JSHomogenousMatrix4.h:159
@ FI_INVERT
Inverts this matrix.
Definition: JSHomogenousMatrix4.h:53
@ FI_IS_EQUAL
Returns whether two matrices are equal up to some epsilon.
Definition: JSHomogenousMatrix4.h:77
@ FI_INVERTED
Returns the inverted matrix of this matrix.
Definition: JSHomogenousMatrix4.h:61
@ FI_SET_TRANSLATION
Sets the translation of this matrix matrix.
Definition: JSHomogenousMatrix4.h:127
@ FI_TRANSLATION
Returns the translation of this matrix.
Definition: JSHomogenousMatrix4.h:151
@ FI_INTERPOLATE
Returns an interpolated matrix.
Definition: JSHomogenousMatrix4.h:69
@ FI_MULTIPLY
Multiplies two matrices, mutiplies this matrix with a vector, or multiplies this matrix with a scalar...
Definition: JSHomogenousMatrix4.h:90
@ FI_Y_AXIS
Returns the y-axis of this matrix.
Definition: JSHomogenousMatrix4.h:175
@ FI_SET_ROTATION
Sets the rotation of this matrix matrix.
Definition: JSHomogenousMatrix4.h:118
@ FI_DETERMINANT
Determines the matrix's determinant.
Definition: JSHomogenousMatrix4.h:45
@ FI_STRING
Returns a string with the values of this matrix.
Definition: JSHomogenousMatrix4.h:135
static const char * objectName()
Returns the JavaScript name of this object.
Definition: JSHomogenousMatrix4.h:202
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
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15