SceneObjectRectangle

Extends: SceneObjectBillboard

Draws a DrawableRectangle. Extends SceneObjectBillboard, so a rectangle orients and foreshortens in 3D in the oriented draw modes and stays screen-aligned in the direct ones, exactly like an image does.

Unlike an image, though, a rectangle has no texture to sample: it's a single flat color. So filling the projected quad (or tinting a shared white column texture) is all it needs, and DrawableRectangle never has to hold a bitmap of its own. This is how SceneObjectPolygon draws, for the same reason.

It does still cache that fill into a temp bitmap in the oriented draw modes, exactly like a polygon: filling a rotated quad means rasterizing two triangles through scratch bitmaps, which is far too expensive to repeat every frame for an object that hasn't moved. In the direct (billboard) draw modes there's nothing worth caching - the draw is already a single DrawRect - so those skip the temp bitmap entirely.

Properties


Constructor

new SceneObjectRectangle( name: string, drawableObj: DrawableRectangle, ): SceneObjectRectangle

Parameters


Instance Methods

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

Parameters

Returns

  • Array.<BGE.Math.Vector>

getBoundingSphere(): BGE.Math.BoundingSphere

Returns

  • BGE.Math.BoundingSphere

usesTempBitmap(drawMode: SceneObjectDrawMode): boolean

protected

Parameters

Returns

  • boolean

canDrawAsColumns(drawMode: SceneObjectDrawMode): boolean

protected

Parameters

Returns

  • boolean

getColumnTexture( rendererObj: BGE.Renderer, ): BGE.QuadColumnTexture

protected

Parameters

Returns

didRegionToDrawChange(): boolean

protected

Returns

  • boolean

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

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

protected

Parameters

Returns

  • boolean

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

protected

Parameters

Returns

  • boolean

needsCanvasCornerPoints(): boolean

protected

Returns

  • boolean

needsManualPretranslationForDirectMode(): boolean

protected

Returns

  • boolean

isEligibleForStaticBsp(): boolean

Returns

  • boolean

isEligibleOccluderType(): boolean

Returns

  • boolean

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

protected

Parameters

Returns

  • float

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

protected

Parameters

Returns

canOccludeThisFrame(rendererObj: Renderer): boolean

protected

Parameters

Returns

  • boolean