Ticket #3814: cinematic_camera_spline_clear.2.patch

File cinematic_camera_spline_clear.2.patch, 2.3 KB (added by Vladislav Belov, 4 years ago)
  • source/graphics/CinemaPath.cpp

     
    4343    : CCinemaData(data), TNSpline(spline), m_TargetSpline(targetSpline), m_TimeElapsed(0.f)
    4444{
    4545    m_TimeElapsed = 0;
     46
     47    // Calculate curves by nodes
    4648    BuildSpline();
     49    m_TargetSpline.BuildSpline();
    4750
    4851    if (m_Orientation == L"target")
    4952    {
  • source/maths/NUSpline.h

     
    1515 * along with 0 A.D.  If not, see <http://www.gnu.org/licenses/>.
    1616 */
    1717
    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 */
    2123
    2224#ifndef INCLUDED_NUSPLINE
    2325#define INCLUDED_NUSPLINE
    2426
    25 #define MAX_SPLINE_NODES 40
    26 #include <stdlib.h>
     27#define MAX_SPLINE_NODES 128
    2728
    2829#include "FixedVector3D.h"
    2930#include "Vector3D.h"
    3031
     32/**
     33 * Describes a node of the spline
     34 */
    3135struct SplineData
    3236{
    3337    // Should be fixed, because used in the simulation
     
    3539    CVector3D Velocity;
    3640    // TODO: make rotation as other spline
    3741    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;
    3944};
    4045
     46
     47/**
     48 * Rounded Nonuniform Spline for describing spatial curves or paths with constant speed
     49 */
    4150class RNSpline
    4251{
    4352public:
     
    6170    CVector3D GetEndVelocity(int index);
    6271};
    6372
     73
     74/**
     75 * Smooth Nonuniform Spline for describing paths with smooth acceleration and deceleration,
     76 * but without turning
     77 */
    6478class SNSpline : public RNSpline
    6579{
    6680public:
     
    6983    void Smooth();
    7084};
    7185
     86
     87/**
     88 * Timed Nonuniform Spline for paths with different time intervals between nodes
     89 */
    7290class TNSpline : public SNSpline
    7391{
    7492public: