Skip to content

Commit a492825

Browse files
yaustarsteveny-sc
andauthored
Updated docs from array format of position to vec3 (playcanvas#3332)
Co-authored-by: Steven Yau <syau@snapchat.com>
1 parent 7fcdb9c commit a492825

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/scene/graph-node.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -574,13 +574,13 @@ class GraphNode extends EventHandler {
574574
* @function
575575
* @name GraphNode#getEulerAngles
576576
* @description Get the world space rotation for the specified GraphNode in Euler angle
577-
* form. The order of the returned Euler angles is XYZ. The value returned by this function
577+
* form. The rotation is returned as euler angles in a {@link Vec3}. The value returned by this function
578578
* should be considered read-only. In order to set the world-space rotation of the graph
579579
* node, use {@link GraphNode#setEulerAngles}.
580580
* @returns {Vec3} The world space rotation of the graph node in Euler angle form.
581581
* @example
582-
* var angles = this.entity.getEulerAngles(); // [0,0,0]
583-
* angles[1] = 180; // rotate the entity around Y by 180 degrees
582+
* var angles = this.entity.getEulerAngles();
583+
* angles.y = 180; // rotate the entity around Y by 180 degrees
584584
* this.entity.setEulerAngles(angles);
585585
*/
586586
getEulerAngles() {
@@ -592,13 +592,13 @@ class GraphNode extends EventHandler {
592592
* @function
593593
* @name GraphNode#getLocalEulerAngles
594594
* @description Get the rotation in local space for the specified GraphNode. The rotation
595-
* is returned as euler angles in a 3-dimensional vector where the order is XYZ. The
595+
* is returned as euler angles in a {@link Vec3}. The
596596
* returned vector should be considered read-only. To update the local rotation, use
597597
* {@link GraphNode#setLocalEulerAngles}.
598598
* @returns {Vec3} The local space rotation of the graph node as euler angles in XYZ order.
599599
* @example
600600
* var angles = this.entity.getLocalEulerAngles();
601-
* angles[1] = 180;
601+
* angles.y = 180;
602602
* this.entity.setLocalEulerAngles(angles);
603603
*/
604604
getLocalEulerAngles() {
@@ -610,12 +610,12 @@ class GraphNode extends EventHandler {
610610
* @function
611611
* @name GraphNode#getLocalPosition
612612
* @description Get the position in local space for the specified GraphNode. The position
613-
* is returned as a 3-dimensional vector. The returned vector should be considered read-only.
613+
* is returned as a {@link Vec3}. The returned vector should be considered read-only.
614614
* To update the local position, use {@link GraphNode#setLocalPosition}.
615615
* @returns {Vec3} The local space position of the graph node.
616616
* @example
617617
* var position = this.entity.getLocalPosition();
618-
* position[0] += 1; // move the entity 1 unit along x.
618+
* position.x += 1; // move the entity 1 unit along x.
619619
* this.entity.setLocalPosition(position);
620620
*/
621621
getLocalPosition() {
@@ -626,7 +626,7 @@ class GraphNode extends EventHandler {
626626
* @function
627627
* @name GraphNode#getLocalRotation
628628
* @description Get the rotation in local space for the specified GraphNode. The rotation
629-
* is returned as a quaternion. The returned quaternion should be considered read-only.
629+
* is returned as a {@link Quat}. The returned quaternion should be considered read-only.
630630
* To update the local rotation, use {@link GraphNode#setLocalRotation}.
631631
* @returns {Quat} The local space rotation of the graph node as a quaternion.
632632
* @example
@@ -640,7 +640,7 @@ class GraphNode extends EventHandler {
640640
* @function
641641
* @name GraphNode#getLocalScale
642642
* @description Get the scale in local space for the specified GraphNode. The scale
643-
* is returned as a 3-dimensional vector. The returned vector should be considered read-only.
643+
* is returned as a {@link Vec3}. The returned vector should be considered read-only.
644644
* To update the local scale, use {@link GraphNode#setLocalScale}.
645645
* @returns {Vec3} The local space scale of the graph node.
646646
* @example
@@ -672,9 +672,9 @@ class GraphNode extends EventHandler {
672672
/**
673673
* @function
674674
* @name GraphNode#getPosition
675-
* @description Get the world space position for the specified GraphNode. The
676-
* value returned by this function should be considered read-only. In order to set
677-
* the world-space position of the graph node, use {@link GraphNode#setPosition}.
675+
* @description Get the world space position for the specified GraphNode. The position
676+
* is returned as a {@link Vec3}. The value returned by this function should be considered read-only.
677+
* In order to set the world-space position of the graph node, use {@link GraphNode#setPosition}.
678678
* @returns {Vec3} The world space position of the graph node.
679679
* @example
680680
* var position = this.entity.getPosition();
@@ -689,8 +689,8 @@ class GraphNode extends EventHandler {
689689
/**
690690
* @function
691691
* @name GraphNode#getRotation
692-
* @description Get the world space rotation for the specified GraphNode in quaternion
693-
* form. The value returned by this function should be considered read-only. In order
692+
* @description Get the world space rotation for the specified GraphNode. The rotation
693+
* is returned as a {@link Quat}. The value returned by this function should be considered read-only. In order
694694
* to set the world-space rotation of the graph node, use {@link GraphNode#setRotation}.
695695
* @returns {Quat} The world space rotation of the graph node as a quaternion.
696696
* @example
@@ -708,7 +708,8 @@ class GraphNode extends EventHandler {
708708
* @description Get the world space scale for the specified GraphNode. The returned value
709709
* will only be correct for graph nodes that have a non-skewed world transform (a skew can
710710
* be introduced by the compounding of rotations and scales higher in the graph node
711-
* hierarchy). The value returned by this function should be considered read-only. Note
711+
* hierarchy). The scale is returned as a {@link Vec3}.
712+
* The value returned by this function should be considered read-only. Note
712713
* that it is not possible to set the world space scale of a graph node directly.
713714
* @returns {Vec3} The world space scale of the graph node.
714715
* @example

0 commit comments

Comments
 (0)