Solving Inverse-Kinematic Problem for PUMA via Position Based Dynamics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 lines
966 B

// 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(BlueprintReadWrite)
TArray<ULink*> Links = TArray<ULink*>();
UPROPERTY(BlueprintReadWrite)
TArray<UJoint*> Joints = TArray<UJoint*>();
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;
};