Ticket #3814: cinematic_camera_spline_clear.2.patch
File cinematic_camera_spline_clear.2.patch, 2.3 KB (added by , 8 years ago) |
---|
-
source/graphics/CinemaPath.cpp
43 43 : CCinemaData(data), TNSpline(spline), m_TargetSpline(targetSpline), m_TimeElapsed(0.f) 44 44 { 45 45 m_TimeElapsed = 0; 46 47 // Calculate curves by nodes 46 48 BuildSpline(); 49 m_TargetSpline.BuildSpline(); 47 50 48 51 if (m_Orientation == L"target") 49 52 { -
source/maths/NUSpline.h
15 15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. 16 16 */ 17 17 18 //Desc: Contains classes for smooth splines 19 //Borrowed from Game Programming Gems4. (Slightly changed to better suit our purposes 20 //(and compatability). Any references to external material can be found there 18 /** 19 * Contains classes for smooth splines 20 * Borrowed from Game Programming Gems 4. (Slightly changed to better suit our purposes 21 * and compatability. Any references to external material can be found there. 22 */ 21 23 22 24 #ifndef INCLUDED_NUSPLINE 23 25 #define INCLUDED_NUSPLINE 24 26 25 #define MAX_SPLINE_NODES 40 26 #include <stdlib.h> 27 #define MAX_SPLINE_NODES 128 27 28 28 29 #include "FixedVector3D.h" 29 30 #include "Vector3D.h" 30 31 32 /** 33 * Describes a node of the spline 34 */ 31 35 struct SplineData 32 36 { 33 37 // Should be fixed, because used in the simulation … … 35 39 CVector3D Velocity; 36 40 // TODO: make rotation as other spline 37 41 CFixedVector3D Rotation; 38 fixed Distance/*, DistanceOffset*/; //DistanceOffset is to keep track of how far into the spline this node is 42 // Time interval to the previous node, should be 0 for the first node 43 fixed Distance; 39 44 }; 40 45 46 47 /** 48 * Rounded Nonuniform Spline for describing spatial curves or paths with constant speed 49 */ 41 50 class RNSpline 42 51 { 43 52 public: … … 61 70 CVector3D GetEndVelocity(int index); 62 71 }; 63 72 73 74 /** 75 * Smooth Nonuniform Spline for describing paths with smooth acceleration and deceleration, 76 * but without turning 77 */ 64 78 class SNSpline : public RNSpline 65 79 { 66 80 public: … … 69 83 void Smooth(); 70 84 }; 71 85 86 87 /** 88 * Timed Nonuniform Spline for paths with different time intervals between nodes 89 */ 72 90 class TNSpline : public SNSpline 73 91 { 74 92 public: