EntityViewer JSDoc

This commit is contained in:
David Rowe 2019-09-26 10:48:08 +12:00
parent 7d7024f5eb
commit 0cafae2422
2 changed files with 30 additions and 13 deletions

View file

@ -24,6 +24,9 @@
class EntitySimulation; class EntitySimulation;
/**jsdoc /**jsdoc
* The <code>EntityViewer</code> API provides a headless viewer for assignment client scripts, so that they can "see" entities
* in order for them to be available in the {@link Entities} API.
*
* @namespace EntityViewer * @namespace EntityViewer
* *
* @hifi-assignment-client * @hifi-assignment-client

View file

@ -28,6 +28,7 @@ public:
public slots: public slots:
/**jsdoc /**jsdoc
* Updates the entities currently in view.
* @function EntityViewer.queryOctree * @function EntityViewer.queryOctree
*/ */
void queryOctree(); void queryOctree();
@ -36,26 +37,30 @@ public slots:
// setters for camera attributes // setters for camera attributes
/**jsdoc /**jsdoc
* Sets the position of the view frustum.
* @function EntityViewer.setPosition * @function EntityViewer.setPosition
* @param {Vec3} position * @param {Vec3} position - The position of the view frustum.
*/ */
void setPosition(const glm::vec3& position) { _hasViewFrustum = true; _viewFrustum.setPosition(position); } void setPosition(const glm::vec3& position) { _hasViewFrustum = true; _viewFrustum.setPosition(position); }
/**jsdoc /**jsdoc
* Sets the orientation of the view frustum.
* @function EntityViewer.setOrientation * @function EntityViewer.setOrientation
* @param {Quat} orientation * @param {Quat} orientation - The orientation of the view frustum.
*/ */
void setOrientation(const glm::quat& orientation) { _hasViewFrustum = true; _viewFrustum.setOrientation(orientation); } void setOrientation(const glm::quat& orientation) { _hasViewFrustum = true; _viewFrustum.setOrientation(orientation); }
/**jsdoc /**jsdoc
* Sets the radius of the center "keyhole" in the view frustum.
* @function EntityViewer.setCenterRadius * @function EntityViewer.setCenterRadius
* @param {number} radius * @param {number} radius - The radius of the center "keyhole" in the view frustum.
*/ */
void setCenterRadius(float radius) { _hasViewFrustum = true; _viewFrustum.setCenterRadius(radius); } void setCenterRadius(float radius) { _hasViewFrustum = true; _viewFrustum.setCenterRadius(radius); }
/**jsdoc /**jsdoc
* Sets the radius of the center "keyhole" in the view frustum.
* @function EntityViewer.setKeyholeRadius * @function EntityViewer.setKeyholeRadius
* @param {number} radius * @param {number} radius - The radius of the center "keyhole" in the view frustum.
* @deprecated This function is deprecated and will be removed. Use {@link EntityViewer.setCenterRadius|setCenterRadius} * @deprecated This function is deprecated and will be removed. Use {@link EntityViewer.setCenterRadius|setCenterRadius}
* instead. * instead.
*/ */
@ -66,33 +71,38 @@ public slots:
/**jsdoc /**jsdoc
* @function EntityViewer.setVoxelSizeScale * @function EntityViewer.setVoxelSizeScale
* @param {number} sizeScale * @param {number} sizeScale - The voxel size scale.
* @deprecated This function is deprecated and will be removed.
*/ */
void setVoxelSizeScale(float sizeScale) { _octreeQuery.setOctreeSizeScale(sizeScale) ; } void setVoxelSizeScale(float sizeScale) { _octreeQuery.setOctreeSizeScale(sizeScale) ; }
/**jsdoc /**jsdoc
* @function EntityViewer.setBoundaryLevelAdjust * @function EntityViewer.setBoundaryLevelAdjust
* @param {number} boundaryLevelAdjust * @param {number} boundaryLevelAdjust - The boundary level adjust factor.
* @deprecated This function is deprecated and will be removed.
*/ */
void setBoundaryLevelAdjust(int boundaryLevelAdjust) { _octreeQuery.setBoundaryLevelAdjust(boundaryLevelAdjust); } void setBoundaryLevelAdjust(int boundaryLevelAdjust) { _octreeQuery.setBoundaryLevelAdjust(boundaryLevelAdjust); }
/**jsdoc /**jsdoc
* Sets the maximum number of entity packets to receive from the domain server per second.
* @function EntityViewer.setMaxPacketsPerSecond * @function EntityViewer.setMaxPacketsPerSecond
* @param {number} maxPacketsPerSecond * @param {number} maxPacketsPerSecond - The maximum number of entity packets to receive per second.
*/ */
void setMaxPacketsPerSecond(int maxPacketsPerSecond) { _octreeQuery.setMaxQueryPacketsPerSecond(maxPacketsPerSecond); } void setMaxPacketsPerSecond(int maxPacketsPerSecond) { _octreeQuery.setMaxQueryPacketsPerSecond(maxPacketsPerSecond); }
// getters for camera attributes // getters for camera attributes
/**jsdoc /**jsdoc
* Gets the position of the view frustum.
* @function EntityViewer.getPosition * @function EntityViewer.getPosition
* @returns {Vec3} * @returns {Vec3} The position of the view frustum.
*/ */
const glm::vec3& getPosition() const { return _viewFrustum.getPosition(); } const glm::vec3& getPosition() const { return _viewFrustum.getPosition(); }
/**jsdoc /**jsdoc
* Gets the orientation of the view frustum.
* @function EntityViewer.getOrientation * @function EntityViewer.getOrientation
* @returns {Quat} * @returns {Quat} The orientation of the view frustum.
*/ */
const glm::quat& getOrientation() const { return _viewFrustum.getOrientation(); } const glm::quat& getOrientation() const { return _viewFrustum.getOrientation(); }
@ -101,26 +111,30 @@ public slots:
/**jsdoc /**jsdoc
* @function EntityViewer.getVoxelSizeScale * @function EntityViewer.getVoxelSizeScale
* @returns {number} * @returns {number} The voxel size scale.
* @deprecated This function is deprecated and will be removed.
*/ */
float getVoxelSizeScale() const { return _octreeQuery.getOctreeSizeScale(); } float getVoxelSizeScale() const { return _octreeQuery.getOctreeSizeScale(); }
/**jsdoc /**jsdoc
* @function EntityViewer.getBoundaryLevelAdjust * @function EntityViewer.getBoundaryLevelAdjust
* @returns {number} * @returns {number} The boundary level adjust factor.
* @deprecated This function is deprecated and will be removed.
*/ */
int getBoundaryLevelAdjust() const { return _octreeQuery.getBoundaryLevelAdjust(); } int getBoundaryLevelAdjust() const { return _octreeQuery.getBoundaryLevelAdjust(); }
/**jsdoc /**jsdoc
* Gets the maximum number of entity packets to receive from the domain server per second.
* @function EntityViewer.getMaxPacketsPerSecond * @function EntityViewer.getMaxPacketsPerSecond
* @returns {number} * @returns {number} The maximum number of entity packets to receive per second.
*/ */
int getMaxPacketsPerSecond() const { return _octreeQuery.getMaxQueryPacketsPerSecond(); } int getMaxPacketsPerSecond() const { return _octreeQuery.getMaxQueryPacketsPerSecond(); }
/**jsdoc /**jsdoc
* Gets the number of nodes in the octree.
* @function EntityViewer.getOctreeElementsCount * @function EntityViewer.getOctreeElementsCount
* @returns {number} * @returns {number} The number of nodes in the octree.
*/ */
unsigned getOctreeElementsCount() const { return _tree->getOctreeElementsCount(); } unsigned getOctreeElementsCount() const { return _tree->getOctreeElementsCount(); }