BGE/RendererHelpers

Alias: BGE.RendererHelpers


Static Methods

createTriangleBitmap( bitmap: ifDraw2d, points: dynamic, ): TriangleBitmap

static

Parameters

  • bitmap (ifDraw2d)
  • points (dynamic)

Returns

createRegionWithId(region: roRegion, id?: string): RegionWithId

static

Parameters

  • region (roRegion)
  • id (string, optional, default: "\"\"")

Returns

growOrClearBitmap( existing: roBitmap, width: integer, height: integer, ): roBitmap

static

Returns existing, cleared and ready for reuse, if it's already at least widthxheight - or a freshly allocated bitmap otherwise. Grow-only reuse avoids a fresh CreateObject() every single frame an object's projected size merely shifts slightly, only reallocating once the existing bitmap has actually been outgrown - shared by SceneObjectBillboard.createTempBitmap and SceneObjectModel.drawFaceWithReuse.

Parameters

  • existing (roBitmap) — the previously cached bitmap, or invalid if there is none yet
  • width (integer)
  • height (integer)

Returns

  • roBitmap — invalid if allocation failed

Other

TriangleBitmap

static

Properties

  • bitmap (ifDraw2d)
  • triangle (BGE.Math.Triangle)
  • scratchRegion (BGE.ScratchRegion)
  • scale (BGE.Math.Vector)

RegionWithId

static

Properties

  • region (roRegion)
  • id (string)

FaceRasterCache

static

One SceneObjectModel face's own small rendered raster, reused as-is (repositioned to wherever the face's projected position actually is this frame, content unchanged) for a bounded number of frames before a real redraw - see issue #163. Only the pixel CONTENT is ever stale, never the blit position, so there's no geometric transform to get right here - a stale frame just shows this face's texture at last redraw's orientation, correctly placed at this frame's position.

Properties

  • bitmap (roBitmap)
  • staleFrameCount (integer)
  • triangleAtCapture (dynamic) — This face's own 3 canvas-space vertices as of the last real redraw - compared ' against the current frame's vertices to bound how far a face may drift while ' still reusing stale pixel content (see SceneObjectModel.drawFaceWithReuse()).

LimitPointMappings

static

These are limits in screen space origin top /
/
/ >right left < / \ / \ / bottom opposite

Baseline angle is the average angle from [left-right, top-bottom]

Parameters

  • points (dynamic)
  • screenSpace (boolean, optional, default: true)

Properties

  • totalPointCount (integer)
  • leftIndex (integer)
  • rightIndex (integer)
  • topIndex (integer)
  • bottomIndex (integer)
  • left (BGE.Math.Vector)
  • right (BGE.Math.Vector)
  • top (BGE.Math.Vector)
  • bottom (BGE.Math.Vector)
  • origin (BGE.Math.Vector)
  • opposite (BGE.Math.Vector)
  • baselineAngle (float)
  • width (float)
  • height (float)

Returns

  • BGE.RendererHelpers.LimitPointMappings

LimitPoints2d

static

Properties

  • left (BGE.Math.Vector)
  • right (BGE.Math.Vector)
  • top (BGE.Math.Vector)
  • bottom (BGE.Math.Vector)