Bitbybit Docs
    Preparing search index...
    Index

    Constructors

    • Parameters

      • OptionalsourceMesh: AbstractMesh
      • Optionaltexture: BaseTexture
      • Optionalposition: Point3
      • Optionalnormal: Vector3
      • Optionalsize: Vector3
      • Optionalangle: number
      • OptionalcullBackFaces: boolean
      • OptionallocalMode: boolean
      • OptionalzOffset: number

      Returns CreateMeshDecalDto

    Properties

    sourceMesh: AbstractMesh

    Mesh to project the decal onto. The decal is created as a clipped child mesh hugging the surface.

    undefined
    
    texture: BaseTexture

    Image texture to project. Create it via texture image, and keep an alpha channel for cutout decals.

    undefined
    
    position: Point3

    Position of the decal projector in world coordinates. Often picked from a ray/pick hit on the mesh.

    [0, 0, 0]
    
    normal: Vector3

    Direction the decal is projected along, in world coordinates. Usually the surface normal at the hit point.

    [0, 1, 0]
    
    size: Vector3

    Size of the decal box on each axis. The third value is the projection depth.

    [1, 1, 1]
    
    angle: number

    Angle to rotate the decal around the projection direction, in radians.

    0
    

    0.1

    cullBackFaces: boolean

    Remove back faces from the decal mesh so it only sticks to faces pointing towards the projector.

    true
    
    localMode: boolean

    Compute the decal using the local mesh coordinates instead of world space. Useful when the source mesh is transformed.

    false
    
    zOffset: number

    Depth bias used to avoid z-fighting between the decal and the surface. Negative values push the decal towards the camera.

    -2
    

    0.5