Fudge Core
    Preparing search index...

    Class PhysicsDebugDraw

    Internal Class used to draw debugInformations about the physics simulation onto the renderContext. No user interaction needed.

    Marko Fehrenbach, HFU 2020 //Based on OimoPhysics Haxe DebugDrawDemo

    Hierarchy (View Summary)

    Index

    Constructors

    • Creating the debug for physics in FUDGE. Tell it to draw only wireframe objects, since FUDGE is handling rendering of the objects besides physics. Override OimoPhysics Functions with own rendering. Initialize buffers and connect them with the context for later use.

      Returns PhysicsDebugDraw

    Properties

    gl: WebGL2RenderingContext
    lineData: number[]
    lineIboData: number[]
    numLineData: number
    numPointData: number
    numTriData: number
    oimoDebugDraw: DebugDraw
    pointData: number[]
    pointIboData: number[]
    program: WebGLProgram
    style: DebugDrawStyle
    triData: number[]
    triIboData: number[]
    texColor: WebGLTexture
    texDepthStencil: WebGLTexture
    texNormal: WebGLTexture
    texPosition: WebGLTexture

    Methods

    • Before OimoPhysics.world is filling the debug. Make sure the buffers are reset. Also receiving the debugMode from settings and updating the current projection for the vertexShader.

      Returns void

    • After OimoPhysics.world filled the debug. Rendering calls. Setting this program to be used by the FUDGE rendering context. And draw each updated buffer and resetting them.

      Returns void

    • Creating the empty render buffers. Defining the attributes used in shaders. Needs to create empty buffers to already have them ready to draw later on, linking is only possible with existing buffers.

      Returns void

    • Receive the current DebugMode from the physics settings and set the OimoPhysics.DebugDraw booleans to show only certain informations. Needed since some debug informations exclude others, and can't be drawn at the same time, by OimoPhysics. And for users it provides more readability to debug only what they need and is commonly debugged.

      Parameters

      Returns void

    • Add an event listener to targetStatic.

      Parameters

      • _type: string
      • _handler: EventListener
      • Optional_options: boolean | AddEventListenerOptions

      Returns void

    • Checks the first parameter and throws an exception with the WebGL-errorcode if the value is null

      Type Parameters

      • T

      Parameters

      • _value: T

        value to check against null

      • _message: string = ""

        optional, additional message for the exception

      Returns T

    • Clear the offscreen renderbuffer with the given Color

      Parameters

      • Optional_color: Color
      • _colors: boolean = true
      • _depth: boolean = true
      • _stencil: boolean = true

      Returns void

    • Initializes offscreen-canvas, renderingcontext and hardware viewport. Call once before creating any resources like meshes or shaders

      Parameters

      • Optional_antialias: boolean
      • Optional_alpha: boolean

      Returns WebGL2RenderingContext

    • Remove an event listener from targetStatic.

      Parameters

      • _type: string
      • _handler: EventListener
      • Optional_options: boolean | AddEventListenerOptions

      Returns void

    • Enable / Disable WebGLs scissor test.

      Parameters

      • _test: boolean
      • Optional_x: number
      • Optional_y: number
      • Optional_width: number
      • Optional_height: number

      Returns void