Overte C++ Documentation
Vec3.h
1 //
2 // Vec3.h
3 // libraries/script-engine/src
4 //
5 // Created by Brad Hefta-Gaub on 1/29/14.
6 // Copyright 2014 High Fidelity, Inc.
7 // Copyright 2023 Overte e.V.
8 //
9 // Scriptable Vec3 class library.
10 //
11 // Distributed under the Apache License, Version 2.0.
12 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
13 // SPDX-License-Identifier: Apache-2.0
14 //
15 
18 
19 #pragma once
20 #ifndef hifi_Vec3_h
21 #define hifi_Vec3_h
22 
23 #include <QtCore/QObject>
24 #include <QtCore/QString>
25 
26 #include "GLMHelpers.h"
27 #include "Scriptable.h"
28 
29 /*@jsdoc
30  * The <code>Vec3</code> API provides facilities for generating and manipulating 3-dimensional vectors. Overte uses a
31  * right-handed Cartesian coordinate system where the y-axis is the "up" and the negative z-axis is the "front" direction.
32  * <img alt="Overte coordinate system" src="https://apidocs.overte.org/images/opengl-coord-system.jpg" />
33  *
34  * @namespace Vec3
35  * @variation 0
36  *
37  * @hifi-interface
38  * @hifi-client-entity
39  * @hifi-avatar
40  * @hifi-server-entity
41  * @hifi-assignment-client
42  *
43  * @property {Vec3} UNIT_X - <code>{ x: 1, y: 0, z: 0 }</code> : Unit vector in the x-axis direction. <em>Read-only.</em>
44  * @property {Vec3} UNIT_Y - <code>{ x: 0, y: 1, z: 0 }</code> : Unit vector in the y-axis direction. <em>Read-only.</em>
45  * @property {Vec3} UNIT_Z - <code>{ x: 0, y: 0, z: 1 }</code> : Unit vector in the z-axis direction. <em>Read-only.</em>
46  * @property {Vec3} UNIT_NEG_X - <code>{ x: -1, y: 0, z: 0 }</code> : Unit vector in the negative x-axis direction.
47  * <em>Read-only.</em>
48  * @property {Vec3} UNIT_NEG_Y - <code>{ x: 0, y: -1, z: 0 }</code> : Unit vector in the negative y-axis direction.
49  * <em>Read-only.</em>
50  * @property {Vec3} UNIT_NEG_Z - <code>{ x: 0, y: 0, z: -1 }</code> : Unit vector in the negative z-axis direction.
51  * <em>Read-only.</em>
52  * @property {Vec3} UNIT_XY - <code>{ x: 0.707107, y: 0.707107, z: 0 }</code> : Unit vector in the direction of the diagonal
53  * between the x and y axes. <em>Read-only.</em>
54  * @property {Vec3} UNIT_XZ - <code>{ x: 0.707107, y: 0, z: 0.707107 }</code> : Unit vector in the direction of the diagonal
55  * between the x and z axes. <em>Read-only.</em>
56  * @property {Vec3} UNIT_YZ - <code>{ x: 0, y: 0.707107, z: 0.707107 }</code> : Unit vector in the direction of the diagonal
57  * between the y and z axes. <em>Read-only.</em>
58  * @property {Vec3} UNIT_XYZ - <code>{ x: 0.577350, y: 0.577350, z: 0.577350 }</code> : Unit vector in the direction of the
59  * diagonal between the x, y, and z axes. <em>Read-only.</em>
60  * @property {Vec3} FLOAT_MAX - <code>{ x: 3.402823e+38, y: 3.402823e+38, z: 3.402823e+38 }</code> : Vector with all axis
61  * values set to the maximum floating point value. <em>Read-only.</em>
62  * @property {Vec3} FLOAT_MIN - <code>{ x: -3.402823e+38, y: -3.402823e+38, z: -3.402823e+38 }</code> : Vector with all axis
63  * values set to the negative of the maximum floating point value. <em>Read-only.</em>
64  * @property {Vec3} ZERO - <code>{ x: 0, y: 0, z: 0 }</code> : Vector with all axis values set to <code>0</code>.
65  * <em>Read-only.</em>
66  * @property {Vec3} ONE - <code>{ x: 1, y: 1, z: 1 }</code> : Vector with all axis values set to <code>1</code>.
67  * <em>Read-only.</em>
68  * @property {Vec3} TWO - <code>{ x: 2, y: 2, z: 2 }</code> : Vector with all axis values set to <code>2</code>.
69  * <em>Read-only.</em>
70  * @property {Vec3} HALF - <code>{ x: 0.5, y: 0.5, z: 0.5 }</code> : Vector with all axis values set to <code>0.5</code>.
71  * <em>Read-only.</em>
72  * @property {Vec3} RIGHT - <code>{ x: 1, y: 0, z: 0 }</code> : Unit vector in the "right" direction. Synonym for
73  * <code>UNIT_X</code>. <em>Read-only.</em>
74  * @property {Vec3} UP - <code>{ x: 0, y: 1, z: 0 }</code> : Unit vector in the "up" direction. Synonym for
75  * <code>UNIT_Y</code>. <em>Read-only.</em>
76  * @property {Vec3} FRONT - <code>{ x: 0, y: 0, z: -1 }</code> : Unit vector in the "front" direction. Synonym for
77  * <code>UNIT_NEG_Z</code>. <em>Read-only.</em>
78  */
80 class Vec3 : public QObject, protected Scriptable {
81  Q_OBJECT
82  Q_PROPERTY(glm::vec3 UNIT_X READ UNIT_X CONSTANT)
83  Q_PROPERTY(glm::vec3 UNIT_Y READ UNIT_Y CONSTANT)
84  Q_PROPERTY(glm::vec3 UNIT_Z READ UNIT_Z CONSTANT)
85  Q_PROPERTY(glm::vec3 UNIT_NEG_X READ UNIT_NEG_X CONSTANT)
86  Q_PROPERTY(glm::vec3 UNIT_NEG_Y READ UNIT_NEG_Y CONSTANT)
87  Q_PROPERTY(glm::vec3 UNIT_NEG_Z READ UNIT_NEG_Z CONSTANT)
88  Q_PROPERTY(glm::vec3 UNIT_XY READ UNIT_XY CONSTANT)
89  Q_PROPERTY(glm::vec3 UNIT_XZ READ UNIT_XZ CONSTANT)
90  Q_PROPERTY(glm::vec3 UNIT_YZ READ UNIT_YZ CONSTANT)
91  Q_PROPERTY(glm::vec3 UNIT_XYZ READ UNIT_XYZ CONSTANT)
92  Q_PROPERTY(glm::vec3 FLOAT_MAX READ FLOAT_MAX CONSTANT)
93  Q_PROPERTY(glm::vec3 FLOAT_MIN READ FLOAT_MIN CONSTANT)
94  Q_PROPERTY(glm::vec3 ZERO READ ZERO CONSTANT)
95  Q_PROPERTY(glm::vec3 ONE READ ONE CONSTANT)
96  Q_PROPERTY(glm::vec3 TWO READ TWO CONSTANT)
97  Q_PROPERTY(glm::vec3 HALF READ HALF CONSTANT)
98  Q_PROPERTY(glm::vec3 RIGHT READ RIGHT CONSTANT)
99  Q_PROPERTY(glm::vec3 UP READ UP CONSTANT)
100  Q_PROPERTY(glm::vec3 FRONT READ FRONT CONSTANT)
101 
102 public slots:
103 
104  /*@jsdoc
105  * Calculates the reflection of a vector in a plane.
106  * @function Vec3(0).reflect
107  * @param {Vec3} v - The vector to reflect.
108  * @param {Vec3} normal - The normal of the plane.
109  * @returns {Vec3} The vector reflected in the plane given by the normal.
110  * @example <caption>Reflect a vector in the x-z plane.</caption>
111  * var v = { x: 1, y: 2, z: 3 };
112  * var normal = Vec3.UNIT_Y;
113  * var reflected = Vec3.reflect(v, normal);
114  * print(JSON.stringify(reflected)); // {"x":1,"y":-2,"z":3}
115  */
116  glm::vec3 reflect(const glm::vec3& v1, const glm::vec3& v2) { return glm::reflect(v1, v2); }
117 
118  /*@jsdoc
119  * Calculates the cross product of two vectors.
120  * @function Vec3(0).cross
121  * @param {Vec3} v1 - The first vector.
122  * @param {Vec3} v2 - The second vector.
123  * @returns {Vec3} The cross product of <code>v1</code> and <code>v2</code>.
124  * @example <caption>The cross product of x and y unit vectors is the z unit vector.</caption>
125  * var v1 = { x: 1, y: 0, z: 0 };
126  * var v2 = { x: 0, y: 1, z: 0 };
127  * var crossProduct = Vec3.cross(v1, v2);
128  * print(JSON.stringify(crossProduct)); // {"x":0,"y":0,"z":1}
129  */
130  glm::vec3 cross(const glm::vec3& v1, const glm::vec3& v2) { return glm::cross(v1, v2); }
131 
132  /*@jsdoc
133  * Calculates the dot product of two vectors.
134  * @function Vec3(0).dot
135  * @param {Vec3} v1 - The first vector.
136  * @param {Vec3} v2 - The second vector.
137  * @returns {number} The dot product of <code>v1</code> and <code>v2</code>.
138  * @example <caption>The dot product of vectors at right angles is <code>0</code>.</caption>
139  * var v1 = { x: 1, y: 0, z: 0 };
140  * var v2 = { x: 0, y: 1, z: 0 };
141  * var dotProduct = Vec3.dot(v1, v2);
142  * print(dotProduct); // 0
143  */
144  float dot(const glm::vec3& v1, const glm::vec3& v2) { return glm::dot(v1, v2); }
145 
146  /*@jsdoc
147  * Multiplies a vector by a scale factor.
148  * @function Vec3(0).multiply
149  * @param {Vec3} v - The vector.
150  * @param {number} scale - The scale factor.
151  * @returns {Vec3} The vector with each ordinate value multiplied by the <code>scale</code>.
152  */
153  glm::vec3 multiply(const glm::vec3& v1, float f) { return v1 * f; }
154 
155  /*@jsdoc
156  * Multiplies a vector by a scale factor.
157  * @function Vec3(0).multiply
158  * @param {number} scale - The scale factor.
159  * @param {Vec3} v - The vector.
160  * @returns {Vec3} The vector with each ordinate value multiplied by the <code>scale</code>.
161  */
162  glm::vec3 multiply(float f, const glm::vec3& v1) { return v1 * f; }
163 
164  /*@jsdoc
165  * Multiplies two vectors.
166  * @function Vec3(0).multiplyVbyV
167  * @param {Vec3} v1 - The first vector.
168  * @param {Vec3} v2 - The second vector.
169  * @returns {Vec3} A vector formed by multiplying the ordinates of two vectors: <code>{ x: v1.x * v2.x, y: v1.y * v2.y,
170  * z: v1.z * v2.z }</code>.
171  * @example <caption>Multiply two vectors.</caption>
172  * var v1 = { x: 1, y: 2, z: 3 };
173  * var v2 = { x: 1, y: 2, z: 3 };
174  * var multiplied = Vec3.multiplyVbyV(v1, v2);
175  * print(JSON.stringify(multiplied)); // {"x":1,"y":4,"z":9}
176  */
177  glm::vec3 multiplyVbyV(const glm::vec3& v1, const glm::vec3& v2) { return v1 * v2; }
178 
179  /*@jsdoc
180  * Rotates a vector.
181  * @function Vec3(0).multiplyQbyV
182  * @param {Quat} q - The rotation to apply.
183  * @param {Vec3} v - The vector to rotate.
184  * @returns {Vec3} <code>v</code> rotated by <code>q</code>.
185  * @example <caption>Rotate the negative z-axis by 90 degrees about the x-axis.</caption>
186  * var v = Vec3.UNIT_NEG_Z;
187  * var q = Quat.fromPitchYawRollDegrees(90, 0, 0);
188  * var result = Vec3.multiplyQbyV(q, v);
189  * print(JSON.stringify(result)); // {"x":0,"y":1.000,"z":1.19e-7}
190  */
191  glm::vec3 multiplyQbyV(const glm::quat& q, const glm::vec3& v) { return q * v; }
192 
193  /*@jsdoc
194  * Calculates the sum of two vectors.
195  * @function Vec3(0).sum
196  * @param {Vec3} v1 - The first vector.
197  * @param {Vec3} v2 - The second vector.
198  * @returns {Vec3} The sum of the two vectors.
199  */
200  glm::vec3 sum(const glm::vec3& v1, const glm::vec3& v2) { return v1 + v2; }
201 
202  /*@jsdoc
203  * Calculates one vector subtracted from another.
204  * @function Vec3(0).subtract
205  * @param {Vec3} v1 - The first vector.
206  * @param {Vec3} v2 - The second vector.
207  * @returns {Vec3} The second vector subtracted from the first.
208  */
209  glm::vec3 subtract(const glm::vec3& v1, const glm::vec3& v2) { return v1 - v2; }
210 
211  /*@jsdoc
212  * Calculates the length of a vector
213  * @function Vec3(0).length
214  * @param {Vec3} v - The vector.
215  * @returns {number} The length of the vector.
216  */
217  float length(const glm::vec3& v) { return glm::length(v); }
218 
219  /*@jsdoc
220  * Calculates the distance between two points.
221  * @function Vec3(0).distance
222  * @param {Vec3} p1 - The first point.
223  * @param {Vec3} p2 - The second point.
224  * @returns {number} The distance between the two points.
225  * @example <caption>The distance between two points is aways positive.</caption>
226  * var p1 = { x: 0, y: 0, z: 0 };
227  * var p2 = { x: 0, y: 0, z: 10 };
228  * var distance = Vec3.distance(p1, p2);
229  * print(distance); // 10
230  *
231  * p2 = { x: 0, y: 0, z: -10 };
232  * distance = Vec3.distance(p1, p2);
233  * print(distance); // 10
234  */
235  float distance(const glm::vec3& v1, const glm::vec3& v2) { return glm::distance(v1, v2); }
236 
237  /*@jsdoc
238  * Calculates the angle of rotation from one vector onto another, with the sign depending on a reference vector.
239  * @function Vec3(0).orientedAngle
240  * @param {Vec3} v1 - The first vector.
241  * @param {Vec3} v2 - The second vector.
242  * @param {Vec3} ref - Reference vector.
243  * @returns {number} The angle of rotation from the first vector to the second, in degrees. The value is positive if the
244  * rotation axis aligns with the reference vector (has a positive dot product), otherwise the value is negative.
245  * @example <caption>Compare <code>Vec3.getAngle()</code> and <code>Vec3.orientedAngle()</code>.</caption>
246  * var v1 = { x: 5, y: 0, z: 0 };
247  * var v2 = { x: 5, y: 0, z: 5 };
248  *
249  * var angle = Vec3.getAngle(v1, v2);
250  * print(angle * 180 / Math.PI); // 45
251  *
252  * print(Vec3.orientedAngle(v1, v2, Vec3.UNIT_Y)); // -45
253  * print(Vec3.orientedAngle(v1, v2, Vec3.UNIT_NEG_Y)); // 45
254  * print(Vec3.orientedAngle(v1, v2, { x: 1, y: 2, z: -1 })); // -45
255  * print(Vec3.orientedAngle(v1, v2, { x: 1, y: -2, z: -1 })); // 45
256  */
257  float orientedAngle(const glm::vec3& v1, const glm::vec3& v2, const glm::vec3& v3);
258 
259  /*@jsdoc
260  * Normalizes a vector so that its length is <code>1</code>.
261  * @function Vec3(0).normalize
262  * @param {Vec3} v - The vector to normalize.
263  * @returns {Vec3} The vector normalized to have a length of <code>1</code>.
264  * @example <caption>Normalize a vector.</caption>
265  * var v = { x: 10, y: 10, z: 0 };
266  * var normalized = Vec3.normalize(v);
267  * print(JSON.stringify(normalized)); // {"x":0.7071,"y":0.7071,"z":0}
268  * print(Vec3.length(normalized)); // 1
269  */
270  glm::vec3 normalize(const glm::vec3& v) { return glm::normalize(v); };
271 
272  /*@jsdoc
273  * Calculates a linear interpolation between two vectors.
274  * @function Vec3(0).mix
275  * @param {Vec3} v1 - The first vector.
276  * @param {Vec3} v2 - The second vector.
277  * @param {number} factor - The interpolation factor, range <code>0.0</code> &ndash; <code>1.0</code>.
278  * @returns {Vec3} The linear interpolation between the two vectors: <code>(1 - factor) * v1 + factor * v2</code>.
279  * @example <caption>Linear interpolation between two vectors.</caption>
280  * var v1 = { x: 10, y: 0, z: 0 };
281  * var v2 = { x: 0, y: 10, z: 0 };
282  * var interpolated = Vec3.mix(v1, v2, 0.75); // 1/4 of v1 and 3/4 of v2.
283  * print(JSON.stringify(interpolated)); // {"x":2.5,"y":7.5","z":0}
284  */
285  glm::vec3 mix(const glm::vec3& v1, const glm::vec3& v2, float m) { return glm::mix(v1, v2, m); }
286 
287  /*@jsdoc
288  * Prints the vector to the program log, as a text label followed by the vector value.
289  * @function Vec3(0).print
290  * @param {string} label - The label to print.
291  * @param {Vec3} v - The vector value to print.
292  * @example <caption>Two ways of printing a label and vector value.</caption>
293  * var v = { x: 1, y: 2, z: 3 };
294  * Vec3.print("Vector: ", v); // dvec3(1.000000, 2.000000, 3.000000)
295  * print("Vector: " + JSON.stringify(v)); // {"x":1,"y":2,"z":3}
296  */
297  void print(const QString& label, const glm::vec3& v);
298 
299  /*@jsdoc
300  * Tests whether two vectors are equal.
301  * <p><strong>Note:</strong> The vectors must be exactly equal in order for <code>true</code> to be returned; it is often
302  * better to use {@link Vec3(0).withinEpsilon|withinEpsilon}.</p>
303  * @function Vec3(0).equal
304  * @param {Vec3} v1 - The first vector.
305  * @param {Vec3} v2 - The second vector.
306  * @returns {boolean} <code>true</code> if the two vectors are exactly equal, otherwise <code>false</code>.
307  * @example <caption> Vectors are only equal if exactly the same.</caption>
308  * var v1 = { x: 10, y: 10, z: 10 };
309  * var v2 = { x: 10, y: 10, z: 10 };
310  *
311  * var equal = Vec3.equal(v1, v2);
312  * print(equal); // true
313  *
314  * v2 = { x: 10, y: 10, z: 10.0005 };
315  * equal = Vec3.equal(v1, v2);
316  * print(equal); // false
317  */
318  bool equal(const glm::vec3& v1, const glm::vec3& v2) { return v1 == v2; }
319 
320  /*@jsdoc
321  * Tests whether two vectors are equal within a tolerance.
322  * <p><strong>Note:</strong> It is often better to use this function than {@link Vec3(0).equal|equal}.</p>
323  * @function Vec3(0).withinEpsilon
324  * @param {Vec3} v1 - The first vector.
325  * @param {Vec3} v2 - The second vector.
326  * @param {number} epsilon - The maximum distance between the two vectors.
327  * @returns {boolean} <code>true</code> if the distance between the points represented by the vectors is less than or equal
328  * to <code>epsilon</code>, otherwise <code>false</code>.
329  * @example <caption>Testing vectors for near equality.</caption>
330  * var v1 = { x: 10, y: 10, z: 10 };
331  * var v2 = { x: 10, y: 10, z: 10.0005 };
332  *
333  * var equal = Vec3.equal(v1, v2);
334  * print(equal); // false
335  *
336  * equal = Vec3.withinEpsilon(v1, v2, 0.001);
337  * print(equal); // true
338  */
339  bool withinEpsilon(const glm::vec3& v1, const glm::vec3& v2, float epsilon);
340 
341  /*@jsdoc
342  * Calculates polar coordinates (elevation, azimuth, radius) that transform the unit z-axis vector onto a point.
343  * @function Vec3(0).toPolar
344  * @param {Vec3} p - The point to calculate the polar coordinates for.
345  * @returns {Vec3} Vector of polar coordinates for the point: <code>x</code> elevation rotation about the x-axis in
346  * radians, <code>y</code> azimuth rotation about the y-axis in radians, and <code>z</code> radius.
347  * @example <caption>Polar coordinates for a point.</caption>
348  * var v = { x: 5, y: 2.5, z: 5 };
349  * var polar = Vec3.toPolar(v);
350  * print("Elevation: " + polar.x * 180 / Math.PI); // -19.471
351  * print("Azimuth: " + polar.y * 180 / Math.PI); // 45
352  * print("Radius: " + polar.z); // 7.5
353  */
354  // FIXME misnamed, should be 'spherical' or 'euler' depending on the implementation
355  glm::vec3 toPolar(const glm::vec3& v);
356 
357  /*@jsdoc
358  * Calculates the coordinates of a point from polar coordinate transformation of the unit z-axis vector.
359  * @function Vec3(0).fromPolar
360  * @param {Vec3} polar - The polar coordinates of a point: <code>x</code> elevation rotation about the x-axis in radians,
361  * <code>y</code> azimuth rotation about the y-axis in radians, and <code>z</code> radius.
362  * @returns {Vec3} The coordinates of the point.
363  * @example <caption>Polar coordinates to Cartesian.</caption>
364  * var polar = { x: -19.471 * Math.PI / 180, y: 45 * Math.PI / 180, z: 7.5 };
365  * var p = Vec3.fromPolar(polar);
366  * print(JSON.stringify(p)); // {"x":5,"y":2.5,"z":5}
367  */
368  // FIXME misnamed, should be 'spherical' or 'euler' depending on the implementation
369  glm::vec3 fromPolar(const glm::vec3& polar);
370 
371  /*@jsdoc
372  * Calculates the unit vector corresponding to polar coordinates elevation and azimuth transformation of the unit z-axis
373  * vector.
374  * @function Vec3(0).fromPolar
375  * @param {number} elevation - Rotation about the x-axis, in radians.
376  * @param {number} azimuth - Rotation about the y-axis, in radians.
377  * @returns {Vec3} Unit vector for the direction specified by <code>elevation</code> and <code>azimuth</code>.
378  * @example <caption>Polar coordinates to Cartesian coordinates.</caption>
379  * var elevation = -19.471 * Math.PI / 180;
380  * var rotation = 45 * Math.PI / 180;
381  * var p = Vec3.fromPolar(elevation, rotation);
382  * print(JSON.stringify(p)); // {"x":0.667,"y":0.333,"z":0.667}
383  * p = Vec3.multiply(7.5, p);
384  * print(JSON.stringify(p)); // {"x":5,"y":2.5,"z":5}
385  */
386  // FIXME misnamed, should be 'spherical' or 'euler' depending on the implementation
387  glm::vec3 fromPolar(float elevation, float azimuth);
388 
389  /*@jsdoc
390  * Calculates the angle between two vectors.
391  * @function Vec3(0).getAngle
392  * @param {Vec3} v1 - The first vector.
393  * @param {Vec3} v2 - The second vector.
394  * @returns {number} The angle between the two vectors, in radians.
395  * @example <caption>Calculate the angle between two vectors.</caption>
396  * var v1 = { x: 10, y: 0, z: 0 };
397  * var v2 = { x: 0, y: 0, z: 10 };
398  * var angle = Vec3.getAngle(v1, v2);
399  * print(angle * 180 / Math.PI); // 90
400  */
401  float getAngle(const glm::vec3& v1, const glm::vec3& v2);
402 
403 private:
404  const glm::vec3& UNIT_X() { return Vectors::UNIT_X; }
405  const glm::vec3& UNIT_Y() { return Vectors::UNIT_Y; }
406  const glm::vec3& UNIT_Z() { return Vectors::UNIT_Z; }
407  const glm::vec3& UNIT_NEG_X() { return Vectors::UNIT_NEG_X; }
408  const glm::vec3& UNIT_NEG_Y() { return Vectors::UNIT_NEG_Y; }
409  const glm::vec3& UNIT_NEG_Z() { return Vectors::UNIT_NEG_Z; }
410  const glm::vec3& UNIT_XY() { return Vectors::UNIT_XY; }
411  const glm::vec3& UNIT_XZ() { return Vectors::UNIT_XZ; }
412  const glm::vec3& UNIT_YZ() { return Vectors::UNIT_YZ; }
413  const glm::vec3& UNIT_XYZ() { return Vectors::UNIT_XYZ; }
414  const glm::vec3& FLOAT_MAX() { return Vectors::MAX; }
415  const glm::vec3& FLOAT_MIN() { return Vectors::MIN; }
416  const glm::vec3& ZERO() { return Vectors::ZERO; }
417  const glm::vec3& ONE() { return Vectors::ONE; }
418  const glm::vec3& TWO() { return Vectors::TWO; }
419  const glm::vec3& HALF() { return Vectors::HALF; }
420  const glm::vec3& RIGHT() { return Vectors::RIGHT; }
421  const glm::vec3& UP() { return Vectors::UP; }
422  const glm::vec3& FRONT() { return Vectors::FRONT; }
423 
424 public:
425  virtual ~Vec3();
426 };
427 
428 #endif // hifi_Vec3_h
429 
[ScriptInterface] Provides an engine-independent interface for QScriptable
Definition: Scriptable.h:29
Provides the Vec3 scripting interface.
Definition: Vec3.h:80