cypher2012 Posted September 11, 2017 Share Posted September 11, 2017 Hey guys, please can somebody advise me about what is meant about 'Magnitude of the spline tangents'? https://www.creationkit.com/fallout4/index.php?title=SplineTranslateToRef_-_ObjectReference "afTangentMagnitude: Magnitude of the spline tangents" SplineTranslateTo(arTarget.X, arTarget.Y, arTarget.Z, arTarget.GetAngleX(), arTarget.GetAngleY(), arTarget.GetAngleZ(), afTangentMagnitude, ;What is this?! afSpeed, afMaxRotationSpeed) Link to comment Share on other sites More sharing options...
cypher2012 Posted September 11, 2017 Author Share Posted September 11, 2017 (edited) I think I finally figured it out. I think it's meant to be the distance over which the object makes the rotation. I was experimenting with having two points, and wanted the object to make a perfect curve from one point to the next. The following code seems to work. It simply calculates the distance between the two points: Event OnActivate(ObjectReference akActionRef) Float fTestDistance = start_marker.GetDistance(end_marker) object_to_move.SplineTranslateTo(end_marker.X, end_marker.Y,end_marker.Z, end_marker.GetAngleX(), end_marker.GetAngleY(), end_marker.GetAngleZ(), fTestDistance, 100.0) EndEvent Edited September 11, 2017 by cypher2012 Link to comment Share on other sites More sharing options...
Evangela Posted September 11, 2017 Share Posted September 11, 2017 It may help to read a bit on what a tangent is: https://en.wikipedia.org/wiki/Tangent Link to comment Share on other sites More sharing options...
steve40 Posted September 12, 2017 Share Posted September 12, 2017 (edited) I think I finally figured it out. I think it's meant to be the distance over which the object makes the rotation. I was experimenting with having two points, and wanted the object to make a perfect curve from one point to the next. The following code seems to work. It simply calculates the distance between the two points: Event OnActivate(ObjectReference akActionRef) Float fTestDistance = start_marker.GetDistance(end_marker) object_to_move.SplineTranslateTo(end_marker.X, end_marker.Y,end_marker.Z, end_marker.GetAngleX(), end_marker.GetAngleY(), end_marker.GetAngleZ(), fTestDistance, 100.0) EndEvent I use spline translations a lot in my skyBirds mod for Skyrim. I found that 100 was a good all-round value to use regardless of the distance travelled. Cheers. Edit: I used the following formulas for fTestDistance: if goal.X != self.X dist = math.Sqrt(math.Pow(self.X - goal.X, 2 as Float) + math.Pow(self.Y - goal.Y, 2 as Float)) else dist = math.Abs(self.Y - goal.Y) But I forget why I did it that way. The first formula looks like Pythagoras' rule for the length of the hypotenuse, so it would be the distance between the object and the target. Cheers. Edited September 12, 2017 by steve40 Link to comment Share on other sites More sharing options...
cypher2012 Posted September 13, 2017 Author Share Posted September 13, 2017 Looks like I've got some brushing up to do on my 3D graphics maths! :D Link to comment Share on other sites More sharing options...
Recommended Posts