#Heya. Question related to

1 messages · Page 1 of 1 (latest)

digital solstice
#

`void UGeometryCollectionBlueprintLibrary::LogChunkStates(UGeometryCollectionComponent* GCComp, const FString& Label)
{
if (!GCComp || !GCComp->GetRestCollection())
{
UE_LOG(LogTemp, Warning, TEXT("[%s] Invalid Geometry Collection Component"), *Label);
return;
}

const TSharedPtr<FGeometryCollection, ESPMode::ThreadSafe> Collection = GCComp->GetRestCollection()->GetGeometryCollection();
if (!Collection.IsValid())
{
    UE_LOG(LogTemp, Warning, TEXT("[%s] Geometry Collection asset is invalid"), *Label);
    return;
}
if (!GCComp)
    return;

FGeometryCollectionPhysicsProxy* Proxy = GCComp->GetPhysicsProxy();

if (!Proxy)
{
    return;
}

FGeometryDynamicCollection& DynamicCollection = Proxy->GetPhysicsCollection();

const int32 NumTransforms = DynamicCollection.NumElements(FGeometryCollection::TransformGroup);

const FGeometryCollectionDynamicStateFacade DynamicStateFacade(DynamicCollection);

UE_LOG(LogTemp, Log, TEXT("---- Geometry Collection State Dump (%s) ----"), *Label);

for (int32 idx = 0; idx < NumTransforms; idx++)
{
    bool brokenOff = (DynamicStateFacade.HasBrokenOff(idx));
    bool bActive = (DynamicStateFacade.IsActive(idx));

    UE_LOG(LogTemp, Log, TEXT("[%s] Chunk %d Broken: %s Active: %s"), *Label, idx, (brokenOff) ? TEXT("Yes") : TEXT("No"), (bActive) ? TEXT("Yes") : TEXT("No"));
}

UE_LOG(LogTemp, Log, 
    TEXT("---- End GC Dump (%s) GCComp (%p) Proxy (%p) ----"), 
    *Label, 
    (void*)GCComp, 
    (void*)Proxy);

}`

#

This "works" but doesn't show any different "broken" state after i make different chunks disappear from a given geometry mesh. the output is the same, which makes me wonder if I'm not understanding it correctly.

digital solstice
#

To clarify, by "works", I isolate one actor in a test map, i emit this code and all the chunks are "not broken or active". If I change even a small section (say, one part on the side of the geometry), I see almost all the chunks are "broken and active", not all but most. That seems way off, probably because I'm not understanding the bone connection.