#pragma once #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "DescentArmDebugRig.generated.h" class UCameraComponent; class UDescentArmViewmodelComponent; class UPointLightComponent; class UStaticMeshComponent; UENUM() enum class EDescentArmRigMode : uint8 { Showcase, // the arm on a stand in the dark, lit, seen from outside (no first-person settings, shadows on) FirstPerson, // the arm mounted on the rig's own camera at eye height, facing a wall with a nutrient port }; /** * A stand-in for the character, for looking at the arm alone and for the arm's own scenarios. It owns one * UDescentArmViewmodelComponent, its lights (the game's unitless light convention; exposure and water are ADescentEnvironment's, * as everywhere), an eye-height camera with the game's field of view, and a wall with a blockout nutrient port at the design's * socket height. * Not part of the game: only the scenarios `arm_showcase`, `arm_jack` and the command `Descent.Arm.Rig` spawn it. */ UCLASS() class THEDESCENT_API ADescentArmDebugRig : public AActor { GENERATED_BODY() public: ADescentArmDebugRig(); static ADescentArmDebugRig* Find(UWorld* World); /** The existing rig, or a new one at LocationCm (world). Either way it is put in InMode. */ static ADescentArmDebugRig* FindOrSpawn(UWorld* World, EDescentArmRigMode InMode, const FVector& LocationCm = FVector::ZeroVector); void SetMode(EDescentArmRigMode InMode); EDescentArmRigMode GetMode() const { return Mode; } UDescentArmViewmodelComponent* GetArm() const { return Arm; } UCameraComponent* GetCamera() const { return Camera; } /** The socket of the blockout port (where the middle fingertip goes) and the way the hand moves into it, in the world. */ FVector GetPortWorldCm() const; FVector GetPlugDirectionWorld() const; /** The shoulder of the showcase stand in the world, cm. */ FVector GetShowcaseShoulderWorldCm() const; /** Makes the rig's eye camera the player's view (first-person mode). */ void TakeView(); /** Starts the jack-in against the rig's own port. */ bool StartJack(); protected: virtual void OnConstruction(const FTransform& Transform) override; private: UPROPERTY(VisibleAnywhere, Category = "Arm Rig") TObjectPtr Stand; UPROPERTY(VisibleAnywhere, Category = "Arm Rig") TObjectPtr Camera; UPROPERTY(VisibleAnywhere, Category = "Arm Rig") TObjectPtr Arm; /** Showcase lights: key (front, above, right), fill (left, low), rim (behind). */ UPROPERTY(VisibleAnywhere, Category = "Arm Rig") TObjectPtr Key; UPROPERTY(VisibleAnywhere, Category = "Arm Rig") TObjectPtr Fill; UPROPERTY(VisibleAnywhere, Category = "Arm Rig") TObjectPtr Rim; /** First person: a ceiling lamp behind the viewer and the port's own glow. */ UPROPERTY(VisibleAnywhere, Category = "Arm Rig") TObjectPtr Room; UPROPERTY(VisibleAnywhere, Category = "Arm Rig") TObjectPtr PortGlow; /** Wall, the port's socket plate and the four bars of its collar. */ UPROPERTY(VisibleAnywhere, Category = "Arm Rig") TArray> WallParts; /** One colour per wall part, in the same order (set by the constructor). */ TArray WallColors; EDescentArmRigMode Mode = EDescentArmRigMode::Showcase; };