Skip to main content

TextureObject

Represents a single object (hence a single pixel) in the GPU picking texture. Should be created by calling to Materials.createGpuTextureObject instead of using constructor directly.

Index

Properties

publicreadonlyid

id: number

Unique object identifier (represents location in GPU picking texture).

publicstaticreadonlyIsNotIfcProductFlag

IsNotIfcProductFlag: 65536 = 65536

0b10000000000000000; Bit 16 is set to 1 indicates that its not a IFC product this is used in shaders that tell whether the object being rendered is a IFC product or not.

Accessors

publiccolor

  • get color(): Color4
  • Gets the color of the texture object (pixel).


    Returns Color4

Methods

assignGpuPickingMaterial

  • assignGpuPickingMaterial(mesh: Mesh): void
  • Replaces the material on the mesh with a GPU picking material. Combined with a call to assignUVKind this will ensure that the mesh is rendered with a unique color.


    Parameters

    • mesh: Mesh

      Mesh to relace material on.

    Returns void

assignUVKind

  • assignUVKind(mesh: Mesh): void
  • Replaces the UV coordiates on the specified mesh. Combined with a call to assignGpuPickingMaterial this will make sure that the mesh is rendered with a unique color.


    Parameters

    • mesh: Mesh

      Mesh to replace UV coordinates on.

    Returns void

buildGpuPickable

  • buildGpuPickable(mesh: Mesh): void
  • Replaces both material and UV coordinates on the specified mesh. Ensures that the mesh is rendered with a unique color.


    Parameters

    • mesh: Mesh

      Mesh to render with a unique color.

    Returns void

dispose

  • dispose(): void
  • Releases the resource that ensures that this TextureObject has a unique color. This makes it possible to create new TextureObject that represents this resource. This does not mean that any mesh that was modified by assignUVKind, assignGpuPickingMaterial or buildGpuPickable is restored in any way. They will still have the same UV coordinates and material. It is up to the caller to ensure that the mesh gets other values if needed. Same thing as calling Materials.deleteGpuTextureObject(this).


    Returns void