History

Model API JSDoc

David Rowe committed 6 years ago

Commit 1ebc6a51 parent bdce8132 files · +65 −0Browse files

Showing the changes to libraries/script-engine/src/ModelScriptingInterface.h (1 of 2 files). Show all

Unified · Split

libraries/script-engine/src/ModelScriptingInterface.h+60−0
@@ -17,19 +17,79 @@ · 16 unmodified lines
1717 #include <RegisteredMetaTypes.h>
1818 class QScriptEngine;
1919
20+/**jsdoc
21+ * The <code>Model</code> API provides the ability to manipulate meshes. You can get the meshes for an entity using
22+ * {@link Entities.getMeshes}, or create a new mesh using {@link Model.newMesh}.
23+ * <p>See also, the {@link Graphics} API.</p>
24+ *
25+ * @namespace Model
26+ *
27+ * @hifi-interface
28+ * @hifi-client-entity
29+ * @hifi-avatar
30+ * @hifi-server-entity
31+ * @hifi-assignment-client
32+ *
33+ * @deprecated This API is deprecated. Use the {@link Graphics} API instead.
34+ */
2035 class ModelScriptingInterface : public QObject {
2136 Q_OBJECT
2237
2338 public:
2439 ModelScriptingInterface(QObject* parent);
2540
41+ /**jsdoc
42+ * Exports meshes to an OBJ format model.
43+ * @function Model.meshToOBJ
44+ * @param {MeshProxy[]} meshes - The meshes to export.
45+ * @returns {string} The OBJ format representation of the meshes.
46+ */
2647 Q_INVOKABLE QString meshToOBJ(MeshProxyList in);
48+
49+ /**jsdoc
50+ * Combines multiple meshes into one.
51+ * @function Model.appendMeshes
52+ * @param {MeshProxy[]} meshes - The meshes to combine.
53+ * @returns {MeshProxy} The combined mesh.
54+ */
2755 Q_INVOKABLE QScriptValue appendMeshes(MeshProxyList in);
56+
57+ /**jsdoc
58+ * Transforms the vertices in a mesh.
59+ * @function Model.transformMesh
60+ * @param {Mat4} transform - The transform to apply.
61+ * @param {MeshProxy} mesh - The mesh to apply the transform to.
62+ * @returns {MeshProxy|boolean} The transformed mesh, if valid. <code>false</code> if an error.
63+ */
2864 Q_INVOKABLE QScriptValue transformMesh(glm::mat4 transform, MeshProxy* meshProxy);
65+
66+ /**jsdoc
67+ * Creates a new mesh.
68+ * @function Model.newMesh
69+ * @param {Vec3[]} vertices - The vertices in the mesh.
70+ * @param {Vec3[]} normals - The normals in the mesh.
71+ * @param {MeshFace[]} faces - The faces in the mesh.
72+ * @returns {MeshProxy} A new mesh.
73+ */
2974 Q_INVOKABLE QScriptValue newMesh(const QVector<glm::vec3>& vertices,
3075 const QVector<glm::vec3>& normals,
3176 const QVector<MeshFace>& faces);
77+
78+ /**jsdoc
79+ * Gets the number of vertices in a mesh.
80+ * @function Model.getVertexCount
81+ * @param {MeshProxy} mesh - The mesh to count the vertices in.
82+ * @returns {number|boolean} The number of vertices in the mesh, if valid. <code>false</code> if an error.
83+ */
3284 Q_INVOKABLE QScriptValue getVertexCount(MeshProxy* meshProxy);
85+
86+ /**jsdoc
87+ * Gets the position of a vertex in a mesh.
88+ * @function Model.getVertex
89+ * @param {MeshProxy} mesh - The mesh.
90+ * @param {number} index - The index of the vertex to get.
91+ * @returns {Vec3|boolean} The local position of the vertex relative to the mesh, if valid. <code>false</code> if an error.
92+ */
3393 Q_INVOKABLE QScriptValue getVertex(MeshProxy* meshProxy, int vertexIndex);
3494
3595 private:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t