@esengine/nova-ecs-render-core - v1.0.1
    Preparing search index...

    Interface IPhysicsDebugRenderer

    Physics debug renderer interface 物理调试渲染器接口

    interface IPhysicsDebugRenderer {
        beginFrame(): void;
        clear(_color?: Color): void;
        clearPerformanceMeasurements(): void;
        debugLog(message: string, color?: Color): void;
        dispose(): void;
        drawAcceleration(position: FixedVector2, acceleration: FixedVector2): void;
        drawAngularVelocity(position: FixedVector2, angularVelocity: Fixed): void;
        drawArrow(
            start: FixedVector2,
            end: FixedVector2,
            color: Color,
            headSize?: Fixed,
        ): void;
        drawAxis(origin: FixedVector2, scale: Fixed): void;
        drawBodyAABB(min: FixedVector2, max: FixedVector2): void;
        drawBodyTransform(position: FixedVector2, rotation: Fixed): void;
        drawBounds(bounds: FixedRect, color: Color): void;
        drawBoxCollider(
            center: FixedVector2,
            size: FixedVector2,
            rotation: Fixed,
            filled: boolean,
        ): void;
        drawCenterOfMass(position: FixedVector2): void;
        drawCircle(_center: FixedVector2, _radius: Fixed, _style: ShapeStyle): void;
        drawCircleCollider(
            center: FixedVector2,
            radius: Fixed,
            filled: boolean,
        ): void;
        drawCollider(collider: unknown): void;
        drawContactImpulse(point: FixedVector2, impulse: FixedVector2): void;
        drawContactNormal(
            point: FixedVector2,
            normal: FixedVector2,
            length: Fixed,
        ): void;
        drawContactPoints(contacts: ContactPoint[]): void;
        drawCrosshair(position: FixedVector2, size: Fixed, color: Color): void;
        drawDebugOverlay(info: DebugInfo): void;
        drawDebugText(text: string, position: FixedVector2, color?: Color): void;
        drawDebugTextScreen(
            text: string,
            x: number,
            y: number,
            color?: Color,
        ): void;
        drawEdgeCollider(start: FixedVector2, end: FixedVector2): void;
        drawEllipse(_bounds: FixedRect, _style: ShapeStyle): void;
        drawForces(body: unknown): void;
        drawGrid(spacing: Fixed, style: GridStyle): void;
        drawJoint(joint: unknown): void;
        drawJointAnchors(anchorA: FixedVector2, anchorB: FixedVector2): void;
        drawJointLimits(
            center: FixedVector2,
            minAngle: Fixed,
            maxAngle: Fixed,
            radius: Fixed,
        ): void;
        drawLine(_start: FixedVector2, _end: FixedVector2, _style: LineStyle): void;
        drawPerformanceStats(stats: PerformanceStats): void;
        drawPhysicsStats(
            stats: {
                bodyCount: number;
                contactCount: number;
                jointCount: number;
                stepTime: number;
                [key: string]: number;
            },
        ): void;
        drawPolygon(_vertices: FixedVector2[], _style: ShapeStyle): void;
        drawPolygonCollider(vertices: FixedVector2[], filled: boolean): void;
        drawRect(_bounds: FixedRect, _style: ShapeStyle): void;
        drawRigidBody(body: unknown): void;
        drawText(_text: string, _position: FixedVector2, _style: TextStyle): void;
        drawTexture(
            _texture: ITexture,
            _position: FixedVector2,
            _style?: TextureStyle,
        ): void;
        drawTextureRegion(
            _texture: ITexture,
            _sourceRect: FixedRect,
            _destRect: FixedRect,
            _style?: TextureStyle,
        ): void;
        drawVector(
            start: FixedVector2,
            vector: FixedVector2,
            color: Color,
            scale?: Fixed,
        ): void;
        drawVelocity(position: FixedVector2, velocity: FixedVector2): void;
        endFrame(): void;
        endPerformanceMeasure(name: string): void;
        getCurrentTransform(): Transform2D;
        getDebugConfig(): DebugConfig;
        getDebugMode(): DebugMode;
        getPerformanceMeasurements(): Map<string, number>;
        getPhysicsDebugConfig(): PhysicsDebugConfig;
        getRendererInfo(): {
            capabilities: string[];
            name: string;
            vendor?: string;
            version: string;
        };
        getRenderState(): RenderState;
        getRenderTarget(): unknown;
        getStatistics(): RenderStatistics;
        getViewport(): Viewport;
        measureText(_text: string, _style: TextStyle): FixedVector2;
        popRenderState(): void;
        popTransform(): void;
        pushRenderState(): void;
        pushTransform(_transform: Transform2D): void;
        resetStatistics(): void;
        setDebugConfig(config: Partial<DebugConfig>): void;
        setDebugLogging(enabled: boolean): void;
        setDebugMode(mode: DebugMode): void;
        setPhysicsDebugConfig(config: Partial<PhysicsDebugConfig>): void;
        setRenderState(_state: RenderState): void;
        setRenderTarget(_target: unknown): void;
        setViewMatrix(_matrix: FixedMatrix2x2): void;
        setViewport(_viewport: Viewport): void;
        startPerformanceMeasure(name: string): void;
        supportsFeature(_feature: string): boolean;
        takeScreenshot(): Promise<null | Blob>;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Methods

    • Draw acceleration vector 绘制加速度向量

      Parameters

      • position: FixedVector2
      • acceleration: FixedVector2

      Returns void

    • Draw angular velocity indicator 绘制角速度指示器

      Parameters

      • position: FixedVector2
      • angularVelocity: Fixed

      Returns void

    • Draw an arrow from start to end point 从起点到终点绘制箭头

      Parameters

      • start: FixedVector2
      • end: FixedVector2
      • color: Color
      • OptionalheadSize: Fixed

      Returns void

    • Draw body AABB (Axis-Aligned Bounding Box) 绘制刚体AABB(轴对齐边界框)

      Parameters

      • min: FixedVector2
      • max: FixedVector2

      Returns void

    • Draw body transform (position and rotation) 绘制刚体变换(位置和旋转)

      Parameters

      • position: FixedVector2
      • rotation: Fixed

      Returns void

    • Draw box collider 绘制盒形碰撞器

      Parameters

      • center: FixedVector2
      • size: FixedVector2
      • rotation: Fixed
      • filled: boolean

      Returns void

    • Draw circle collider 绘制圆形碰撞器

      Parameters

      • center: FixedVector2
      • radius: Fixed
      • filled: boolean

      Returns void

    • Draw contact impulse 绘制接触冲量

      Parameters

      • point: FixedVector2
      • impulse: FixedVector2

      Returns void

    • Draw contact normal 绘制接触法线

      Parameters

      • point: FixedVector2
      • normal: FixedVector2
      • length: Fixed

      Returns void

    • Draw edge collider 绘制边缘碰撞器

      Parameters

      • start: FixedVector2
      • end: FixedVector2

      Returns void

    • Draw joint anchors 绘制关节锚点

      Parameters

      • anchorA: FixedVector2
      • anchorB: FixedVector2

      Returns void

    • Draw joint limits (for revolute/prismatic joints) 绘制关节限制(用于旋转/平移关节)

      Parameters

      • center: FixedVector2
      • minAngle: Fixed
      • maxAngle: Fixed
      • radius: Fixed

      Returns void

    • Draw physics statistics overlay 绘制物理统计覆盖层

      Parameters

      • stats: {
            bodyCount: number;
            contactCount: number;
            jointCount: number;
            stepTime: number;
            [key: string]: number;
        }

      Returns void

    • Draw polygon collider 绘制多边形碰撞器

      Parameters

      • vertices: FixedVector2[]
      • filled: boolean

      Returns void

    • Draw vector arrow 绘制向量箭头

      Parameters

      • start: FixedVector2
      • vector: FixedVector2
      • color: Color
      • Optionalscale: Fixed

      Returns void

    • Draw velocity vector 绘制速度向量

      Parameters

      • position: FixedVector2
      • velocity: FixedVector2

      Returns void

    • Get renderer information 获取渲染器信息

      Returns { capabilities: string[]; name: string; vendor?: string; version: string }