1 #pragma once//☀SDXFramework
2 #include <Framework/Camera.h>
3 #include <Multimedia/Drawing.h>
23 static bool RectRect(
double x1 ,
double y1 ,
double x2 ,
double y2 ,
double x3 ,
double y3 ,
double x4 ,
double y4)
28 if ((x1 < x3 && x1 < x4) || (x2 > x3 && x2 > x4))
35 if ((x2 < x3 && x2 < x4) || (x1 > x3 && x1 > x4))
43 if ((y1 < y3 && y1 < y4) || (y2 > y3 && y2 > y4))
50 if ((y2 < y3 && y2 < y4) || (y1 > y3 && y1 > y4))
60 static bool LineLine(
double x1 ,
double y1 ,
double x2 ,
double y2 ,
double x3 ,
double y3 ,
double x4 ,
double y4)
63 if ((
double(x1 - x2) * (y3 - y1) + (y1 - y2) * (x1 - x3)) *
64 (
double(x1 - x2) * (y4 - y1) + (y1 - y2) * (x1 - x4)) > 0)
69 if ((
double(x3 - x4) * (y1 - y3) + (y3 - y4) * (x3 - x1)) *
70 (
double(x3 - x4) * (y2 - y3) + (y3 - y4) * (x3 - x2)) > 0)
79 static int PointPoint(
double x1 ,
double y1 ,
double x2 ,
double y2)
81 return int((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
91 virtual bool Hit(
const Shape *shape)
const = 0;
92 virtual bool Hit(
const Complex *complex)
const = 0;
93 virtual bool Hit(
const Point *point)
const = 0;
94 virtual bool Hit(
const Line *line)
const = 0;
95 virtual bool Hit(
const Rect *rect)
const = 0;
96 virtual bool Hit(
const Circle *circle)
const = 0;
99 virtual void SetPos(
double X座標 ,
double Y座標) = 0;
102 virtual Shape*
Clone(
double x ,
double y)
const = 0;
117 virtual void MultiZoom(
double X倍率 ,
double Y倍率) = 0;
120 virtual void Move(
double X移動量 ,
double Y移動量) = 0;
125 Move( 距離 * cos(方向) , 距離 * sin(方向) );
129 virtual void Draw(
Color 描画色 ,
int 透過率 ,
Camera *座標変換Camera = 0)
const = 0;
132 virtual void Rotate(
double 回転する角度) = 0;
135 virtual void SetAngle(
double 指定角度) = 0;
146 const double xd = this->
GetX() - 比較対象->
GetX();
147 const double yd = this->
GetY() - 比較対象->
GetY();
149 return sqrt( xd * xd + yd * yd );
153 virtual double GetX()
const = 0;
156 virtual double GetY()
const = 0;
159 virtual double GetW()
const = 0;
162 virtual double GetH()
const = 0;
170 std::vector<Shape*> shapes;
176 shapes.push_back( shape );
183 for(
auto it: shapes )
185 buf->shapes.push_back( it );
193 for(
auto it: shapes )
195 it->SetPos( X座標 , Y座標 );
199 void Move(
double X移動量 ,
double Y移動量)
201 for(
auto it: shapes )
203 it->Move( X移動量 , Y移動量 );
209 return shapes[0]->GetX();
214 return shapes[0]->GetY();
219 return shapes[0]->GetW();
224 return shapes[0]->GetH();
229 for(
auto it: shapes )
231 it->MultiZoom(X倍率, Y倍率);
239 for(
auto it: shapes )
241 it->Rotate( 回転する角度 );
247 for(
auto it: shapes )
249 it->SetAngle( 指定角度 );
255 for(
auto it: shapes )
257 it->Draw(描画色, 透過率, 座標変換Camera);
263 return shape->
Hit(
this );
267 for(
auto itA : this->shapes )
269 for(
auto itB : this->shapes )
271 if( itA->Hit(itB) )
return true;
276 bool Hit(
const Point *point)
const;
277 bool Hit(
const Line *line)
const;
278 bool Hit(
const Rect *rect)
const;
279 bool Hit(
const Circle *circle)
const;
295 Point(
double X座標 ,
double Y座標):
302 auto shape =
new Point( X座標 , Y座標 );
303 shape->zoomX = this->zoomX;
304 shape->zoomY = this->zoomY;
314 void Move(
double X移動量 ,
double Y移動量)
355 Drawing::Pixel((
int)座標変換Camera->TransX(x), (int)座標変換Camera->TransY(y), 描画色);
366 return shape->
Hit(
this );
370 for(
auto it : complex->shapes )
372 if( it->Hit(
this ) )
return true;
376 bool Hit(
const Point *point)
const
378 return ( point->x == this->x && point->y == this->y );
380 bool Hit(
const Line *line)
const;
381 bool Hit(
const Rect *rect)
const;
382 bool Hit(
const Circle *circle)
const;
390 virtual void CulParam()
397 this->xA = x + cos( angle ) * lengthA;
398 this->yA = y + sin( angle ) * lengthA;
399 this->xB = x - cos( angle ) * lengthB;
400 this->yB = y - sin( angle ) * lengthB;
401 this->width = abs(this->xB - this->xA);
402 this->height = abs(this->yB - this->yA);
403 this->thickHarf = this->thick / 2;
404 this->thickPow = this->thick * this->thick / 4;
405 this->minX = std::min( xA , xB );
406 this->maxX = std::max( xA , xB );
407 this->minY = std::min( yA , yB );
408 this->maxY = std::max( yA , yB );
435 Line(
double X中心座標 ,
double Y中心座標 ,
double 角度 ,
double 長さ ,
double 太さ):
448 auto shape =
new Line( X座標 , Y座標 , this->angle , this->lengthA , this->thick);
449 shape->zoomX = this->zoomX;
450 shape->zoomY = this->zoomY;
483 this->lengthA *= X倍率;
484 this->lengthB *= Y倍率;
495 this->angle += 回転する角度;
505 void Move(
double X移動量 ,
double Y移動量 )
525 Drawing::Line((
int)座標変換Camera->TransX(xA), (int)座標変換Camera->TransY(yA), (int)座標変換Camera->TransX(xB), (int)座標変換Camera->TransY(yB), 描画色, (int)(座標変換Camera->GetZoom()));
526 Drawing::Circle((
int)座標変換Camera->TransX(xA), (int)座標変換Camera->TransX(yA), (int)(thickHarf*座標変換Camera->GetZoom()), 描画色,
true);
527 Drawing::Circle((
int)座標変換Camera->TransX(xB), (int)座標変換Camera->TransX(yB), (int)(thickHarf*座標変換Camera->GetZoom()), 描画色,
true);
531 Drawing::Line((
int)xA, (
int)yA, (
int)xB, (
int)yB, 描画色, (
int)thick);
558 double GetThick()
const
563 void SetThick(
double 太さ)
566 thickHarf = int(thick / 2);
567 thickPow = int(thick * thick / 4);
570 double GetAngle()
const
575 double GetLength()
const
577 return this->lengthA + this->lengthB;
580 double GetThickHarf()
const
582 return this->thickHarf;
585 double GetThickPow()
const
587 return this->thickPow;
590 double GetMinX()
const
595 double GetMinY()
const
600 double GetMaxX()
const
605 double GetMaxY()
const
612 return shape->
Hit(
this );
616 for(
auto it : complex->shapes )
618 if( it->Hit(
this ) )
return true;
622 bool Hit(
const Point *point)
const
624 return LinePoint( point->GetX() , point->GetY() , this->GetThick() );
626 bool Hit(
const Line *line)
const
629 if(
RectRect(this->GetXA() - this->GetThickHarf() ,this->GetYA() - this->GetThickHarf() , this->GetXB() - line->GetThickHarf() , this->GetYB() - line->GetThickHarf() ,
630 line->GetXA() - this->GetThickHarf() ,line->GetYA() - this->GetThickHarf() , line->GetXB() - line->GetThickHarf() , line->GetYB() - line->GetThickHarf() ) )
635 if(
LineLine(this->GetXA() ,this->GetYA() ,this->GetXB() ,this->GetYB() ,line->GetXA(),line->GetYA(),line->GetXB(),line->GetYB() ) )
641 if( this->GetLength() != 0)
643 if( this->
LinePoint( line->GetXA() , line->GetYA() , this->GetThickHarf() + line->GetThickHarf() ) )
return true;
644 if( this->
LinePoint( line->GetXB() , line->GetYB() , this->GetThickHarf() + line->GetThickHarf() ) )
return true;
646 if( line->GetLength() != 0 )
648 if( line->LinePoint( this->GetXA() , this->GetYA() , this->GetThickHarf() + line->GetThickHarf() ) )
return true;
649 if( line->LinePoint( this->GetXB() , this->GetYB() , this->GetThickHarf() + line->GetThickHarf() ) )
return true;
654 bool Hit(
const Rect *rect)
const;
655 bool Hit(
const Circle *circle)
const;
658 bool LinePoint(
double px ,
double py ,
double range )
const
661 const double dx = GetXB() - GetXA();
662 const double dy = GetYB() - GetYA();
664 const double a = dx * dx + dy * dy;
665 const double b = dx *(GetXA() - px) + dy *(GetYA() - py);
671 ( GetXA() - px ) *( GetXA() - px ) +
672 ( GetYA() - py ) *( GetYA() - py )
673 < range * range )
return true;
677 const double t = -b / a;
679 const double tx = GetXA() + dx*t;
680 const double ty = GetYA() + dy*t;
683 if ( tx < minX || tx > maxX || ty < minY || ty > maxY)
686 (xA - px) * (xA - px) + (yA - py) * (yA - py) > range * range &&
687 (xB - px) * (xB - px) + (yB - py) * (yB - py) > range * range
694 const double d = (px - tx)*(px - tx) + (py - ty) * (py - ty);
696 return (d < range * range);
714 Rect(
double X座標,
double Y座標,
double 幅 ,
double 高さ):
723 Rect(
double X座標,
double Y座標,
double 幅 ,
double 高さ ,
double X中心 ,
double Y中心):
727 heightDown( 高さ-Y中心 ),
734 auto shape =
new Rect( X座標 , Y座標 ,
GetW() ,
GetH() , widthLeft , heightUp );
735 shape->zoomX = this->zoomX;
736 shape->zoomY = this->zoomY;
746 void Move(
double X移動量 ,
double Y移動量 )
772 (
int)座標変換Camera->TransX(x - widthLeft),
773 (int)座標変換Camera->TransY(y - heightUp),
774 (int)(座標変換Camera->GetZoom() *
GetW() ),
775 (
int)(座標変換Camera->GetZoom() *
GetH() ),
784 (
int)( x - widthLeft),
785 (
int)( y - heightUp),
807 return widthLeft + widthRight;
812 return heightUp + heightDown;
815 inline double GetLeft()
const
817 return x - widthLeft;
820 inline double GetTop()
const
825 inline double GetRight()
const
827 return x + widthRight;
830 inline double GetBottom()
const
832 return y + heightDown;
837 return shape->
Hit(
this );
841 for(
auto it : complex->shapes )
843 if( it->Hit(
this ) )
return true;
847 bool Hit(
const Point *point)
const
851 point->x < this->GetRight()
853 point->x > this->GetLeft()
855 point->y < this->GetBottom()
857 point->y > this->GetTop()
861 bool Hit(
const Line *line)
const
865 line->GetMaxX() + line->GetThickHarf() < this->GetLeft() ||
866 line->GetMinX() - line->GetThickHarf() > this->GetTop() ||
867 line->GetMaxY() + line->GetThickHarf() < this->GetRight() ||
868 line->GetMinY() - line->GetThickHarf() > this->GetBottom()
876 if(
LineLine( line->GetXA() , line->GetYA() , line->GetXB() , line->GetYB()
877 , this->GetLeft() - int(line->GetThickHarf() * 0.7) , this->GetTop() - int(line->GetThickHarf() * 0.7) , this->GetRight() + int(line->GetThickHarf() * 0.7) , this->GetBottom() + int(line->GetThickHarf() * 0.7) ))
882 if(
LineLine( line->GetXA() , line->GetYA() , line->GetXB() , line->GetYB()
883 , this->GetRight() + int(line->GetThickHarf() * 0.7) , this->GetTop() - int(line->GetThickHarf() * 0.7) , this->GetLeft() - int(line->GetThickHarf() * 0.7) , this->GetBottom() + int(line->GetThickHarf() * 0.7) ))
890 line->GetXA() + line->GetThickHarf() > this->GetLeft() && line->GetXA() - line->GetThickHarf() < this->GetRight() &&
891 line->GetYA() + line->GetThickHarf() > this->GetTop() && line->GetYA() - line->GetThickHarf() < this->GetBottom()
895 if( line->GetXA() < this->GetLeft() && line->GetYA() < this->GetTop() )
898 if( (line->GetXA() - this->GetLeft()) * (line->GetXA() - this->GetLeft()) +
899 (line->GetYA() - this->GetTop()) * (line->GetYA() - this->GetTop()) < line->GetThickPow() )
return true;
902 else if( line->GetXA() > this->GetRight() && line->GetYA() < this->GetTop() )
905 if( (line->GetXA() - this->GetRight()) * (line->GetXA() - this->GetRight()) +
906 (line->GetYA() - this->GetTop()) * (line->GetYA() - this->GetTop()) < line->GetThickPow() )
return true;
909 else if( line->GetXA() < this->GetLeft() && line->GetYA() > this->GetBottom() )
912 if( (line->GetXA() - this->GetLeft()) * (line->GetXA() - this->GetLeft()) +
913 (line->GetYA() - this->GetBottom()) * (line->GetYA() - this->GetBottom()) < line->GetThickPow() )
return true;
916 else if( line->GetXA() > this->GetRight() && line->GetYA() > this->GetBottom() )
919 if( (line->GetXA() - this->GetRight()) * (line->GetXA() - this->GetRight()) +
920 (line->GetYA() - this->GetBottom()) * (line->GetYA() - this->GetBottom()) < line->GetThickPow() )
return true;
930 line->GetXB() + line->GetThickHarf() > this->GetLeft() && line->GetXB() - line->GetThickHarf() < this->GetRight() &&
931 line->GetYB() + line->GetThickHarf() > this->GetTop() && line->GetYB() - line->GetThickHarf() < this->GetBottom()
935 if( line->GetXB() < this->GetLeft() && line->GetYB() < this->GetTop() )
937 if( (line->GetXB() - this->GetLeft()) * (line->GetXB() - this->GetLeft()) +
938 (line->GetYB() - this->GetTop()) * (line->GetYB() - this->GetTop()) < line->GetThickPow() )
return true;
941 else if( line->GetXB() > this->GetRight() && line->GetYB() < this->GetTop() )
944 if( (line->GetXB() - this->GetRight()) * (line->GetXB() - this->GetRight()) +
945 (line->GetYB() - this->GetTop()) * (line->GetYB() - this->GetTop()) < line->GetThickPow() )
return true;
948 else if( line->GetXB() < this->GetLeft() && line->GetYB() > this->GetBottom() )
951 if( (line->GetXB() - this->GetLeft()) * (line->GetXB() - this->GetLeft()) +
952 (line->GetYB() - this->GetBottom()) * (line->GetYB() - this->GetBottom()) < line->GetThickPow() )
return true;
955 else if( line->GetXB() > this->GetRight() && line->GetYB() > this->GetBottom() )
957 if( (line->GetXB() - this->GetRight()) * (line->GetXB() - this->GetRight()) +
958 (line->GetYB() - this->GetBottom()) * (line->GetYB() - this->GetBottom()) < line->GetThickPow() )
return true;
969 bool Hit(
const Rect *rect)
const
971 return !(GetRight() < rect->GetLeft() || GetLeft() > rect->GetRight() || GetBottom() < rect->GetTop() || GetTop() > rect->GetBottom() );
973 bool Hit(
const Circle *circle)
const;
985 Circle(
double X座標 ,
double Y座標 ,
double 半径):
993 auto shape =
new Circle( X座標 , Y座標 , this->radius );
994 shape->zoomX = this->zoomX;
995 shape->zoomY = this->zoomY;
1007 this->radius *= 倍率X;
1017 void Move(
double X移動量 ,
double Y移動量 )
1035 return int(radius*2);
1040 return int(radius*2);
1048 Drawing::Circle( (
int)座標変換Camera->TransX(x) , (int)座標変換Camera->TransY(y) , (int)(radius * 座標変換Camera->GetZoom()) , 描画色 ,
true );
1060 return shape->
Hit(
this );
1064 for(
auto it : complex->shapes )
1066 if( it->Hit(
this ) )
return true;
1070 bool Hit(
const Point *point)
const
1074 ( point->x - this->x ) * ( point->x - this->x ) +
1075 ( point->y - this->y ) * ( point->y - this->y )
1077 ( this->radius * this->radius )
1080 bool Hit(
const Line *line)
const
1082 return line->LinePoint( x , y , (line->GetThickHarf() + radius) );
1084 bool Hit(
const Circle *circle)
const
1087 (this->x - circle->x) * (this->x - circle->x) +
1088 (this->y - circle->y) * (this->y - circle->y)
1090 (this->radius + circle->radius) * (this->radius + circle->radius)
1093 bool Hit(
const Rect *rect)
const
1100 this->x + this->radius >= rect->GetLeft()
1102 this->x - this->radius <= rect->GetRight()
1106 this->y >= rect->GetTop()
1108 this->y <= rect->GetBottom()
1114 this->x >= rect->GetLeft()
1116 this->x <= rect->GetRight()
1120 this->y + this->radius >= rect->GetTop()
1122 this->y - this->radius <= rect->GetBottom()
1126 (this->x - rect->GetLeft() ) * (this->x - rect->GetLeft() ) +
1127 (this->y - rect->GetTop() ) * (this->y - rect->GetTop() ) <=
1128 (this->radius * this->radius )
1130 (this->x - rect->GetRight()) * (this->x - rect->GetRight()) +
1131 (this->y - rect->GetTop() ) * (this->y - rect->GetTop() ) <=
1132 (this->radius * this->radius )
1134 (this->x - rect->GetLeft()) * (this->x - rect->GetLeft()) +
1135 (this->y - rect->GetBottom()) * (this->y -rect->GetBottom()) <=
1136 (this->radius * this->radius )
1138 (this->x - rect->GetRight()) * (this->x - rect->GetRight()) +
1139 (this->y - rect->GetBottom()) * (this->y - rect->GetBottom()) <=
1140 (this->radius * this->radius )
static bool SetBlendMode(BlendMode ブレンドモード, int 設定値)
ブレンド描画のモードを設定.
Definition: Screen.h:136
void Rotate(double 回転する角度)
回転する.
Definition: Shape.h:346
void MultiZoom(double X倍率, double Y倍率)
縦横別で拡大率を掛け算する.
Definition: Shape.h:227
void MultiZoom(double X倍率, double Y倍率)
縦横別で拡大率を掛け算する.
Definition: Shape.h:340
矩形を表す図形クラス.
Definition: Shape.h:702
virtual void Move(double X移動量, double Y移動量)=0
相対座標で移動.
double GetX() const
X座標を取得.
Definition: Shape.h:795
virtual double GetH() const =0
高さを取得.
double GetW() const
幅を取得.
Definition: Shape.h:805
太さのある線を表す図形クラス.
Definition: Shape.h:387
double GetY() const
Y座標を取得.
Definition: Shape.h:800
void Draw(Color 描画色, int 透過率, Camera *座標変換Camera=nullptr) const
描画する.
Definition: Shape.h:765
bool Hit(const Shape *shape) const
衝突判定.
Definition: Shape.h:261
double GetW() const
幅を取得.
Definition: Shape.h:330
virtual Shape * Clone(double x, double y) const =0
同じ形の図形を作る.
virtual Shape * Clone(double X座標, double Y座標) const
同じ形の図形を作る.
Definition: Shape.h:732
double GetY() const
Y座標を取得.
Definition: Shape.h:325
virtual void Rotate(double 回転する角度)=0
回転する.
void SetAngle(double 指定角度)
角度を指定する.
Definition: Shape.h:348
void Draw(Color 描画色, int 透過率, Camera *座標変換Camera=0) const
描画する.
Definition: Shape.h:520
void Draw(Color 描画色, int 透過率, Camera *座標変換Camera=0) const
描画する.
Definition: Shape.h:350
static bool Circle(int 中心X, int 中心Y, int 半径, Color 色, bool 塗りつぶしフラグ)
中心と半径を指定して円を描画.
Definition: Drawing.h:111
void SetPos(double X座標, double Y座標)
指定座標に移動.
Definition: Shape.h:740
virtual double GetW() const =0
幅を取得.
bool Hit(const Shape *shape) const
衝突判定.
Definition: Shape.h:364
void SetAngle(double 指定角度)
角度を指定する.
Definition: Shape.h:763
static int PointPoint(double x1, double y1, double x2, double y2)
二点間の距離を計算.
Definition: Shape.h:79
void Move(double X移動量, double Y移動量)
相対座標で移動.
Definition: Shape.h:199
void SetPos(double X座標, double Y座標)
指定座標に移動.
Definition: Shape.h:999
Shape * Clone(double X座標, double Y座標) const
同じ形の図形を作る.
Definition: Shape.h:300
double GetDirect(Shape *比較対象)
対象との角度を取得.
Definition: Shape.h:138
double GetX() const
X座標を取得.
Definition: Shape.h:207
点を表す図形クラス.
Definition: Shape.h:284
void Move(double X移動量, double Y移動量)
相対座標で移動.
Definition: Shape.h:314
double GetX() const
X座標を取得.
Definition: Shape.h:320
void Rotate(double 回転する角度)
回転する.
Definition: Shape.h:761
void Move(double X移動量, double Y移動量)
相対座標で移動.
Definition: Shape.h:746
Shape * Clone(double x, double y) const
同じ形の図形を作る.
Definition: Shape.h:179
Shape * Clone(double X座標, double Y座標) const
同じ形の図形を作る.
Definition: Shape.h:991
複合図形を表すクラス.
Definition: Shape.h:167
void Rotate(double 回転する角度)
回転する.
Definition: Shape.h:237
static bool Rect(int 座標X, int 座標Y, int 幅, int 高さ, Color 色, bool 塗りつぶしフラグ)
左上の座標と大きさを指定して矩形を描画.
Definition: Drawing.h:92
double GetW() const
幅を取得.
Definition: Shape.h:464
void MoveA(double 距離, double 方向)
極座標で移動.
Definition: Shape.h:123
double GetW() const
幅を取得.
Definition: Shape.h:1033
void MultiZoom(double 倍率)
拡大率を掛け算する.
Definition: Shape.h:111
double GetW() const
幅を取得.
Definition: Shape.h:217
double GetX() const
X座標を取得.
Definition: Shape.h:1023
virtual Shape * Clone(double X座標, double Y座標) const
同じ形の図形を作る.
Definition: Shape.h:446
double GetDistance(Shape *比較対象)
対象との相対座標を取得.
Definition: Shape.h:144
void SetPos(double X座標, double Y座標)
指定座標に移動.
Definition: Shape.h:191
virtual void Draw(Color 描画色, int 透過率, Camera *座標変換Camera=0) const =0
描画する.
色を表すクラス.
Definition: Color.h:7
void SetAngle(double 指定角度)
角度を指定する.
Definition: Shape.h:245
void SetAngle(double 指定角度)
角度を指定する.
Definition: Shape.h:499
virtual bool Hit(const Shape *shape) const =0
衝突判定.
void Draw(Color 描画色, int 透過率, Camera *座標変換Camera=0) const
描画する.
Definition: Shape.h:1043
void MultiZoom(double X倍率, double Y倍率)
縦横別で拡大率を掛け算する.
Definition: Shape.h:752
void Move(double X移動量, double Y移動量)
相対座標で移動.
Definition: Shape.h:505
virtual void SetAngle(double 指定角度)=0
角度を指定する.
bool Hit(const Shape *shape) const
衝突判定.
Definition: Shape.h:835
static bool Pixel(int 座標X, int 座標Y, Color 色)
指定座標に点を描画.
Definition: Drawing.h:145
bool Hit(const Shape *shape) const
衝突判定.
Definition: Shape.h:1058
double GetY() const
Y座標を取得.
Definition: Shape.h:212
double GetY() const
Y座標を取得.
Definition: Shape.h:459
double GetH() const
高さを取得.
Definition: Shape.h:1038
void Draw(Color 描画色, int 透過率, Camera *座標変換Camera=0) const
描画する.
Definition: Shape.h:253
void SetPos(double X座標, double Y座標)
指定座標に移動.
Definition: Shape.h:308
double GetH() const
高さを取得.
Definition: Shape.h:222
void SetAngle(double 指定角度)
角度を指定する.
Definition: Shape.h:1015
2D用に座標変換を行うカメラを表すクラス.
Definition: Camera.h:16
bool LinePoint(double px, double py, double range) const
線と点の当たり判定.
Definition: Shape.h:658
void Move(double X移動量, double Y移動量)
相対座標で移動.
Definition: Shape.h:1017
double GetH() const
高さを取得.
Definition: Shape.h:335
virtual double GetX() const =0
X座標を取得.
void Rotate(double 回転する角度)
回転する.
Definition: Shape.h:1013
double GetX() const
X座標を取得.
Definition: Shape.h:454
virtual void SetPos(double X座標, double Y座標)=0
指定座標に移動.
円を表す図形クラス.
Definition: Shape.h:978
double GetY() const
Y座標を取得.
Definition: Shape.h:1028
位置情報を持つ図形の抽象クラス.
Definition: Shape.h:16
static bool LineLine(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
線分の交差判定.
Definition: Shape.h:60
void SetPos(double X座標, double Y座標)
指定座標に移動.
Definition: Shape.h:474
virtual double GetY() const =0
Y座標を取得.
void MultiZoom(double X倍率, double Y倍率)
縦横別で拡大率を掛け算する.
Definition: Shape.h:481
void MultiZoom(double 倍率X, double 倍率Y)
縦横別で拡大率を掛け算する.
Definition: Shape.h:1005
static bool RectRect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
矩形の交差判定.
Definition: Shape.h:23
static bool Line(int 始点X, int 始点Y, int 終点X, int 終点Y, Color 色, int 太さ)
始点と終点を結ぶ直線を描画.
Definition: Drawing.h:85
void Rotate(double 回転する角度)
回転する.
Definition: Shape.h:493
double GetH() const
高さを取得.
Definition: Shape.h:469
bool Hit(const Shape *shape) const
衝突判定.
Definition: Shape.h:610
void SetZoom(double X拡大率, double Y拡大率)
拡大率を設定.
Definition: Shape.h:105
double GetH() const
高さを取得.
Definition: Shape.h:810