SuperTuxKart
Loading...
Searching...
No Matches
bezier_curve.hpp
1//
2// SuperTuxKart - a fun racing game with go-kart
3// Copyright (C) 2009-2015 Joerg Henrichs
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 3
8// of the License, or (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19#ifndef HEADER_BEZIER_HPP
20#define HEADER_BEZIER_HPP
21
22#include <vector>
23
24#include "utils/aligned_array.hpp"
25#include "utils/vec3.hpp"
26
27class XMLNode;
28
34{
35private:
39 {
46 }; // BezierData
47
49 AlignedArray<BezierData> m_all_data;
50public:
51 BezierCurve(const XMLNode &node);
52 Vec3 getXYZ(float t) const;
53 Vec3 getHPR(float t) const;
54
56 unsigned int getNumPoints() const {return (unsigned int) m_all_data.size(); }
57}; // BezierCurve
58#endif
A class to manage bezier curves and interpolation.
Definition: bezier_curve.hpp:34
unsigned int getNumPoints() const
Returns the number of points in this bezier curve.
Definition: bezier_curve.hpp:56
AlignedArray< BezierData > m_all_data
Vector with all control points and handles.
Definition: bezier_curve.hpp:49
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35
utility class used to parse XML files
Definition: xml_node.hpp:48
A data structure to store one bezier control point and the two handles.
Definition: bezier_curve.hpp:39
Vec3 m_handle1
First handle, i.e.
Definition: bezier_curve.hpp:43
Vec3 m_handle2
Second handle, i.e.
Definition: bezier_curve.hpp:45
Vec3 m_control_point
The control point.
Definition: bezier_curve.hpp:41