PickRay JSDoc

This commit is contained in:
David Rowe 2017-11-12 13:50:07 +13:00
parent e4daaa8d67
commit dba16c265c
2 changed files with 12 additions and 3 deletions

View file

@ -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) { }

View file

@ -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);