Models need to have Sockets "JointPrev" and "JointNext" for information about joint position and rotation axis.main
parent
3106c65f98
commit
61f5e7ae40
15 changed files with 202 additions and 48 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,8 @@ |
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "Joint.h" |
||||||
|
|
||||||
|
UJoint::UJoint() |
||||||
|
{ |
||||||
|
} |
@ -0,0 +1,34 @@ |
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
#include "Eigen/Dense" |
||||||
|
#include "CoreMinimal.h" |
||||||
|
#include "Joint.generated.h" |
||||||
|
|
||||||
|
using namespace Eigen; |
||||||
|
|
||||||
|
class ULink; |
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/ |
||||||
|
UCLASS(BlueprintType, ClassGroup=(Custom)) |
||||||
|
class PBDROBOTICS_API UJoint : public UObject |
||||||
|
{ |
||||||
|
GENERATED_BODY() |
||||||
|
public: |
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadWrite) |
||||||
|
ULink* FirstLink; |
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadWrite) |
||||||
|
ULink* SecondLink; |
||||||
|
|
||||||
|
Vector3d FirstRotateAxis; |
||||||
|
Vector3d SecondRotateAxis; |
||||||
|
|
||||||
|
Vector3d FirstLocalPosition; |
||||||
|
Vector3d SecondLocalPosition; |
||||||
|
|
||||||
|
UJoint(); |
||||||
|
}; |
@ -0,0 +1,27 @@ |
|||||||
|
#pragma once |
||||||
|
|
||||||
|
#include "Eigen/Dense" |
||||||
|
|
||||||
|
inline Vector3d ToEigen(const FVector V){ |
||||||
|
return Vector3d(V.X, V.Y, V.Z); |
||||||
|
} |
||||||
|
|
||||||
|
inline FVector FromEigen(const Vector3d V){ |
||||||
|
return FVector(V.x(), V.y(), V.z()); |
||||||
|
} |
||||||
|
|
||||||
|
inline FQuat FromEigen(const Quaterniond Q){ |
||||||
|
return FQuat(Q.x(), Q.y(), Q.z(), Q.w()); |
||||||
|
} |
||||||
|
|
||||||
|
inline Quaterniond operator* (const Quaterniond Q, const double D){ |
||||||
|
return Quaterniond(Q.w() * D, Q.x() * D, Q.y() * D, Q.z() * D); |
||||||
|
} |
||||||
|
|
||||||
|
inline Quaterniond operator+ (const Quaterniond Q1, const Quaterniond Q2){ |
||||||
|
return Quaterniond(Q1.w() + Q2.w(), Q1.x() + Q2.x(), Q1.y() + Q2.y(), Q1.z() + Q2.z()); |
||||||
|
} |
||||||
|
|
||||||
|
inline Quaterniond operator+= (const Quaterniond Q1, const Quaterniond Q2){ |
||||||
|
return Q1 + Q2; |
||||||
|
} |
Loading…
Reference in new issue