Skip to content

Commit 1413aca

Browse files
committed
Add a toDOMString method to XML3D.Box type
1 parent e11a369 commit 1413aca

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

spec/index.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3219,8 +3219,8 @@ <h3>Vec2</h3>
32193219
<dd>Creates a new Vec2 object from the space-separated string representation as used in XML3D element
32203220
attributes.
32213221
</dd>
3222-
<dt>DOMString toDOMString(Vec2 vec)</dt>
3223-
<dd>Converts a Vec2 into the space-seperated string representation used in XML3D element attributes.</dd>
3222+
<dt>DOMString toDOMString()</dt>
3223+
<dd>Returns a space-seperated string representation for use in XML3D element attributes or value elements.</dd>
32243224

32253225
<dt>Constructor ()</dt>
32263226
<dd>Creates a new identity Vec2 <code>[0,0]</code></dd>
@@ -3304,8 +3304,8 @@ <h3>Vec3</h3>
33043304
<dd>Creates a new Vec3 object from the space-separated string representation as used in XML3D element
33053305
attributes.
33063306
</dd>
3307-
<dt>DOMString toDOMString(Vec3 vec)</dt>
3308-
<dd>Converts a Vec3 into the space-seperated string representation used in XML3D element attributes.</dd>
3307+
<dt>DOMString toDOMString()</dt>
3308+
<dd>Returns a space-seperated string representation for use in XML3D element attributes or value elements.</dd>
33093309

33103310
<dt>Constructor ()</dt>
33113311
<dd>Creates a new identity Vec3 <code>[0,0,0]</code></dd>
@@ -3399,8 +3399,8 @@ <h3>Vec4</h3>
33993399
<dd>Creates a new Vec4 object from the space-separated string representation as used in XML3D element
34003400
attributes.
34013401
</dd>
3402-
<dt>DOMString toDOMString(Vec4 vec)</dt>
3403-
<dd>Converts a Vec4 into the space-seperated string representation used in XML3D element attributes.</dd>
3402+
<dt>DOMString toDOMString()</dt>
3403+
<dd>Returns a space-seperated string representation for use in XML3D element attributes or value elements.</dd>
34043404

34053405
<dt>Constructor ()</dt>
34063406
<dd>Creates a new identity Vec4 <code>[0,0,0,0]</code></dd>
@@ -3480,8 +3480,8 @@ <h3>AxisAngle</h3>
34803480
<dd>Creates a new AxisAngle object from the space-separated string representation as used in XML3D element
34813481
attributes.
34823482
</dd>
3483-
<dt>DOMString toDOMString(AxisAngle vec)</dt>
3484-
<dd>Converts a AxisAngle into the space-seperated string representation used in XML3D element attributes.
3483+
<dt>DOMString toDOMString()</dt>
3484+
<dd>Returns a space-seperated string representation for use in XML3D element attributes or value elements.
34853485
</dd>
34863486

34873487
<dt>Constructor ()</dt>
@@ -3526,8 +3526,8 @@ <h3>Quat</h3>
35263526
<dd>Provides mutable access to the fourth component of this quaternion.</dd>
35273527
<dt>static Quat fromDOMString(DOMString str)</dt>
35283528
<dd>Creates a new Quat object from a space-separated string representation.</dd>
3529-
<dt>DOMString toDOMString(Quat vec)</dt>
3530-
<dd>Converts a Quat into a space-seperated string representation.</dd>
3529+
<dt>DOMString toDOMString()</dt>
3530+
<dd>Returns a space-seperated string representation for use in XML3D element attributes or value elements.</dd>
35313531

35323532
<dt>Constructor ()</dt>
35333533
<dd>Creates a new identity Quat <code>[0,0,0,1]</code></dd>
@@ -3891,6 +3891,8 @@ <h3>Box</h3>
38913891
<dd>Returns true if the given point is inside the box.</dd>
38923892
<dt>DOMString toString()</dt>
38933893
<dd>A human readable string representation of this box.</dd>
3894+
<dt>DOMString toDOMString()</dt>
3895+
<dd>Returns a space-seperated string representation for use in XML3D element attributes or value elements.</dd>
38943896
</dl>
38953897
</section>
38963898
<section>

src/types/box.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ Box.prototype.toString = function() {
199199
this.data[4] + ', ' + this.data[5] + ')';
200200
};
201201

202+
Box.prototype.toDOMString = function() {
203+
return this.data[0] + ' ' + this.data[1] + ' ' + this.data[2] + ' ' + this.data[3] + ' ' +
204+
this.data[4] + ' ' + this.data[5];
205+
};
206+
202207
Box.EMPTY_BOX = new Box();
203208

204209
module.exports = Box;

0 commit comments

Comments
 (0)