@box2d/debug-draw
Version:
Debug drawing helper for @box2d
92 lines • 3.62 kB
TypeScript
import { b2Vec2, b2Vec3, b2Mat33, XY } from "../common/b2_math";
import { b2Readonly } from "../common/b2_readonly";
import { b2Body } from "./b2_body";
import { b2Joint, b2JointDef, b2IJointDef } from "./b2_joint";
import { b2SolverData } from "./b2_time_step";
export interface b2IWeldJointDef extends b2IJointDef {
localAnchorA?: XY;
localAnchorB?: XY;
referenceAngle?: number;
stiffness?: number;
damping?: number;
}
/**
* Weld joint definition. You need to specify local anchor points
* where they are attached and the relative body angle. The position
* of the anchor points is important for computing the reaction torque.
*/
export declare class b2WeldJointDef extends b2JointDef implements b2IWeldJointDef {
/** The local anchor point relative to bodyA's origin. */
readonly localAnchorA: b2Vec2;
/** The local anchor point relative to bodyB's origin. */
readonly localAnchorB: b2Vec2;
/** The bodyB angle minus bodyA angle in the reference state (radians). */
referenceAngle: number;
/**
* The rotational stiffness in N*m
* Disable softness with a value of 0
*/
stiffness: number;
/** The rotational damping in N*m*s */
damping: number;
constructor();
/**
* Initialize the bodies, anchors, reference angle, stiffness, and damping.
* @param bodyA the first body connected by this joint
* @param bodyB the second body connected by this joint
* @param anchor the point of connection in world coordinates
*/
Initialize(bA: b2Body, bB: b2Body, anchor: Readonly<XY>): void;
}
/**
* A weld joint essentially glues two bodies together. A weld joint may
* distort somewhat because the island constraint solver is approximate.
*/
export declare class b2WeldJoint extends b2Joint {
protected m_stiffness: number;
protected m_damping: number;
protected m_bias: number;
protected readonly m_localAnchorA: b2Vec2;
protected readonly m_localAnchorB: b2Vec2;
protected m_referenceAngle: number;
protected m_gamma: number;
protected readonly m_impulse: b2Vec3;
protected m_indexA: number;
protected m_indexB: number;
protected readonly m_rA: b2Vec2;
protected readonly m_rB: b2Vec2;
protected readonly m_localCenterA: b2Vec2;
protected readonly m_localCenterB: b2Vec2;
protected m_invMassA: number;
protected m_invMassB: number;
protected m_invIA: number;
protected m_invIB: number;
protected readonly m_mass: b2Mat33;
/** @internal protected */
constructor(def: b2IWeldJointDef);
/** @internal protected */
InitVelocityConstraints(data: b2SolverData): void;
/** @internal protected */
SolveVelocityConstraints(data: b2SolverData): void;
/** @internal protected */
SolvePositionConstraints(data: b2SolverData): boolean;
GetAnchorA<T extends XY>(out: T): T;
GetAnchorB<T extends XY>(out: T): T;
GetReactionForce<T extends XY>(inv_dt: number, out: T): T;
GetReactionTorque(inv_dt: number): number;
/** The local anchor point relative to bodyA's origin. */
GetLocalAnchorA(): b2Readonly<b2Vec2>;
/** The local anchor point relative to bodyB's origin. */
GetLocalAnchorB(): b2Readonly<b2Vec2>;
/** Get the reference angle. */
GetReferenceAngle(): number;
/** Set stiffness in N*m */
SetStiffness(stiffness: number): void;
/** Get stiffness in N*m */
GetStiffness(): number;
/** Set damping in N*m*s */
SetDamping(damping: number): void;
/** Get damping in N*m*s */
GetDamping(): number;
}
//# sourceMappingURL=b2_weld_joint.d.ts.map