From 32b14ab0bd360685ec7543bd6361ed5a4e77b407 Mon Sep 17 00:00:00 2001 From: Vaios Kalpias-Ilias Date: Thu, 2 Jul 2015 18:48:52 +0300 Subject: [PATCH] Changed priority of various method docs that take numbers over versions that take pc.Vec3's --- .../components/physics/rigidbody_component.js | 72 +++++------ src/scene/scene_graphnode.js | 112 +++++++++--------- 2 files changed, 92 insertions(+), 92 deletions(-) diff --git a/src/framework/components/physics/rigidbody_component.js b/src/framework/components/physics/rigidbody_component.js index f1e0d919153..df97599e526 100644 --- a/src/framework/components/physics/rigidbody_component.js +++ b/src/framework/components/physics/rigidbody_component.js @@ -264,6 +264,25 @@ pc.extend(pc, function () { * @description Apply an force to the body at a point. By default, the force is applied at the origin of the * body. However, the force can be applied at an offset this point by specifying a world space vector from * the body's origin to the point of application. + * @param {Number} x The x component of the force to apply, in world space. + * @param {Number} y The y component of the force to apply, in world space. + * @param {Number} z The z component of the force to apply, in world space. + * @param {Number} [px] The x component of a world space offset from the body's position where the force is applied. + * @param {Number} [py] The y component of a world space offset from the body's position where the force is applied. + * @param {Number} [pz] The z component of a world space offset from the body's position where the force is applied. + * @example + * // EXAMPLE 1: Apply an approximation of gravity at the body's center + * this.entity.rigidbody.applyForce(0, -10, 0); + * + * // EXAMPLE 2: Apply an approximation of gravity at 1 unit down the world Z from the center of the body + * this.entity.rigidbody.applyForce(0, -10, 0, 0, 0, 1); + */ + /** + * @function + * @name pc.RigidBodyComponent#applyForce^2 + * @description Apply an force to the body at a point. By default, the force is applied at the origin of the + * body. However, the force can be applied at an offset this point by specifying a world space vector from + * the body's origin to the point of application. * @param {pc.Vec3} force The force to apply, in world space. * @param {pc.Vec3} [relativePoint] A world space offset from the body's position where the force is applied. * @example @@ -286,25 +305,6 @@ pc.extend(pc, function () { * // Apply the force * this.entity.rigidbody.applyForce(force, relativePos); */ - /** - * @function - * @name pc.RigidBodyComponent#applyForce^2 - * @description Apply an force to the body at a point. By default, the force is applied at the origin of the - * body. However, the force can be applied at an offset this point by specifying a world space vector from - * the body's origin to the point of application. - * @param {Number} x The x component of the force to apply, in world space. - * @param {Number} y The y component of the force to apply, in world space. - * @param {Number} z The z component of the force to apply, in world space. - * @param {Number} [px] The x component of a world space offset from the body's position where the force is applied. - * @param {Number} [py] The y component of a world space offset from the body's position where the force is applied. - * @param {Number} [pz] The z component of a world space offset from the body's position where the force is applied. - * @example - * // EXAMPLE 1: Apply an approximation of gravity at the body's center - * this.entity.rigidbody.applyForce(0, -10, 0); - * - * // EXAMPLE 2: Apply an approximation of gravity at 1 unit down the world Z from the center of the body - * this.entity.rigidbody.applyForce(0, -10, 0, 0, 0, 1); - */ applyForce: function () { var x, y, z; var px,py,pz; @@ -354,15 +354,15 @@ pc.extend(pc, function () { * @function * @name pc.RigidBodyComponent#applyTorque * @description Apply torque (rotational force) to the body. - * @param {pc.Vec3} force The torque to apply, in world space. + * @param {Number} x The x component of the torque to apply, in world space. + * @param {Number} y The y component of the torque to apply, in world space. + * @param {Number} z The z component of the torque to apply, in world space. */ /** * @function * @name pc.RigidBodyComponent#applyTorque^2 * @description Apply torque (rotational force) to the body. - * @param {Number} x The x component of the torque to apply, in world space. - * @param {Number} y The y component of the torque to apply, in world space. - * @param {Number} z The z component of the torque to apply, in world space. + * @param {pc.Vec3} force The torque to apply, in world space. */ applyTorque: function () { var x, y, z; @@ -393,13 +393,6 @@ pc.extend(pc, function () { * @function * @name pc.RigidBodyComponent#applyImpulse * @description Apply an impulse (instantaneous change of velocity) to the body at a point. - * @param {pc.Vec3} impulse The impulse to apply, in world space. - * @param {pc.Vec3} [relativePoint] The point at which to apply the impulse, in local space (relative to the entity). - */ - /** - * @function - * @name pc.RigidBodyComponent#applyImpulse^2 - * @description Apply an impulse (instantaneous change of velocity) to the body at a point. * @param {Number} x The x component of the impulse to apply, in world space. * @param {Number} y The y component of the impulse to apply, in world space. * @param {Number} z The z component of the impulse to apply, in world space. @@ -407,6 +400,13 @@ pc.extend(pc, function () { * @param {Number} [py] The y component of the point at which to apply the impulse, in local space (relative to the Entity). * @param {Number} [pz] The z component of the point at which to apply the impulse, in local space (relative to the Entity). */ + /** + * @function + * @name pc.RigidBodyComponent#applyImpulse^2 + * @description Apply an impulse (instantaneous change of velocity) to the body at a point. + * @param {pc.Vec3} impulse The impulse to apply, in world space. + * @param {pc.Vec3} [relativePoint] The point at which to apply the impulse, in local space (relative to the entity). + */ applyImpulse: function () { var x, y, z; var px,py,pz; @@ -455,16 +455,16 @@ pc.extend(pc, function () { * @function * @name pc.RigidBodyComponent#applyTorqueImpulse * @description Apply a torque impulse (rotational force applied instantaneously) to the body. - * @param {pc.Vec3} torqueImpulse The torque impulse to apply, in world space. - */ - /** - * @function - * @name pc.RigidBodyComponent#applyTorqueImpulse^2 - * @description Apply a torque impulse (rotational force applied instantaneously) to the body. * @param {Number} x The x component of the torque impulse to apply, in world space. * @param {Number} y The y component of the torque impulse to apply, in world space. * @param {Number} z The z component of the torque impulse to apply, in world space. */ + /** + * @function + * @name pc.RigidBodyComponent#applyTorqueImpulse^2 + * @description Apply a torque impulse (rotational force applied instantaneously) to the body. + * @param {pc.Vec3} torqueImpulse The torque impulse to apply, in world space. + */ applyTorqueImpulse: function () { var x, y, z; switch (arguments.length) { diff --git a/src/scene/scene_graphnode.js b/src/scene/scene_graphnode.js index 7ed1cebc3da..4a97512bc7d 100644 --- a/src/scene/scene_graphnode.js +++ b/src/scene/scene_graphnode.js @@ -549,21 +549,21 @@ pc.extend(pc, function () { * @name pc.GraphNode#setLocalEulerAngles * @description Sets the local space rotation of the specified graph node using euler angles. * Eulers are interpreted in XYZ order. Eulers must be specified in degrees. - * @param {pc.Vec3} e vector containing euler angles in XYZ order. + * @param {Number} x rotation around x-axis in degrees. + * @param {Number} y rotation around y-axis in degrees. + * @param {Number} z rotation around z-axis in degrees. * @example - * var angles = new pc.Vec3(0, 90, 0); - * this.entity.setLocalEulerAngles(angles); // Set rotation of 90 degress around y-axis. + * this.entity.setLocalEulerAngles(0, 90, 0); // Set rotation of 90 degress around y-axis. */ /** * @function * @name pc.GraphNode#setLocalEulerAngles^2 * @description Sets the local space rotation of the specified graph node using euler angles. * Eulers are interpreted in XYZ order. Eulers must be specified in degrees. - * @param {Number} x rotation around x-axis in degrees. - * @param {Number} y rotation around y-axis in degrees. - * @param {Number} z rotation around z-axis in degrees. + * @param {pc.Vec3} e vector containing euler angles in XYZ order. * @example - * this.entity.setLocalEulerAngles(0, 90, 0); // Set rotation of 90 degress around y-axis. + * var angles = new pc.Vec3(0, 90, 0); + * this.entity.setLocalEulerAngles(angles); // Set rotation of 90 degress around y-axis. */ setLocalEulerAngles: function () { var ex, ey, ez; @@ -588,20 +588,20 @@ pc.extend(pc, function () { * @function * @name pc.GraphNode#setLocalPosition * @description Sets the local space position of the specified graph node. - * @param {pc.Vec3} pos position vector of graph node in local space. + * @param {Number} x x-coordinate of local-space position. + * @param {Number} y y-coordinate of local-space position. + * @param {Number} z z-coordinate of local-space position. * @example - * var pos = new pc.Vec3(0, 10, 0); - * this.entity.setLocalPosition(pos) + * this.entity.setLocalPosition(0, 10, 0); */ /** * @function * @name pc.GraphNode#setLocalPosition^2 * @description Sets the local space position of the specified graph node. - * @param {Number} x x-coordinate of local-space position. - * @param {Number} y y-coordinate of local-space position. - * @param {Number} z z-coordinate of local-space position. + * @param {pc.Vec3} pos position vector of graph node in local space. * @example - * this.entity.setLocalPosition(0, 10, 0); + * var pos = new pc.Vec3(0, 10, 0); + * this.entity.setLocalPosition(pos) */ setLocalPosition: function () { if (arguments.length === 1) { @@ -645,20 +645,20 @@ pc.extend(pc, function () { * @function * @name pc.GraphNode#setLocalScale * @description Sets the local space scale factor of the specified graph node. - * @param {pc.Vec3} scale xyz-scale of graph node in local space. + * @param {Number} x x-coordinate of local-space scale. + * @param {Number} y y-coordinate of local-space scale. + * @param {Number} z z-coordinate of local-space scale. * @example - * var scale = new pc.Vec3(10, 10, 10); - * this.entity.setLocalScale(scale); + * this.entity.setLocalScale(10, 10, 10); */ /** * @function * @name pc.GraphNode#setLocalScale^2 * @description Sets the local space scale factor of the specified graph node. - * @param {Number} x x-coordinate of local-space scale. - * @param {Number} y y-coordinate of local-space scale. - * @param {Number} z z-coordinate of local-space scale. + * @param {pc.Vec3} scale xyz-scale of graph node in local space. * @example - * this.entity.setLocalScale(10, 10, 10); + * var scale = new pc.Vec3(10, 10, 10); + * this.entity.setLocalScale(scale); */ setLocalScale: function () { if (arguments.length === 1) { @@ -770,21 +770,21 @@ pc.extend(pc, function () { * @name pc.GraphNode#setEulerAngles * @description Sets the world space orientation of the specified graph node * using Euler angles. Angles are specified in degress in XYZ order. - * @param {pc.Vec3} angles Euler angles in degrees (XYZ order). + * @param {Number} ex Rotation around world space X axis in degrees. + * @param {Number} ey Rotation around world space Y axis in degrees. + * @param {Number} ez Rotation around world space Z axis in degrees. * @example - * var angles = new pc.Vec3(0, 90, 0); - * this.entity.setEulerAngles(angles); + * this.entity.setEulerAngles(0, 90, 0); */ /** * @function * @name pc.GraphNode#setEulerAngles^2 * @description Sets the world space orientation of the specified graph node * using Euler angles. Angles are specified in degress in XYZ order. - * @param {Number} ex Rotation around world space X axis in degrees. - * @param {Number} ey Rotation around world space Y axis in degrees. - * @param {Number} ez Rotation around world space Z axis in degrees. + * @param {pc.Vec3} angles Euler angles in degrees (XYZ order). * @example - * this.entity.setEulerAngles(0, 90, 0); + * var angles = new pc.Vec3(0, 90, 0); + * this.entity.setEulerAngles(angles); */ setEulerAngles: function () { var invParentRot = new pc.Quat(); @@ -1105,20 +1105,20 @@ pc.extend(pc, function () { * @function * @name pc.GraphNode#translate * @description Translates the graph node in world space by the specified translation vector. - * @param {pc.Vec3} translation The world space translation vector to apply. + * @param {Number} x x-component of the translation vector. + * @param {Number} y y-component of the translation vector. + * @param {Number} z z-component of the translation vector. * @example - * var t = new pc.Vec3(10, 0, 0); - * this.entity.translate(t); + * this.entity.translate(10, 0, 0); */ /** * @function * @name pc.GraphNode#translate^2 * @description Translates the graph node in world space by the specified translation vector. - * @param {Number} x x-component of the translation vector. - * @param {Number} y y-component of the translation vector. - * @param {Number} z z-component of the translation vector. + * @param {pc.Vec3} translation The world space translation vector to apply. * @example - * this.entity.translate(10, 0, 0); + * var t = new pc.Vec3(10, 0, 0); + * this.entity.translate(t); */ translate: function () { var translation = new pc.Vec3(); @@ -1142,20 +1142,20 @@ pc.extend(pc, function () { * @function * @name pc.GraphNode#translateLocal * @description Translates the graph node in local space by the specified translation vector. - * @param {pc.Vec3} translation The local space translation vector to apply. + * @param {Number} x x-component of the translation vector. + * @param {Number} y y-component of the translation vector. + * @param {Number} z z-component of the translation vector. * @example - * var t = new pc.Vec3(10, 0, 0); - * this.entity.translateLocal(t); + * this.entity.translateLocal(10, 0, 0); */ /** * @function * @name pc.GraphNode#translateLocal^2 * @description Translates the graph node in local space by the specified translation vector. - * @param {Number} x x-component of the translation vector. - * @param {Number} y y-component of the translation vector. - * @param {Number} z z-component of the translation vector. + * @param {pc.Vec3} translation The local space translation vector to apply. * @example - * this.entity.translateLocal(10, 0, 0); + * var t = new pc.Vec3(10, 0, 0); + * this.entity.translateLocal(t); */ translateLocal: function () { var translation = new pc.Vec3(); @@ -1181,21 +1181,21 @@ pc.extend(pc, function () { * @name pc.GraphNode#rotate * @description Rotates the graph node in world space by the specified Euler angles. * Eulers are specified in degrees in XYZ order. - * @param {pc.Vec3} rot World space rotation (xyz) of graph node. + * @param {Number} ex Rotation around world space X axis in degrees. + * @param {Number} ey Rotation around world space Y axis in degrees. + * @param {Number} ez Rotation around world space Z axis in degrees. * @example - * var r = new pc.Vec3(0, 90, 0); - * this.entity.rotate(r); + * this.entity.rotate(0, 90, 0); */ /** * @function * @name pc.GraphNode#rotate^2 * @description Rotates the graph node in world space by the specified Euler angles. * Eulers are specified in degrees in XYZ order. - * @param {Number} ex Rotation around world space X axis in degrees. - * @param {Number} ey Rotation around world space Y axis in degrees. - * @param {Number} ez Rotation around world space Z axis in degrees. + * @param {pc.Vec3} rot World space rotation (xyz) of graph node. * @example - * this.entity.rotate(0, 90, 0); + * var r = new pc.Vec3(0, 90, 0); + * this.entity.rotate(r); */ rotate: function () { var quaternion = new pc.Quat(); @@ -1238,21 +1238,21 @@ pc.extend(pc, function () { * @name pc.GraphNode#rotateLocal * @description Rotates the graph node in local space by the specified Euler angles. * Eulers are specified in degrees in XYZ order. - * @param {pc.Vec3} rot Local space rotation (xyz) of graph node. + * @param {Number} ex Rotation around local space X axis in degrees. + * @param {Number} ey Rotation around local space Y axis in degrees. + * @param {Number} ez Rotation around local space Z axis in degrees. * @example - * var r = new pc.Vec3(0, 90, 0); - * this.entity.rotateLocal(r); + * this.entity.rotateLocal(0, 90, 0); */ /** * @function * @name pc.GraphNode#rotateLocal^2 * @description Rotates the graph node in local space by the specified Euler angles. * Eulers are specified in degrees in XYZ order. - * @param {Number} ex Rotation around local space X axis in degrees. - * @param {Number} ey Rotation around local space Y axis in degrees. - * @param {Number} ez Rotation around local space Z axis in degrees. + * @param {pc.Vec3} rot Local space rotation (xyz) of graph node. * @example - * this.entity.rotateLocal(0, 90, 0); + * var r = new pc.Vec3(0, 90, 0); + * this.entity.rotateLocal(r); */ rotateLocal: function () { var quaternion = new pc.Quat();