summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Vector.h')
-rw-r--r--libs/hwui/Vector.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/hwui/Vector.h b/libs/hwui/Vector.h
index 2a9f01c..d033ed9 100644
--- a/libs/hwui/Vector.h
+++ b/libs/hwui/Vector.h
@@ -111,6 +111,23 @@ public:
float y;
float z;
+ Vector3 operator+(const Vector3& v) const {
+ return (Vector3){x + v.x, y + v.y, z + v.z};
+ }
+
+ Vector3 operator-(const Vector3& v) const {
+ return (Vector3){x - v.x, y - v.y, z - v.z};
+ }
+
+ Vector3 operator/(float s) const {
+ return (Vector3){x / s, y / s, z / s};
+ }
+
+ Vector3 operator*(float s) const {
+ return (Vector3){x * s, y * s, z * s};
+ }
+
+
void dump() {
ALOGD("Vector3[%.2f, %.2f, %.2f]", x, y, z);
}