diff options
66 files changed, 3029 insertions, 1746 deletions
diff --git a/assets/canvas-runtime.js b/assets/canvas-runtime.js index afb9563e..753161aa 100644 --- a/assets/canvas-runtime.js +++ b/assets/canvas-runtime.js | |||
@@ -382,6 +382,16 @@ NinjaCvsRt.GLRuntime = Object.create(Object.prototype, { | |||
382 | obj.importJSON( jObj ); | 382 | obj.importJSON( jObj ); |
383 | break; | 383 | break; |
384 | 384 | ||
385 | case 5: //subpath (created by pen tool) | ||
386 | obj = Object.create(NinjaCvsRt.RuntimeSubPath, {_materials: { value:[], writable:true}}); | ||
387 | obj.importJSON (jObj ); | ||
388 | break; | ||
389 | |||
390 | case 6: //brushstroke (created by brush tool) | ||
391 | obj = Object.create(NinjaCvsRt.RuntimeBrushStroke, {_materials: { value:[], writable:true}}); | ||
392 | obj.importJSON (jObj ); | ||
393 | break; | ||
394 | |||
385 | default: | 395 | default: |
386 | throw new Error( "Attempting to load unrecognized object type: " + type ); | 396 | throw new Error( "Attempting to load unrecognized object type: " + type ); |
387 | break; | 397 | break; |
@@ -524,6 +534,7 @@ NinjaCvsRt.RuntimeGeomObj = Object.create(Object.prototype, { | |||
524 | GEOM_TYPE_LINE: { value: 3, writable: false }, | 534 | GEOM_TYPE_LINE: { value: 3, writable: false }, |
525 | GEOM_TYPE_PATH: { value: 4, writable: false }, | 535 | GEOM_TYPE_PATH: { value: 4, writable: false }, |
526 | GEOM_TYPE_CUBIC_BEZIER: { value: 5, writable: false }, | 536 | GEOM_TYPE_CUBIC_BEZIER: { value: 5, writable: false }, |
537 | GEOM_TYPE_BRUSH_STROKE: { value: 6, writable: false }, | ||
527 | GEOM_TYPE_UNDEFINED: { value: -1, writable: false }, | 538 | GEOM_TYPE_UNDEFINED: { value: -1, writable: false }, |
528 | 539 | ||
529 | /////////////////////////////////////////////////////////////////////// | 540 | /////////////////////////////////////////////////////////////////////// |
@@ -2144,3 +2155,485 @@ NinjaCvsRt.RuntimePlasmaMaterial = Object.create(NinjaCvsRt.RuntimeMaterial, { | |||
2144 | }); | 2155 | }); |
2145 | 2156 | ||
2146 | 2157 | ||
2158 | |||
2159 | // ************************************************************************** | ||
2160 | // Runtime for the pen tool path | ||
2161 | // ************************************************************************** | ||
2162 | NinjaCvsRt.AnchorPoint = Object.create(Object.prototype, { | ||
2163 | ///////////////////////////////////////// | ||
2164 | // Instance variables | ||
2165 | ///////////////////////////////////////// | ||
2166 | _x: {value: 0.0, writable: true}, | ||
2167 | _y: {value: 0.0, writable: true}, | ||
2168 | _z: {value: 0.0, writable: true}, | ||
2169 | |||
2170 | _prevX: {value: 0.0, writable: true}, | ||
2171 | _prevY: {value: 0.0, writable: true}, | ||
2172 | _prevZ: {value: 0.0, writable: true}, | ||
2173 | |||
2174 | _nextX: {value: 0.0, writable: true}, | ||
2175 | _nextY: {value: 0.0, writable: true}, | ||
2176 | _nextZ: {value: 0.0, writable: true}, | ||
2177 | |||
2178 | // *********** setters ************ | ||
2179 | setPos: { | ||
2180 | value: function(x,y,z){ | ||
2181 | this._x = x; | ||
2182 | this._y = y; | ||
2183 | this._z = z; | ||
2184 | } | ||
2185 | }, | ||
2186 | |||
2187 | setPrevPos: { | ||
2188 | value: function (x, y, z) { | ||
2189 | this._prevX = x; | ||
2190 | this._prevY = y; | ||
2191 | this._prevZ = z; | ||
2192 | } | ||
2193 | }, | ||
2194 | |||
2195 | setNextPos: { | ||
2196 | value: function (x, y, z) { | ||
2197 | this._nextX = x; | ||
2198 | this._nextY = y; | ||
2199 | this._nextZ = z; | ||
2200 | } | ||
2201 | }, | ||
2202 | |||
2203 | // *************** getters ****************** | ||
2204 | // (add as needed) | ||
2205 | getPosX: { | ||
2206 | value: function () { | ||
2207 | return this._x; | ||
2208 | } | ||
2209 | }, | ||
2210 | |||
2211 | getPosY: { | ||
2212 | value: function () { | ||
2213 | return this._y; | ||
2214 | } | ||
2215 | }, | ||
2216 | |||
2217 | getPosZ: { | ||
2218 | value: function () { | ||
2219 | return this._z; | ||
2220 | } | ||
2221 | }, | ||
2222 | |||
2223 | getPrevX: { | ||
2224 | value: function () { | ||
2225 | return this._prevX; | ||
2226 | } | ||
2227 | }, | ||
2228 | |||
2229 | getPrevY: { | ||
2230 | value: function () { | ||
2231 | return this._prevY; | ||
2232 | } | ||
2233 | }, | ||
2234 | |||
2235 | getPrevZ: { | ||
2236 | value: function () { | ||
2237 | return this._prevZ; | ||
2238 | } | ||
2239 | }, | ||
2240 | |||
2241 | getNextX: { | ||
2242 | value: function () { | ||
2243 |