Hi,
So I’m trying to come up with a way to generate a timeline in C++ that is accessible in Blueprint. I want there to be three float curves emerging from the timeline, one for Radius, and two angles (spherical coordinates)
I’m having problems finding the right way to get this to work. I’m thinking that maybe I should create an FTimeline* as a UProperty, and generate the curves inside of that, making keyframes where needed. My pseudocode would look like this:
.h filePublic:
UPROPERTY(BP Callable)
Ftimeline OrbitPath(KepElems, BodyData, GameDate){}
.cpp file
Aav…::OrbitPath(KepElems, BodyData, GameDate)
{
avRadius = New Ucurve
avTheta = New Ucurve - (yaw)
avPhi = New Ucurve - (pitch)
i=(360-precesion)/36;This_OrbitTime_Start=TimeFromAngle(angle i. , MJD, kepelems)
This_OrbitTime_Finish=TimeFromAngle(angle Final , MJD, kepelems)
For N=0, 36 DO
{
RadCoords = Kep2Rad(KepElems, BodyData, GameDate);
addKeyFrame(avRadius) = (RadCoords.Radius, TimeFromAngle(i));
addKeyFrame(avTheta) = (RadCoords.Theta, TimeFromAngle(i);
addKeyFrame(avPhi) = (RadCoords.Phi, TimeFromAngle(i);
}
}
Would this even be the right way to go about setting up something like this? Or should I make 3 separate FRichCurve UProperties and then reference those from a regular Timeline inside a Blueprint. Also, I want all of this to be available inside of an extension of AActor, which shouldn’t be a problem right?
I guess any example of creating a Timeline with custom curves in code is what I’m hoping for. I’m not sure when to use FRichCurve vs UCurveFloat, and then how to reference those inside of a Timeline.
Any pointers help, thanks!