summaryrefslogtreecommitdiff
path: root/scene/resources/curve.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-03-05 16:44:50 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-03-05 16:44:50 +0100
commit5dbf1809c6e3e905b94b8764e99491e608122261 (patch)
tree5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /scene/resources/curve.h
parent45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff)
A Whole New World (clang-format edition)
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
Diffstat (limited to 'scene/resources/curve.h')
-rw-r--r--scene/resources/curve.h57
1 files changed, 17 insertions, 40 deletions
diff --git a/scene/resources/curve.h b/scene/resources/curve.h
index 3362109354..2a8fab7f4c 100644
--- a/scene/resources/curve.h
+++ b/scene/resources/curve.h
@@ -81,10 +81,9 @@ public:
#endif
-
class Curve2D : public Resource {
- GDCLASS(Curve2D,Resource);
+ GDCLASS(Curve2D, Resource);
struct Point {
@@ -93,7 +92,6 @@ class Curve2D : public Resource {
Vector2 pos;
};
-
Vector<Point> points;
struct BakedPoint {
@@ -106,31 +104,25 @@ class Curve2D : public Resource {
mutable PoolVector2Array baked_point_cache;
mutable float baked_max_ofs;
-
void _bake() const;
float bake_interval;
- void _bake_segment2d(Map<float,Vector2>& r_bake, float p_begin, float p_end,const Vector2& p_a,const Vector2& p_out,const Vector2& p_b, const Vector2& p_in,int p_depth,int p_max_depth,float p_tol) const;
+ void _bake_segment2d(Map<float, Vector2> &r_bake, float p_begin, float p_end, const Vector2 &p_a, const Vector2 &p_out, const Vector2 &p_b, const Vector2 &p_in, int p_depth, int p_max_depth, float p_tol) const;
Dictionary _get_data() const;
void _set_data(const Dictionary &p_data);
protected:
-
static void _bind_methods();
-
-
public:
-
-
int get_point_count() const;
- void add_point(const Vector2& p_pos, const Vector2& p_in=Vector2(), const Vector2& p_out=Vector2(),int p_atpos=-1);
- void set_point_pos(int p_index, const Vector2& p_pos);
+ void add_point(const Vector2 &p_pos, const Vector2 &p_in = Vector2(), const Vector2 &p_out = Vector2(), int p_atpos = -1);
+ void set_point_pos(int p_index, const Vector2 &p_pos);
Vector2 get_point_pos(int p_index) const;
- void set_point_in(int p_index, const Vector2& p_in);
+ void set_point_in(int p_index, const Vector2 &p_in);
Vector2 get_point_in(int p_index) const;
- void set_point_out(int p_index, const Vector2& p_out);
+ void set_point_out(int p_index, const Vector2 &p_out);
Vector2 get_point_out(int p_index) const;
void remove_point(int p_index);
void clear_points();
@@ -138,26 +130,21 @@ public:
Vector2 interpolate(int p_index, float p_offset) const;
Vector2 interpolatef(real_t p_findex) const;
-
void set_bake_interval(float p_distance);
float get_bake_interval() const;
-
float get_baked_length() const;
- Vector2 interpolate_baked(float p_offset,bool p_cubic=false) const;
+ Vector2 interpolate_baked(float p_offset, bool p_cubic = false) const;
PoolVector2Array get_baked_points() const; //useful for going thru
- PoolVector2Array tesselate(int p_max_stages=5,float p_tolerance=4) const; //useful for display
-
+ PoolVector2Array tesselate(int p_max_stages = 5, float p_tolerance = 4) const; //useful for display
Curve2D();
};
-
-
class Curve3D : public Resource {
- GDCLASS(Curve3D,Resource);
+ GDCLASS(Curve3D, Resource);
struct Point {
@@ -166,10 +153,9 @@ class Curve3D : public Resource {
Vector3 pos;
float tilt;
- Point() { tilt=0; }
+ Point() { tilt = 0; }
};
-
Vector<Point> points;
struct BakedPoint {
@@ -183,33 +169,27 @@ class Curve3D : public Resource {
mutable PoolRealArray baked_tilt_cache;
mutable float baked_max_ofs;
-
void _bake() const;
float bake_interval;
- void _bake_segment3d(Map<float,Vector3>& r_bake, float p_begin, float p_end,const Vector3& p_a,const Vector3& p_out,const Vector3& p_b, const Vector3& p_in,int p_depth,int p_max_depth,float p_tol) const;
+ void _bake_segment3d(Map<float, Vector3> &r_bake, float p_begin, float p_end, const Vector3 &p_a, const Vector3 &p_out, const Vector3 &p_b, const Vector3 &p_in, int p_depth, int p_max_depth, float p_tol) const;
Dictionary _get_data() const;
void _set_data(const Dictionary &p_data);
protected:
-
static void _bind_methods();
-
-
public:
-
-
int get_point_count() const;
- void add_point(const Vector3& p_pos, const Vector3& p_in=Vector3(), const Vector3& p_out=Vector3(),int p_atpos=-1);
- void set_point_pos(int p_index, const Vector3& p_pos);
+ void add_point(const Vector3 &p_pos, const Vector3 &p_in = Vector3(), const Vector3 &p_out = Vector3(), int p_atpos = -1);
+ void set_point_pos(int p_index, const Vector3 &p_pos);
Vector3 get_point_pos(int p_index) const;
void set_point_tilt(int p_index, float p_tilt);
float get_point_tilt(int p_index) const;
- void set_point_in(int p_index, const Vector3& p_in);
+ void set_point_in(int p_index, const Vector3 &p_in);
Vector3 get_point_in(int p_index) const;
- void set_point_out(int p_index, const Vector3& p_out);
+ void set_point_out(int p_index, const Vector3 &p_out);
Vector3 get_point_out(int p_index) const;
void remove_point(int p_index);
void clear_points();
@@ -217,19 +197,16 @@ public:
Vector3 interpolate(int p_index, float p_offset) const;
Vector3 interpolatef(real_t p_findex) const;
-
void set_bake_interval(float p_distance);
float get_bake_interval() const;
-
float get_baked_length() const;
- Vector3 interpolate_baked(float p_offset,bool p_cubic=false) const;
+ Vector3 interpolate_baked(float p_offset, bool p_cubic = false) const;
float interpolate_baked_tilt(float p_offset) const;
PoolVector3Array get_baked_points() const; //useful for going thru
PoolRealArray get_baked_tilts() const; //useful for going thru
- PoolVector3Array tesselate(int p_max_stages=5,float p_tolerance=4) const; //useful for display
-
+ PoolVector3Array tesselate(int p_max_stages = 5, float p_tolerance = 4) const; //useful for display
Curve3D();
};