@box2d/debug-draw
Version:
Debug drawing helper for @box2d
78 lines • 2.93 kB
TypeScript
import { b2Vec2, b2Transform, XY } from "../common/b2_math";
import { b2AABB, b2RayCastInput, b2RayCastOutput } from "./b2_collision";
import { b2DistanceProxy } from "./b2_distance";
import { b2MassData, b2Shape } from "./b2_shape";
import { b2EdgeShape } from "./b2_edge_shape";
import { b2Color, b2Draw } from "../common/b2_draw";
import { b2Readonly } from "../common/b2_readonly";
/**
* A chain shape is a free form sequence of line segments.
* The chain has one-sided collision, with the surface normal pointing to the right of the edge.
* This provides a counter-clockwise winding like the polygon shape.
* Connectivity information is used to create smooth collisions.
*
* @warning the chain will not collide properly if there are self-intersections.
*/
export declare class b2ChainShape extends b2Shape {
m_vertices: b2Vec2[];
readonly m_prevVertex: b2Vec2;
readonly m_nextVertex: b2Vec2;
constructor();
/**
* Create a loop. This automatically adjusts connectivity.
*
* @param vertices An array of vertices, these are copied
* @param count The vertex count
*/
CreateLoop(vertices: XY[], count?: number): b2ChainShape;
/**
* Create a chain with ghost vertices to connect multiple chains together.
*
* @param vertices An array of vertices, these are copied
* @param count The vertex count
* @param prevVertex Previous vertex from chain that connects to the start
* @param nextVertex Next vertex from chain that connects to the end
*/
CreateChain(vertices: XY[], count: number, prevVertex: Readonly<XY>, nextVertex: Readonly<XY>): b2ChainShape;
/**
* Implement b2Shape. Vertices are cloned using b2Alloc.
*/
Clone(): b2ChainShape;
Copy(other: b2ChainShape): b2ChainShape;
/**
* @see b2Shape::GetChildCount
*/
GetChildCount(): number;
/**
* Get a child edge.
*/
GetChildEdge(edge: b2EdgeShape, index: number): void;
/**
* This always return false.
*
* @see b2Shape::TestPoint
*/
TestPoint(_xf: b2Readonly<b2Transform>, _p: XY): boolean;
private static RayCast_s_edgeShape;
/**
* Implement b2Shape.
*/
RayCast(output: b2RayCastOutput, input: b2RayCastInput, xf: b2Readonly<b2Transform>, childIndex: number): boolean;
private static ComputeAABB_s_v1;
private static ComputeAABB_s_v2;
private static ComputeAABB_s_lower;
private static ComputeAABB_s_upper;
/**
* @see b2Shape::ComputeAABB
*/
ComputeAABB(aabb: b2AABB, xf: b2Readonly<b2Transform>, childIndex: number): void;
/**
* Chains have zero mass.
*
* @see b2Shape::ComputeMass
*/
ComputeMass(massData: b2MassData, _density: number): void;
SetupDistanceProxy(proxy: b2DistanceProxy, index: number): void;
Draw(draw: b2Draw, color: b2Color): void;
}
//# sourceMappingURL=b2_chain_shape.d.ts.map