-
Notifications
You must be signed in to change notification settings - Fork 4
/
shade.js
42 lines (36 loc) · 1.07 KB
/
shade.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
(function (ns) {
var Shade = require("../../../interfaces.js");
var Syntax = require('estraverse').Syntax;
var Tools = require("../../tools.js");
var ShadeInstance = {
diffuse: {
callExp: function(node) {
return {
type: Syntax.BinaryExpression,
operator: "+",
left: {
type: Syntax.CallExpression,
callee: node.callee.property,
arguments: node.arguments
},
right: node.callee,
extra: {
type: Shade.TYPES.OBJECT,
kind: Shade.OBJECT_KINDS.COLOR_CLOSURE
}
}
}
},
phong: {
}
}
Tools.extend(ns, {
id: "Shade",
kind: Shade.OBJECT_KINDS.COLOR_CLOSURE,
object: {
constructor: Tools.Vec.generateConstructor,
static: {}
},
instance: ShadeInstance
});
}(exports));