@awayfl/poki-player
Version:
AVM Player for poki games
79 lines (78 loc) • 3.55 kB
JavaScript
/*
* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
import { __extends } from "tslib";
import { b2Vec2 } from "../../Common/Math";
import { b2Settings } from "../../Common/b2Settings";
import { b2OBB } from "../b2OBB";
import { b2Shape } from "./b2Shape";
///A circle intersected with a half plane.
///The circle is as it would be for a b2CircleShape, i.e. centered at localPosition and of radius radius.
///The half plane is represented by norm, giving the outward normal, and offset, which is the offset of
///the halfplane's edge from the center of the circle. A zero offset means a semi-circle, with a positive
///offset being larger than that and a negative one smaller.
var b2ConvexArcShape = /** @class */ (function (_super) {
__extends(b2ConvexArcShape, _super);
//--------------- Internals Below -------------------
function b2ConvexArcShape(def) {
var _this = _super.call(this, def) || this;
// Local position of the circle center in parent body frame.
_this.m_localPosition = new b2Vec2();
// Local position oriented bounding box. The OBB center is relative to
// shape position.
_this.m_obb = new b2OBB();
//Only has 2 vertices
_this.m_vertices = [new b2Vec2(), new b2Vec2()]; //Like b2PolyShape, these are relative to m_localPosition
_this.m_norm = new b2Vec2();
return _this;
}
/// @see b2Shape::TestPoint
b2ConvexArcShape.prototype.TestPoint = function (xf, p) {
b2Settings.b2Assert(false);
return false;
};
/// @see b2Shape::TestSegment
b2ConvexArcShape.prototype.TestSegment = function (xf, lambda, // float ptr
normal, // ptr
segment, maxLambda) {
b2Settings.b2Assert(false);
return false;
};
/// @see b2Shape::ComputeAABB
b2ConvexArcShape.prototype.ComputeAABB = function (aabb, xf) {
_super.prototype.ComputeAABB.call(this, aabb, xf);
};
/// @see b2Shape::ComputeSweptAABB
b2ConvexArcShape.prototype.ComputeSweptAABB = function (aabb, transform1, transform2) {
_super.prototype.ComputeSweptAABB.call(this, aabb, transform1, transform2);
};
/// @see b2Shape::ComputeMass
b2ConvexArcShape.prototype.ComputeMass = function (massData) {
};
/// Get the oriented bounding box relative to the parent body.
b2ConvexArcShape.prototype.GetOBB = function () {
return this.m_obb;
};
b2ConvexArcShape.prototype.UpdateSweepRadius = function (center) {
};
b2ConvexArcShape.prototype.Support = function (xf, dX, dY) {
b2Settings.b2Assert(false);
return null;
};
return b2ConvexArcShape;
}(b2Shape));
export { b2ConvexArcShape };