SceneObjectBillboard

Extends: SceneObject

Properties

  • worldPoints (BGE.Math.CornerPoints)
  • canvasPoints (BGE.Math.CornerPoints)
  • canvasPosition (BGE.Math.Vector)
  • useTempBitmapMap (Array.<boolean>)
  • usedTransformedFastDrawLastFrame (boolean) — Whether the most recent oriented/solid draw took the cheap rotate+scale fast path

Constructor

new SceneObjectBillboard( name: string, drawableObj: Drawable, objType: SceneObjectType, ): SceneObjectBillboard

Parameters


Instance Methods

performDraw( rendererObj: BGE.Renderer, drawMode: SceneObjectDrawMode, ): boolean

protected

Parameters

Returns

  • boolean

isRedrawToCanvasRequired( rendererObj: BGE.Renderer, drawMode: SceneObjectDrawMode, ): boolean

protected

Parameters

Returns

  • boolean

usedTransformedFastDraw(): boolean

For tests/telemetry only - see usedTransformedFastDrawLastFrame above.

Returns

  • boolean

isEligibleForFastDrawCheck( drawMode: SceneObjectDrawMode, ): boolean

protected

Parameters

Returns

  • boolean

canUseTransformedFastDraw(): boolean

protected

Returns

  • boolean

drawFastPath( rendererObj: BGE.Renderer, drawMode: SceneObjectDrawMode, ): boolean

protected

Parameters

Returns

  • boolean

usesTempBitmap(drawMode: SceneObjectDrawMode): boolean

protected

Parameters

Returns

  • boolean

getTempBitmapCapacity(): BGE.Math.Vector

For tests/telemetry only - the backing temp bitmap's actual allocated size, which can be larger than this frame's own footprint (see createTempBitmap()'s grow-only reuse comment).

Returns

  • BGE.Math.Vector — {x: width, y: height}, or invalid if there's no temp bitmap

createTempBitmap( canvasBounds: Array.<BGE.Math.Vector>, rendererObj: Renderer, drawMode: SceneObjectDrawMode, allowFastDraw?: boolean, ): roBitmap

protected

Parameters

  • canvasBounds (Array.<BGE.Math.Vector>)
  • rendererObj (Renderer)
  • drawMode (SceneObjectDrawMode)
  • allowFastDraw (boolean, optional, default: false)

Returns

  • roBitmap

drawToCanvas( rendererObj: BGE.Renderer, drawMode: SceneObjectDrawMode, ): boolean

protected

Parameters

Returns

  • boolean

drawRegionAsRotatedQuad( rendererObj: BGE.Renderer, regionObj: roRegion, quad: BGE.Math.CornerPoints, color: integer, ): boolean

protected

Parameters

  • rendererObj (BGE.Renderer)
  • regionObj (roRegion)
  • quad (BGE.Math.CornerPoints)
  • color (integer)

Returns

  • boolean

drawOutlineToCanvas( rendererObj: BGE.Renderer, drawMode: SceneObjectDrawMode, ): boolean

protected

Parameters

Returns

  • boolean

getOutlineCanvasPoints(): Array.<BGE.Math.Vector>

protected

Returns

  • Array.<BGE.Math.Vector>

getCanvasBounds(): Array.<BGE.Math.Vector>

protected

Returns

  • Array.<BGE.Math.Vector>

getAllCanvasPoints(): Array.<BGE.Math.Vector>

protected

Returns

  • Array.<BGE.Math.Vector>

getRegionWithIdToDraw( rendererObj: BGE.Renderer, ): BGE.RendererHelpers.RegionWithId

protected

Parameters

Returns

  • BGE.RendererHelpers.RegionWithId

drawToTempBitmap( rendererObj: BGE.Renderer, tempBitmap: ifDraw2d, canvasPointsTopLeftBound: BGE.Math.Vector, drawMode: SceneObjectDrawMode, allowFastDraw?: boolean, ): TempBitmapDrawResult

protected

Parameters

  • rendererObj (BGE.Renderer)
  • tempBitmap (ifDraw2d)
  • canvasPointsTopLeftBound (BGE.Math.Vector)
  • drawMode (SceneObjectDrawMode)
  • allowFastDraw (boolean, optional, default: false)

Returns

getPinnedCornersOptions(): DrawPinnedCornersOptions

protected

Returns

didRegionToDrawChange(): boolean

protected

Returns

  • boolean

getDrawColorRGBA( rendererObj: BGE.Renderer, ignoreColor?: boolean, ): integer

protected

Parameters

  • rendererObj (BGE.Renderer)
  • ignoreColor (boolean, optional, default: false)

Returns

  • integer

getShadedColorRGBA(rendererObj: BGE.Renderer): integer

For tests/telemetry only - the fill color actually used for the most recent draw, including the isShaded brightness adjustment (see applyShading()/ambientBrightness).

Parameters

Returns

  • integer — packed RGBA color

getOutlineDrawColorRGBA( rendererObj: BGE.Renderer, ignoreColor?: boolean, ): integer

protected

Parameters

  • rendererObj (BGE.Renderer)
  • ignoreColor (boolean, optional, default: false)

Returns

  • integer

getNetRotationZ(): float

protected

Returns

  • float

updateWorldPosition(drawMode: SceneObjectDrawMode): boolean

protected

Parameters

Returns

  • boolean

getPositionForCameraDistance( drawMode: SceneObjectDrawMode, ): BGE.Math.Vector

Parameters

Returns

  • BGE.Math.Vector

getPositionsForFrustumCheck( drawMode: SceneObjectDrawMode, ): Array.<BGE.Math.Vector>

protected

Parameters

Returns

  • Array.<BGE.Math.Vector>

computeBillboardWorldCorners(): Array.<BGE.Math.Vector>

protected

Returns

  • Array.<BGE.Math.Vector>

findCanvasPosition( rendererObj: Renderer, drawMode: SceneObjectDrawMode, ): boolean

protected

Parameters

Returns

  • boolean

updateCanvasPosition( rendererObj: Renderer, drawMode: SceneObjectDrawMode, ): boolean

protected

Parameters

Returns

  • boolean

needsCanvasCornerPoints(): boolean

protected

Returns

  • boolean

needsManualPretranslationForDirectMode(): boolean

protected

Returns

  • boolean

getCanvasPosition(): BGE.Math.Vector

The top-left canvas point this billboard's screen-aligned (direct/directScaled) draw modes last positioned at, or invalid before the first successful draw.

Returns

  • BGE.Math.Vector

getWorldPoints(): BGE.Math.CornerPoints

Returns

  • BGE.Math.CornerPoints

getCanvasPoints(): BGE.Math.CornerPoints

The canvas corner points this billboard last computed - populated for a rotated or outlined direct-mode object (see needsCanvasCornerPoints()), or any oriented one.

Returns

  • BGE.Math.CornerPoints

updateCanvasPointsForDirectMode(): void

protected

Returns

  • void

updateCanvasPointsForCameraFacingQuad( rendererObj: Renderer, ): boolean

protected

Parameters

Returns

  • boolean

getDirectModeCanvasSize(): SizeWH

protected

Returns

computeNormalDebugInfo(rendererObj: Renderer): void

protected

Parameters

Returns

  • void

getNormalDebugPoint(): BGE.Math.Vector

protected

Returns

  • BGE.Math.Vector

attemptTransformTempBitmap( renderObj: Renderer, drawMode: SceneObjectDrawMode, ): TransformTempBitmapDetails

protected

Parameters

Returns

doNotDrawBecauseBackFace(drawMode: SceneObjectDrawMode): boolean

protected

Parameters

Returns

  • boolean

isDeterministicDrawFailure( rendererObj: Renderer, drawMode: SceneObjectDrawMode, ): boolean

protected

Parameters

Returns

  • boolean

getTempBitmapThreshold(drawMode: SceneObjectDrawMode): integer

protected

Parameters

Returns

  • integer