2011-08-27 04:06:03 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2012-05-21 15:12:37 +04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-08-27 04:06:03 +04:00
|
|
|
|
|
|
|
#ifndef GFX_POINTH3D_H
|
|
|
|
#define GFX_POINTH3D_H
|
|
|
|
|
|
|
|
#include "mozilla/gfx/BasePoint4D.h"
|
|
|
|
#include "gfxTypes.h"
|
2014-07-08 08:55:42 +04:00
|
|
|
#include "gfxPoint.h"
|
2011-08-27 04:06:03 +04:00
|
|
|
|
2013-05-30 01:59:24 +04:00
|
|
|
struct gfxPointH3D : public mozilla::gfx::BasePoint4D<float, gfxPointH3D> {
|
2011-08-27 04:06:03 +04:00
|
|
|
typedef mozilla::gfx::BasePoint4D<float, gfxPointH3D> Super;
|
|
|
|
|
|
|
|
gfxPointH3D() : Super() {}
|
|
|
|
gfxPointH3D(float aX, float aY, float aZ, float aW) : Super(aX, aY, aZ, aW) {}
|
2014-07-08 08:55:42 +04:00
|
|
|
|
|
|
|
bool HasPositiveWCoord() { return w > 0; }
|
|
|
|
|
|
|
|
gfxPoint As2DPoint() {
|
|
|
|
return gfxPoint(x / w, y / w);
|
|
|
|
}
|
2011-08-27 04:06:03 +04:00
|
|
|
};
|
|
|
|
|
2011-09-27 12:49:53 +04:00
|
|
|
#endif /* GFX_POINTH3D_H */
|