rays 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.doc/ext/rays/bitmap.cpp +6 -6
  3. data/.doc/ext/rays/bounds.cpp +4 -4
  4. data/.doc/ext/rays/color.cpp +4 -4
  5. data/.doc/ext/rays/color_space.cpp +4 -4
  6. data/.doc/ext/rays/font.cpp +6 -6
  7. data/.doc/ext/rays/image.cpp +6 -6
  8. data/.doc/ext/rays/matrix.cpp +4 -4
  9. data/.doc/ext/rays/painter.cpp +56 -21
  10. data/.doc/ext/rays/point.cpp +5 -4
  11. data/.doc/ext/rays/rays.cpp +2 -3
  12. data/.doc/ext/rays/shader.cpp +5 -5
  13. data/.doc/ext/rays/texture.cpp +5 -5
  14. data/README.md +2 -2
  15. data/VERSION +1 -1
  16. data/ext/rays/bitmap.cpp +6 -6
  17. data/ext/rays/bounds.cpp +4 -4
  18. data/ext/rays/color.cpp +4 -4
  19. data/ext/rays/color_space.cpp +4 -4
  20. data/ext/rays/font.cpp +6 -6
  21. data/ext/rays/image.cpp +6 -6
  22. data/ext/rays/matrix.cpp +4 -4
  23. data/ext/rays/painter.cpp +72 -35
  24. data/ext/rays/point.cpp +5 -4
  25. data/ext/rays/rays.cpp +2 -3
  26. data/ext/rays/shader.cpp +5 -5
  27. data/ext/rays/texture.cpp +5 -5
  28. data/include/rays/opengl.h +1 -1
  29. data/include/rays/painter.h +12 -0
  30. data/include/rays/point.h +35 -9
  31. data/include/rays/ruby/bitmap.h +14 -0
  32. data/include/rays/ruby/bounds.h +14 -0
  33. data/include/rays/ruby/color.h +14 -0
  34. data/include/rays/ruby/color_space.h +14 -0
  35. data/include/rays/ruby/font.h +14 -0
  36. data/include/rays/ruby/image.h +14 -0
  37. data/include/rays/ruby/matrix.h +14 -0
  38. data/include/rays/ruby/painter.h +14 -0
  39. data/include/rays/ruby/point.h +14 -0
  40. data/include/rays/ruby/shader.h +14 -0
  41. data/include/rays/ruby/texture.h +14 -0
  42. data/rays.gemspec +1 -1
  43. data/src/painter.cpp +132 -43
  44. data/src/point.cpp +65 -30
  45. metadata +3 -3
@@ -9,30 +9,44 @@ namespace Rays
9
9
  {
10
10
 
11
11
 
12
- Point::Point (coord value)
12
+ Coord2&
13
+ Coord2::reset (coord value)
13
14
  {
14
- reset(value);
15
+ return reset(value, value);
15
16
  }
16
17
 
17
- Point::Point (coord x, coord y, coord z)
18
+ Coord2&
19
+ Coord2::reset (coord x, coord y)
18
20
  {
19
- reset(x, y, z);
21
+ this->x = x;
22
+ this->y = y;
23
+ return *this;
20
24
  }
21
25
 
22
- Point
23
- Point::dup () const
26
+ coord&
27
+ Coord2::operator [] (size_t index)
24
28
  {
25
- return *this;
29
+ if (index >= 2)
30
+ argument_error(__FILE__, __LINE__);
31
+
32
+ return array[index];
26
33
  }
27
34
 
28
- Point&
29
- Point::reset (coord value)
35
+ const coord&
36
+ Coord2::operator [] (size_t index) const
37
+ {
38
+ return const_cast<Coord2*>(this)->operator[](index);
39
+ }
40
+
41
+
42
+ Coord3&
43
+ Coord3::reset (coord value)
30
44
  {
31
45
  return reset(value, value, 0);
32
46
  }
33
47
 
34
- Point&
35
- Point::reset (coord x, coord y, coord z)
48
+ Coord3&
49
+ Coord3::reset (coord x, coord y, coord z)
36
50
  {
37
51
  this->x = x;
38
52
  this->y = y;
@@ -40,28 +54,64 @@ namespace Rays
40
54
  return *this;
41
55
  }
42
56
 
57
+ coord&
58
+ Coord3::operator [] (size_t index)
59
+ {
60
+ if (index >= 3)
61
+ argument_error(__FILE__, __LINE__);
62
+
63
+ return array[index];
64
+ }
65
+
66
+ const coord&
67
+ Coord3::operator [] (size_t index) const
68
+ {
69
+ return const_cast<Coord3*>(this)->operator[](index);
70
+ }
71
+
72
+
73
+ Point::Point (coord value)
74
+ {
75
+ reset(value);
76
+ }
77
+
78
+ Point::Point (coord x, coord y, coord z)
79
+ {
80
+ reset(x, y, z);
81
+ }
82
+
83
+ Point
84
+ Point::dup () const
85
+ {
86
+ return *this;
87
+ }
88
+
43
89
  Point&
44
90
  Point::move_to (coord x, coord y, coord z)
45
91
  {
46
- return reset(x, y, z);
92
+ reset(x, y, z);
93
+ return *this;
47
94
  }
48
95
 
49
96
  Point&
50
97
  Point::move_to (const Point& point)
51
98
  {
52
- return reset(point.x, point.y, point.z);
99
+ reset(point.x, point.y, point.z);
100
+ return *this;
53
101
  }
54
102
 
55
103
  Point&
56
104
  Point::move_by (coord x, coord y, coord z)
57
105
  {
58
- return reset(this->x + x, this->y + y, this->z + z);
106
+ reset(this->x + x, this->y + y, this->z + z);
107
+ return *this;
59
108
  }
60
109
 
61
110
  Point&
62
111
  Point::move_by (const Point& point)
63
112
  {
64
- return reset(this->x + point.x, this->y + point.y, this->z + point.z);
113
+ reset(this->x + point.x, this->y + point.y, this->z + point.z);
114
+ return *this;
65
115
  }
66
116
 
67
117
  String
@@ -70,21 +120,6 @@ namespace Rays
70
120
  return Xot::stringf("x=%f y=%f z=%f", x, y, z);
71
121
  }
72
122
 
73
- coord&
74
- Point::operator [] (size_t index)
75
- {
76
- if (index >= 3)
77
- argument_error(__FILE__, __LINE__);
78
-
79
- return array[index];
80
- }
81
-
82
- const coord&
83
- Point::operator [] (size_t index) const
84
- {
85
- return const_cast<Point*>(this)->operator[](index);
86
- }
87
-
88
123
  Point
89
124
  Point::operator - () const
90
125
  {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rays
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - snori
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-07 00:00:00.000000000 Z
11
+ date: 2014-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -207,7 +207,7 @@ files:
207
207
  - ".doc/ext/rays/rays.cpp"
208
208
  - ".doc/ext/rays/shader.cpp"
209
209
  - ".doc/ext/rays/texture.cpp"
210
- homepage: http://github.com/xord/rays/wiki
210
+ homepage: https://github.com/xord/spacy/wiki/Rays-Home
211
211
  licenses: []
212
212
  metadata: {}
213
213
  post_install_message: