projects
/
featherfall2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c952777
)
Add AABB accessor to transforms.
author
Joe Wreschnig
<joe.wreschnig@gmail.com>
Wed, 17 Sep 2014 17:11:03 +0000
(19:11 +0200)
committer
Joe Wreschnig
<joe.wreschnig@gmail.com>
Wed, 17 Sep 2014 17:11:03 +0000
(19:11 +0200)
src/yuu/ce.js
patch
|
blob
|
history
diff --git
a/src/yuu/ce.js
b/src/yuu/ce.js
index
bb5c6e5
..
4300300
100644
(file)
--- a/
src/yuu/ce.js
+++ b/
src/yuu/ce.js
@@
-588,6
+588,22
@@
}
},
}
},
+ aabb2d: {
+ get: function () {
+ return new yuu.AABB(
+ this.x - this.scaleX / 2,
+ this.y - this.scaleY / 2,
+ this.x + this.scaleX / 2,
+ this.y + this.scaleY / 2);
+ },
+ set: function (aabb) {
+ this.x = aabb.x0 + aabb.w / 2;
+ this.y = aabb.y0 + aabb.h / 2;
+ this.scaleX = aabb.w;
+ this.scaleY = aabb.h;
+ }
+ },
+
yaw: { aliasSynthetic: "ypr[0]", chainable: true },
pitch: { aliasSynthetic: "ypr[1]", chainable: true },
roll: { aliasSynthetic: "ypr[2]", chainable: true },
yaw: { aliasSynthetic: "ypr[0]", chainable: true },
pitch: { aliasSynthetic: "ypr[1]", chainable: true },
roll: { aliasSynthetic: "ypr[2]", chainable: true },