singularity1 / native /unreal /Source /Singularity /SingularitySpacetimeBridge.h
sankalphs's picture
Deploy browser app plus Blender and Unreal handoff
511a267 verified
Raw History Blame Contribute Delete
1.4 kB
#pragma once
#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "SingularityRoleTypes.h"
#include "SingularitySpacetimeBridge.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSingularityInputReady, const FSingularityRoleInput&, Input);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSingularitySnapshotReady, const FSingularityTeamSnapshot&, Snapshot);
/**
* Small engine-side seam for the existing SpacetimeDB contract.
*
* The production browser client submits bounded x/z/action inputs and receives
* authoritative team snapshots. An Unreal transport can bind to these events
* without ever accepting a client pose, checkpoint, or finish time.
*/
UCLASS(BlueprintType)
class SINGULARITY_API USingularitySpacetimeBridge : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintAssignable)
FSingularityInputReady OnInputReady;
UPROPERTY(BlueprintAssignable)
FSingularitySnapshotReady OnSnapshotReady;
UFUNCTION(BlueprintCallable, Category = "Singularity|Network")
void SubmitRoleInput(ESingularityBodyRole Role, float X, float Z, bool bAction, int64 ClientTick);
UFUNCTION(BlueprintCallable, Category = "Singularity|Network")
void ApplyTeamSnapshot(const FSingularityTeamSnapshot& Snapshot);
UFUNCTION(BlueprintPure, Category = "Singularity|Network")
static FString RoleToWireName(ESingularityBodyRole Role);
};