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

markSkippedOccluded(cameraObj: Camera): void

Parameters

Returns

  • void

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

getRotatedQuadBlit(quad: BGE.Math.CornerPoints): RotatedQuadBlit

protected

Parameters

  • quad (BGE.Math.CornerPoints)

Returns

getRotatedQuadPaintedCorners( quad: BGE.Math.CornerPoints, ): Array.<BGE.Math.Vector>

protected

Parameters

  • quad (BGE.Math.CornerPoints)

Returns

  • Array.<BGE.Math.Vector>

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

getCanvasDrawColorRGBA(rendererObj: BGE.Renderer): integer

protected

Parameters

Returns

  • integer

getCanvasOutlineDrawColorRGBA( rendererObj: BGE.Renderer, ): integer

protected

Parameters

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>

canBeOccluded(): boolean

Returns

  • boolean

getPositionsForOcclusionTest( cameraObj: Camera, 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

getCameraFacingQuadWorldCorners( cameraObj: Camera, ): Array.<BGE.Math.Vector>

protected

Parameters

Returns

  • Array.<BGE.Math.Vector>

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

appendOccluderPolygons( rendererObj: Renderer, out: Array.<BGE.OccluderPolygon>, ): void

Parameters

Returns

  • void

getOccluderClaim( rendererObj: Renderer, drawMode: SceneObjectDrawMode, canvasQuad: BGE.Math.CornerPoints, depth: float, ): BGE.OccluderPolygon

protected

Parameters

Returns

getOccluderInset( rendererObj: Renderer, drawMode: SceneObjectDrawMode, ): float

protected

Parameters

Returns

  • float

getCoarseFillInset( rendererObj: Renderer, drawMode: SceneObjectDrawMode, ): float

protected

Parameters

Returns

  • float

mayReuseTransformedTempBitmap( drawMode: SceneObjectDrawMode, ): boolean

protected

Parameters

Returns

  • boolean

projectOccluderPolygon( rendererObj: Renderer, worldOutline: Array.<BGE.Math.Vector>, inset?: float, ): BGE.OccluderPolygon

protected

Parameters

  • rendererObj (Renderer)
  • worldOutline (Array.<BGE.Math.Vector>)
  • inset (float, optional, default: 0)

Returns

newOccluderPolygon( canvasOutline: Array.<BGE.Math.Vector>, depth: float, inset: float, ): BGE.OccluderPolygon

protected

Parameters

  • canvasOutline (Array.<BGE.Math.Vector>)
  • depth (float)
  • inset (float)

Returns

newOccluderPolygonFromXY( xs: Array.<float>, ys: Array.<float>, depth: float, inset: float, ): BGE.OccluderPolygon

protected

Parameters

  • xs (Array.<float>)
  • ys (Array.<float>)
  • depth (float)
  • inset (float)

Returns

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

protected

Parameters

Returns

  • boolean

getTempBitmapThreshold(drawMode: SceneObjectDrawMode): integer

protected

Parameters

Returns

  • integer