mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-22 13:29:40 +02:00
PickRay JSDoc
This commit is contained in:
parent
e4daaa8d67
commit
dba16c265c
2 changed files with 12 additions and 3 deletions
|
@ -125,6 +125,14 @@ QVector<QUuid> qVectorQUuidFromScriptValue(const QScriptValue& array);
|
||||||
QScriptValue aaCubeToScriptValue(QScriptEngine* engine, const AACube& aaCube);
|
QScriptValue aaCubeToScriptValue(QScriptEngine* engine, const AACube& aaCube);
|
||||||
void aaCubeFromScriptValue(const QScriptValue &object, AACube& aaCube);
|
void aaCubeFromScriptValue(const QScriptValue &object, AACube& aaCube);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* A PickRay defines a vector with a starting point. It is used, for example, when finding entities or overlays that lie under a
|
||||||
|
* mouse click or intersect a laser beam.
|
||||||
|
*
|
||||||
|
* @typedef PickRay
|
||||||
|
* @property {Vec3} origin - The starting position of the PickRay.
|
||||||
|
* @property {Quat} direction - The direction that the PickRay travels.
|
||||||
|
*/
|
||||||
class PickRay {
|
class PickRay {
|
||||||
public:
|
public:
|
||||||
PickRay() : origin(0.0f), direction(0.0f) { }
|
PickRay() : origin(0.0f), direction(0.0f) { }
|
||||||
|
|
|
@ -172,12 +172,13 @@ public slots:
|
||||||
void setOrientation(const glm::quat& orientation);
|
void setOrientation(const glm::quat& orientation);
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Compute a {PickRay} based on the current camera configuration and the specified <code>x, y</code> position on the screen.
|
* Compute a {@link PickRay} based on the current camera configuration and the specified <code>x, y</code> position on the
|
||||||
* The {PickRay} can be used in functions such as {Entities.findRayIntersection} and {Overlays.findRayIntersection}.
|
* screen. The {@link PickRay} can be used in functions such as {@link Entities.findRayIntersection} and
|
||||||
|
* {@link Overlays.findRayIntersection}.
|
||||||
* @function Camera.computePickRay
|
* @function Camera.computePickRay
|
||||||
* @param {number} x - X-coordinate on screen.
|
* @param {number} x - X-coordinate on screen.
|
||||||
* @param {number} y - Y-coordinate on screen.
|
* @param {number} y - Y-coordinate on screen.
|
||||||
* @return {PickRay} The computed {PickRay}.
|
* @return {PickRay} The computed {@link PickRay}.
|
||||||
* @example
|
* @example
|
||||||
* function onMousePressEvent(event) {
|
* function onMousePressEvent(event) {
|
||||||
* var pickRay = Camera.computePickRay(event.x, event.y);
|
* var pickRay = Camera.computePickRay(event.x, event.y);
|
||||||
|
|
Loading…
Reference in a new issue