// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "Link.h" #include "GameFramework/Actor.h" #include "Robot.generated.h" UCLASS() class PBDROBOTICS_API ARobot : public AActor { GENERATED_BODY() public: ARobot(); protected: virtual void BeginPlay() override; UPROPERTY() TArray Links = TArray(); UPROPERTY() TArray Joints = TArray(); UFUNCTION(BlueprintCallable) void Connect(ULink* L1, ULink* L2); UPROPERTY(BlueprintReadWrite) bool HasGravity = false; UFUNCTION(BlueprintCallable) ULink* GetEffector() const; UFUNCTION(BlueprintNativeEvent) void GetEffectorForce(FVector& Translation, FVector& Rotation); private: // Assumes First Link to have Identity Orientation and Joints Array to be in order void ResetPositionAndOrientation(); public: virtual void Tick(float DeltaTime) override; };