diff --git a/sandbox/embed_selfhost_fullscreen.html b/sandbox/embed_selfhost_fullscreen.html
index b59abd0..79ce964 100644
--- a/sandbox/embed_selfhost_fullscreen.html
+++ b/sandbox/embed_selfhost_fullscreen.html
@@ -24,7 +24,8 @@
-
+
+
diff --git a/sandbox/embed_selfhost_multiple.html b/sandbox/embed_selfhost_multiple.html
index c52f992..7bb646e 100644
--- a/sandbox/embed_selfhost_multiple.html
+++ b/sandbox/embed_selfhost_multiple.html
@@ -25,7 +25,8 @@
-
+
+
diff --git a/sandbox/embed_selfhost_single.html b/sandbox/embed_selfhost_single.html
index 473a3ba..f6a0b73 100644
--- a/sandbox/embed_selfhost_single.html
+++ b/sandbox/embed_selfhost_single.html
@@ -24,7 +24,8 @@
-
+
+
diff --git a/sandbox/embed_selfhost_single_scroll.html b/sandbox/embed_selfhost_single_scroll.html
index 60c4193..3616919 100644
--- a/sandbox/embed_selfhost_single_scroll.html
+++ b/sandbox/embed_selfhost_single_scroll.html
@@ -24,7 +24,8 @@
-
+
+
diff --git a/source/model/modelentities.js b/source/model/material.js
similarity index 75%
rename from source/model/modelentities.js
rename to source/model/material.js
index e4b873e..f10af99 100644
--- a/source/model/modelentities.js
+++ b/source/model/material.js
@@ -1,21 +1,3 @@
-OV.SRGBToLinear = function (component)
-{
- if (component < 0.04045) {
- return component * 0.0773993808;
- } else {
- return Math.pow (component * 0.9478672986 + 0.0521327014, 2.4);
- }
-};
-
-OV.LinearToSRGB = function (component)
-{
- if (component < 0.0031308) {
- return component * 12.92;
- } else {
- return 1.055 * (Math.pow (component, 0.41666)) - 0.055;
- }
-};
-
OV.Color = class
{
constructor (r, g, b)
@@ -162,85 +144,21 @@ OV.Material = class
}
};
-OV.Triangle = class
+OV.SRGBToLinear = function (component)
{
- constructor (v0, v1, v2)
- {
- this.v0 = v0;
- this.v1 = v1;
- this.v2 = v2;
-
- this.n0 = null;
- this.n1 = null;
- this.n2 = null;
-
- this.u0 = null;
- this.u1 = null;
- this.u2 = null;
-
- this.mat = null;
- this.curve = null;
+ if (component < 0.04045) {
+ return component * 0.0773993808;
+ } else {
+ return Math.pow (component * 0.9478672986 + 0.0521327014, 2.4);
}
+};
- HasVertices ()
- {
- return this.v0 !== null && this.v1 !== null && this.v2 !== null;
- }
-
- HasNormals ()
- {
- return this.n0 !== null && this.n1 !== null && this.n2 !== null;
- }
-
- HasTextureUVs ()
- {
- return this.u0 !== null && this.u1 !== null && this.u2 !== null;
- }
-
- SetVertices (v0, v1, v2)
- {
- this.v0 = v0;
- this.v1 = v1;
- this.v2 = v2;
- return this;
- }
-
- SetNormals (n0, n1, n2)
- {
- this.n0 = n0;
- this.n1 = n1;
- this.n2 = n2;
- return this;
- }
-
- SetTextureUVs (u0, u1, u2)
- {
- this.u0 = u0;
- this.u1 = u1;
- this.u2 = u2;
- return this;
- }
-
- SetMaterial (mat)
- {
- this.mat = mat;
- return this;
- }
-
- SetCurve (curve)
- {
- this.curve = curve;
- return this;
- }
-
- Clone ()
- {
- let cloned = new OV.Triangle (this.v0, this.v1, this.v2);
- cloned.SetNormals (this.n0, this.n1, this.n2);
- cloned.SetTextureUVs (this.u0, this.u1, this.u2);
- cloned.SetMaterial (this.mat);
- cloned.SetCurve (this.curve);
- return cloned;
+OV.LinearToSRGB = function (component)
+{
+ if (component < 0.0031308) {
+ return component * 12.92;
+ } else {
+ return 1.055 * (Math.pow (component, 0.41666)) - 0.055;
}
};
diff --git a/source/model/triangle.js b/source/model/triangle.js
new file mode 100644
index 0000000..25543c5
--- /dev/null
+++ b/source/model/triangle.js
@@ -0,0 +1,81 @@
+OV.Triangle = class
+{
+ constructor (v0, v1, v2)
+ {
+ this.v0 = v0;
+ this.v1 = v1;
+ this.v2 = v2;
+
+ this.n0 = null;
+ this.n1 = null;
+ this.n2 = null;
+
+ this.u0 = null;
+ this.u1 = null;
+ this.u2 = null;
+
+ this.mat = null;
+ this.curve = null;
+ }
+
+ HasVertices ()
+ {
+ return this.v0 !== null && this.v1 !== null && this.v2 !== null;
+ }
+
+ HasNormals ()
+ {
+ return this.n0 !== null && this.n1 !== null && this.n2 !== null;
+ }
+
+ HasTextureUVs ()
+ {
+ return this.u0 !== null && this.u1 !== null && this.u2 !== null;
+ }
+
+ SetVertices (v0, v1, v2)
+ {
+ this.v0 = v0;
+ this.v1 = v1;
+ this.v2 = v2;
+ return this;
+ }
+
+ SetNormals (n0, n1, n2)
+ {
+ this.n0 = n0;
+ this.n1 = n1;
+ this.n2 = n2;
+ return this;
+ }
+
+ SetTextureUVs (u0, u1, u2)
+ {
+ this.u0 = u0;
+ this.u1 = u1;
+ this.u2 = u2;
+ return this;
+ }
+
+ SetMaterial (mat)
+ {
+ this.mat = mat;
+ return this;
+ }
+
+ SetCurve (curve)
+ {
+ this.curve = curve;
+ return this;
+ }
+
+ Clone ()
+ {
+ let cloned = new OV.Triangle (this.v0, this.v1, this.v2);
+ cloned.SetNormals (this.n0, this.n1, this.n2);
+ cloned.SetTextureUVs (this.u0, this.u1, this.u2);
+ cloned.SetMaterial (this.mat);
+ cloned.SetCurve (this.curve);
+ return cloned;
+ }
+};
diff --git a/tools/config.json b/tools/config.json
index 6540c85..d8db6e1 100644
--- a/tools/config.json
+++ b/tools/config.json
@@ -20,7 +20,8 @@
"source/io/textwriter.js",
"source/io/bufferutils.js",
"source/io/fileutils.js",
- "source/model/modelentities.js",
+ "source/model/material.js",
+ "source/model/triangle.js",
"source/model/element.js",
"source/model/mesh.js",
"source/model/meshbuffer.js",
diff --git a/website/embed.html b/website/embed.html
index d3eb546..f0f950a 100644
--- a/website/embed.html
+++ b/website/embed.html
@@ -33,7 +33,8 @@
-
+
+
diff --git a/website/index.html b/website/index.html
index b035413..70b1935 100644
--- a/website/index.html
+++ b/website/index.html
@@ -33,7 +33,8 @@
-
+
+