michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et cindent: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * Other similar methods can be added if needed. michael@0: */ michael@0: michael@0: #include "ThreeDPoint.h" michael@0: #include "WebAudioUtils.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: namespace dom { michael@0: michael@0: bool michael@0: ThreeDPoint::FuzzyEqual(const ThreeDPoint& other) michael@0: { michael@0: return WebAudioUtils::FuzzyEqual(x, other.x) && michael@0: WebAudioUtils::FuzzyEqual(y, other.y) && michael@0: WebAudioUtils::FuzzyEqual(z, other.z); michael@0: } michael@0: michael@0: ThreeDPoint operator-(const ThreeDPoint& lhs, const ThreeDPoint& rhs) michael@0: { michael@0: return ThreeDPoint(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z); michael@0: } michael@0: michael@0: ThreeDPoint operator*(const ThreeDPoint& lhs, const ThreeDPoint& rhs) michael@0: { michael@0: return ThreeDPoint(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z); michael@0: } michael@0: michael@0: ThreeDPoint operator*(const ThreeDPoint& lhs, const double rhs) michael@0: { michael@0: return ThreeDPoint(lhs.x * rhs, lhs.y * rhs, lhs.z * rhs); michael@0: } michael@0: michael@0: bool operator==(const ThreeDPoint& lhs, const ThreeDPoint& rhs) michael@0: { michael@0: return lhs.x == rhs.x && michael@0: lhs.y == rhs.y && michael@0: lhs.z == rhs.z; michael@0: } michael@0: michael@0: } michael@0: }