/src/mozilla-central/dom/media/webaudio/ThreeDPoint.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim:set ts=2 sw=2 sts=2 et cindent: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | /** |
8 | | * Other similar methods can be added if needed. |
9 | | */ |
10 | | |
11 | | #include "ThreeDPoint.h" |
12 | | #include "WebAudioUtils.h" |
13 | | |
14 | | namespace mozilla { |
15 | | |
16 | | namespace dom { |
17 | | |
18 | | bool |
19 | | ThreeDPoint::FuzzyEqual(const ThreeDPoint& other) |
20 | 0 | { |
21 | 0 | return WebAudioUtils::FuzzyEqual(x, other.x) && |
22 | 0 | WebAudioUtils::FuzzyEqual(y, other.y) && |
23 | 0 | WebAudioUtils::FuzzyEqual(z, other.z); |
24 | 0 | } |
25 | | |
26 | | ThreeDPoint operator-(const ThreeDPoint& lhs, const ThreeDPoint& rhs) |
27 | 0 | { |
28 | 0 | return ThreeDPoint(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z); |
29 | 0 | } |
30 | | |
31 | | ThreeDPoint operator*(const ThreeDPoint& lhs, const ThreeDPoint& rhs) |
32 | 0 | { |
33 | 0 | return ThreeDPoint(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z); |
34 | 0 | } |
35 | | |
36 | | ThreeDPoint operator*(const ThreeDPoint& lhs, const double rhs) |
37 | 0 | { |
38 | 0 | return ThreeDPoint(lhs.x * rhs, lhs.y * rhs, lhs.z * rhs); |
39 | 0 | } |
40 | | |
41 | | bool operator==(const ThreeDPoint& lhs, const ThreeDPoint& rhs) |
42 | 0 | { |
43 | 0 | return lhs.x == rhs.x && |
44 | 0 | lhs.y == rhs.y && |
45 | 0 | lhs.z == rhs.z; |
46 | 0 | } |
47 | | |
48 | | } // namespace dom |
49 | | } // namespace mozilla |