私は問題があります。
「IntelliSense: コンストラクター "Tree::Tree" のインスタンスが一致しない引数リストの引数の型は次のとおりです: (float [3]、float [3]、float、float、int、double、int、int)」。
3 行目:
float ColorS[3]={1,1,1},ColorF[3]={1,0,0};
for(unsigned int i=0;i<20;i++){
Tree a(ColorS, ColorF,
5.0f, 5.0f,
rand()%180+90, 0.67,
rand()%4+2, rand()%6+2);
las.push_back(a);
a.cordx=rand()%50-25;
a.cordz=rand()%50-25;
}
それが Tree.h の私のクラスです:
class Tree{
.
.
.
Tree(float [3],float [3],float,float,float,int,int);
.
.
.
};
そして、それが Tree.cpp のコンストラクターです。
Tree::Tree(float fromColor[3], float toColor[3],
float h=5.0f, float angle=60*rad,
float ratio=0.67f, int amount=4,
int maxLevel=5){
.
.
.
===
編集:今、私はこの問題を抱えています:
'Tree::Tree' : 5 つの引数を取るオーバーロードされた関数はありません
二行目:
for(unsigned int i=0;i<20;i++){
Tree a(5.0f, 1.0f,
0.67f, rand()%4+2,
rand()%6+2);
las.push_back(a);
a.cordx=rand()%50-25;
a.cordz=rand()%50-25;
}
それが Tree.h の私のクラスです:
class Tree{
...
Tree(float,float,float,int,int);
...
};
そして、それが Tree.cpp のコンストラクターです。
Tree::Tree(float h=5.0f, float angle=60*rad,
float ratio=0.67f, int amount=4,
int maxLevel=5){
...
}