Skip to content

Commit 4646069

Browse files
committed
Merge branch '5.1'
2 parents b7781d9 + af5b423 commit 4646069

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1658
-1244
lines changed

css/xml3d.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ xml3d|script {
1313
display: none;
1414
}
1515

16+
xml3d|mesh,
17+
xml3d|group,
18+
xml3d|model {
19+
position: absolute;
20+
}
21+
1622
.xml3d-canvas-style {
1723
cursor: default;
1824
display: block;

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "xml3d.js",
33
"description": "XML3D implementation based on JS and WebGL",
44
"homepage": "http://ww.xml3d.org",
5-
"version": "5.0.4",
5+
"version": "5.1.0",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/xml3d/xml3d.js"
@@ -27,6 +27,7 @@
2727
"lodash.assign": "^3.1.0",
2828
"lodash.create": "^3.1.0",
2929
"lodash.defaults": "^3.1.1",
30+
"whatwg-fetch": "0.10.1",
3031
"texture-manager": "http://github.com/ksons/texture-manager/tarball/master"
3132
}
3233
}

spec/index.html

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,83 @@ <h3>The <code>transform</code> property</h3>
710710

711711
</section>
712712

713+
<section>
714+
<h3>The <code>z-index</code> property</h3>
715+
716+
<div class="propdef">
717+
<dl>
718+
<dt>
719+
<span class="index-def" title="'z-index'"><strong>'z-index'</strong></span>
720+
</dt>
721+
<dd>
722+
<table class="propinfo" cellspacing="0" cellpadding="0">
723+
<tbody>
724+
<tr valign="baseline">
725+
<td><em>Value:</em>&nbsp;&nbsp;</td>
726+
<td>auto | &lt;integer&gt;
727+
</td>
728+
</tr>
729+
<tr valign="baseline">
730+
<td><em>Initial:</em>&nbsp;&nbsp;</td>
731+
<td>auto
732+
</td>
733+
</tr>
734+
<tr valign="baseline">
735+
<td><em>Applies to:</em>&nbsp;&nbsp;</td>
736+
<td><a href="#scene-elements">Scene elements</a>
737+
</td>
738+
</tr>
739+
</tbody>
740+
</table>
741+
</dd>
742+
</dl>
743+
</div>
744+
<p>The meanings of the values of this property for XML3D elements:</p>
745+
<dl>
746+
<dt><span class="index-def" title="'none', definition of"><strong>auto</strong></span>
747+
</dt>
748+
<dd>This is the default value and causes the element to be rendered in the same z-layer (stacking context) as its parent element.
749+
If no other z-index values appear in the scene this means all elements will be rendered in a single z-layer according
750+
to their distance from the camera.
751+
</dd>
752+
<dt><span class="index-def" title="definition of other values">&lt;other values&gt;</span>
753+
</dt>
754+
<dd>Any value other than '0' will create a new stacking context, similar to the behavior of z-index for normal
755+
HTML elements.
756+
</dd>
757+
</dl>
758+
759+
<p>During rendering objects will first be sorted into bins according to the stacking contexts present in the scene.
760+
Then the bins will be rendered from lowest z-index to highest, with the objects in each bin sorted according
761+
to their distance from the camera. The depth buffer will be cleared between each bin.</p>
762+
763+
<p>This has the effect of rendering objects with a higher z-index on top of those with a lower z-index
764+
regardless of their spatial orientation in the scene.</p>
765+
766+
<p>Note that the same stacking context rules apply for XML3D elements as for HTML elements. This means an
767+
element's z-index is always relative to the closest parent element having a z-index value other than 'auto'.</p>
768+
769+
Here are some examples for the 'z-index' property:
770+
<pre class="example highlight">
771+
&lt;mesh src="example.xml" style="z-index: 5"&gt;&lt;/mesh&gt;
772+
&lt;mesh src="example.xml" style="z-index: 10"&gt;&lt;/mesh&gt; &lt;!-- Will always be drawn above the other two meshes --&gt;
773+
&lt;mesh src="example.xml" style="z-index: -5"&gt;&lt;/mesh&gt; &lt;!-- Will always be drawn below the other two meshes --&gt;
774+
</pre>
775+
776+
In the example below the mesh with the z-index value of 500 will be drawn <em>below</em> the other meshes. This
777+
is because both groups create their own stacking contexts, and the second group's z-index is lower than that of the first.
778+
<pre class="example highlight">
779+
&lt;group style="z-index: 1"&gt;
780+
&lt;mesh src="example.xml" style="z-index: 10"&gt;&lt;/mesh&gt; &lt;!-- Will always be drawn above the second mesh --&gt;
781+
&lt;mesh src="example.xml"&gt;&lt;/mesh&gt;
782+
&lt;/group&gt;
783+
&lt;group style="z-index: -1"&gt;
784+
&lt;mesh src="example.xml" style="z-index: 500"&gt;&lt;/mesh&gt; &lt;!-- Will be drawn *below* the other meshes --&gt;
785+
&lt;/group&gt;
786+
</pre>
787+
788+
</section>
789+
713790
</section>
714791

715792
<section>

src/asset/asset.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,6 @@ function updateAccumulatedNode(table, entry){
571571
return;
572572

573573
if(entry.accumulatedXflowNode){
574-
entry.accumulatedXflowNode.clear();
575574
entry.accumulatedXflowNode.setCompute("");
576575
entry.accumulatedXflowNode.setFilter("");
577576
entry.accumulatedXflowNode.dataflowNode = null;

src/base/adapter.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
var registerFactory = require("./resourcemanager.js").registerFactory;
2-
var Resource = require("./resourcemanager.js").Resource;
31
var Events = require("../interface/notification.js");
42
var config = require("../interface/elements.js").config;
3+
var Resource = require("../resource");
54

65
/**
76
* A normal adapter that doesn't need to be connected to a DOM node
@@ -82,7 +81,7 @@ Adapter.prototype.getConnectedAdapter = function(key) {
8281
* This function is called, when the adapater is detached from the node.
8382
* At this point, the adapater should disconnect from any other adapter and prepare to be properly garbage collected
8483
*/
85-
Adapter.prototype.onDispose = function() {
84+
Adapter.prototype.dispose = function() {
8685
};
8786

8887

@@ -168,9 +167,7 @@ NodeAdapter.prototype.traverse = function(callback) {
168167
*/
169168
var IFactory = function() {
170169
};
171-
172-
/** @type {string} */
173-
IFactory.prototype.aspect;
170+
IFactory.prototype.createAdapter = function() {};
174171

175172

176173
/**
@@ -186,8 +183,6 @@ var AdapterFactory = function(aspect, mimetypes, canvasId) {
186183
this.aspect = aspect;
187184
this.canvasId = canvasId || 0;
188185
this.mimetypes = typeof mimetypes == "string" ? [ mimetypes] : mimetypes;
189-
190-
registerFactory(this);
191186
};
192187

193188
/** Implemented by subclass
@@ -246,8 +241,6 @@ NodeAdapterFactory.prototype.getAdapter = function(node) {
246241
return adapter;
247242
};
248243

249-
XML3D.resource.AdapterFactory = AdapterFactory;
250-
251244
module.exports = {
252245
NodeAdapter : NodeAdapter,
253246
AdapterFactory : AdapterFactory,

src/base/formathandler.js

Lines changed: 0 additions & 165 deletions
This file was deleted.

0 commit comments

Comments
 (0)