Skip to content
TREN
Atlıhan Harita

LCC for UE User Manual · API Reference

ULCCComponent: LCC Pipeline Component

Chapter 25.3 / 26Manual version v3.5.0English

Component specific to the LCC1 pipeline, inheriting ULCCComponentBase. On top of the base class capabilities it adds ray tests based on splat positions, plus seam cutting.

ModuleLCC4UnrealRuntime
HeaderLCCComponent.h
Parent classULCCComponentBase
Held byALCCActor
#include "LCCComponent.h"

Get the instance:

ULCCComponent* Comp = Cast<ULCCComponent>(LCCActor->GetLCCComponent());

Properties

PropertyTypeDefaultDescription
bEnableSeamCuttingboolfalseEnables seam cutting manually, see Seam Cutting. LCC file version 5.0 and above needs no manual activation and enables it automatically
LCCPerformanceFLCCRenderInfo—LCC1-specific performance parameters, see the table below

MetaInfo (of type FLCCMetaInfo) is a protected member, not accessible from outside on the C++ side and only visible to Blueprint (read-only in the Details panel). In C++ use GetMetaInfo() on the base class to read the basic fields.

LCCPerformance

Also in the form of a checkbox plus a value, using the default from the project settings while the checkbox is off.

FieldTypeDefaultCheckboxDescription
SortFactorfloat1bCanSetSortFactorSort frequency scale factor, from 0.2 to 5, see Sort Factor
bAddExtraPreNodesbooltruebEnableExtraPreNodesAdds extra preload nodes, see Add Extra Preload Nodes
ULCCComponent* Comp = Cast<ULCCComponent>(LCCActor->GetLCCComponent());
if (Comp)
{
    // sort less often to save performance
    Comp->LCCPerformance.bCanSetSortFactor = true;
    Comp->LCCPerformance.SortFactor = 2.0f;

    // head turns are fast in VR, add preload nodes
    Comp->LCCPerformance.bEnableExtraPreNodes = true;
    Comp->LCCPerformance.bAddExtraPreNodes = true;
}

Methods

GetUseSeamCut

bool GetUseSeamCut() const;

Whether the shader has seam cutting enabled. Returns true when either condition holds: the LCC file version is 5.0 or above, or bEnableSeamCutting was enabled manually. C++ only.

Multi-Viewport

The multi-viewport interfaces (SetPlayerLoadMode, SetPlayerRenderMode, SetSceneCaptureLoadMode, SetSceneCaptureRenderMode, ModifyPlayerTransform, CancelModifyPlayerTransform) are declared on the base class ULCCComponentBase and are supported by both the LCC1 and LCC2 pipelines.

For the use cases and the steps, see Best Practices - Per-camera Independent Rendering.

Raycast

⚠️ This group of interfaces is not sufficiently tested and may not work as expected. In production, use the "enable collision plus engine ray test" approach instead: load the collision data with SetLCCCollisionEnable first, then test with engine interfaces such as LineTraceByChannel. See Collision for details.

LCC1 provides four ray test functions targeting splat positions. The test target is the point cloud data itself and no collision file is required.

The four functions fall into two groups, differing along two dimensions:

Single hitMultiple hits
Default radius (10 cm)LineTraceSingleLineTraceMulti
Custom radiusLineTraceSingleWithRadiusLineTraceMultiWithRadius

Debug parameters shared by all four:

ParameterTypeDescription
Startconst FVector&Ray start, in world coordinates
Endconst FVector&Ray end, in world coordinates
bDrawDebugLineboolWhether to draw the debug line
DurationfloatDebug line duration, in seconds
ThicknessfloatDebug line thickness

Note: these four functions are protected on the C++ side and can be called as nodes directly on the Blueprint side. In C++ use them inside a subclass of ULCCComponent, or switch to the ray tests provided by the engine.

Recommendation

Prefer collision bodies plus engine ray tests. From v0.6.0 on, once the data carries a collision file and collision is enabled, LineTraceByChannel returns a complete FHitResult (normal, material, hit component, and more), works seamlessly with the engine physics, AI, and navigation systems, and that path is thoroughly validated.

The dedicated interfaces here are only worth considering in the following cases, and require thorough testing of your own:

  • The data has no collision file and switching to data with collision is not possible.
  • The node information of the hit point is required (FLCCSplat::NodeVector gives X, Y, and Level).

LineTraceSingle

UFUNCTION(BlueprintCallable, Category = "XGrids|Raycast")
bool LineTraceSingle(const FVector& Start, const FVector& End, FLCCSplat& OutHit,
                     bool bDrawDebugLine, float Duration, float Thickness) const;

Single ray test, returning the nearest hit point. The test radius is fixed at 10 cm.

ParameterTypeDescription
OutHitFLCCSplat&Output hit information, containing the world position Location and the node information NodeVector

Returns bool: true on a hit.

// inside a subclass of ULCCComponent
void UMyLCCComponent::PickFromCamera(const FVector& CamLocation, const FVector& CamForward)
{
    const FVector Start = CamLocation;
    const FVector End = Start + CamForward * 10000.f;

    FLCCSplat Hit;
    if (LineTraceSingle(Start, End, Hit, true, 2.0f, 2.0f))
    {
        UE_LOG(LogTemp, Log, TEXT("Hit at %s, node %s"),
            *Hit.Location.ToString(), *Hit.NodeVector.ToString());
    }
}

Blueprint as text, picking with a mouse click:

[Input Action: Pick]
        │ Pressed
        ▼
[Get Player Camera Manager] ──▶ [Get Camera Location]  → Start
                            └─▶ [Get Actor Forward Vector]
                                        │
                                        ▼
                                [Multiply] (× 10000)
                                        │
                                        ▼
                                [Add] (Start + previous step) → End
        │
        ▼
[Line Trace Single]
        Target = (LCC Component)
        Start = Start
        End = End
        Draw Debug Line = true
        Duration = 2.0
        Thickness = 2.0
        │ Return Value ──┐
        ▼                │
[Branch] ◀───────────────┘
        │ True
        ▼
[Break LCCSplat]  ← wired to Out Hit
        Location → used to place a marker

LineTraceSingleWithRadius

UFUNCTION(BlueprintCallable, Category = "XGrids|Raycast")
bool LineTraceSingleWithRadius(const FVector& Start, const FVector& End, float Radius,
                               FLCCSplat& OutHit, bool bDrawDebugLine,
                               float Duration, float Thickness) const;

Single ray test with a configurable test radius.

ParameterTypeDescription
RadiusfloatTest radius, in centimeters

Usage notes:

  • A point cloud is discrete, and a radius that is too small easily passes through the gaps between points, so nothing is hit even while pointing straight at an object. Increase the radius in that case.
  • A larger radius hits more easily but lowers precision, and the returned point may deviate from the position actually intended.
  • Start from 20~50 cm for sparse data; 5~10 cm is enough for dense data.
FLCCSplat Hit;
// large radius for a sparse point cloud, raising the hit rate
if (LineTraceSingleWithRadius(Start, End, 30.0f, Hit, false, 0.f, 0.f))
{
    SpawnMarkerAt(Hit.Location);
}

LineTraceMulti

UFUNCTION(BlueprintCallable, Category = "XGrids|Raycast")
bool LineTraceMulti(const FVector& Start, const FVector& End,
                    bool bDrawDebugLine, float Duration, float Thickness,
                    TArray<FLCCSplat>& OutHits) const;

Multi ray test, returning every hit point along the path. The test radius is fixed at 10 cm.

ParameterTypeDescription
OutHitsTArray<FLCCSplat>&Output of every hit point

Usage notes:

  • Use it for penetrating tests, for example measuring how many layers of structure a line passes through, or doing cross-section analysis.
  • The number of hit points can be large, so avoid calling it every frame.
TArray<FLCCSplat> Hits;
if (LineTraceMulti(Start, End, true, 3.0f, 1.0f, Hits))
{
    UE_LOG(LogTemp, Log, TEXT("Passed through %d splats"), Hits.Num());

    for (const FLCCSplat& Hit : Hits)
    {
        DrawDebugPoint(GetWorld(), Hit.Location, 8.f, FColor::Yellow, false, 3.f);
    }
}

LineTraceMultiWithRadius

UFUNCTION(BlueprintCallable, Category = "XGrids|Raycast")
bool LineTraceMultiWithRadius(const FVector& Start, const FVector& End, float Radius,
                              bool bDrawDebugLine, float Duration, float Thickness,
                              TArray<FLCCSplat>& OutHits) const;

Multi ray test with a configurable test radius. The parameters mean the same as above.

A larger radius increases the number of hit points noticeably, which suits statistical needs such as estimating the point density inside a cylindrical range.

FLCCSplat

USTRUCT(BlueprintType)
struct FLCCSplat
{
    FVector Location;         // world coordinates of the hit point
    FLCCVector NodeVector;    // node the hit point belongs to
};

The X, Y, and Level fields of FLCCVector locate the node in the octree. Level reflects the detail level currently loaded at that spot, which tells whether the data being looked at is fine or coarse.

For the complete fields see Structs.

See Also

This chapter is from the official XGRIDS user manual. Official source (opens in a new tab) · Updated:

XGRIDS Türkiye

We're With You During Setup and in the Field

Atlıhan Harita provides training and technical support for device setup, firmware updates, software use, and field applications. Send us your question and our specialist will get back to you.

+90 216 546 0804