16 for (
int i=0; i<4; i++)
color[i] = 1.0;
51 for (
int i=0; i<num; i++) {
60 for (
int i=0; i<num; i++) {
71 for (
int i=0; i<num; i++) {
85 for (
int i=0; i<num; i++) {
100 for (
int i=0; i<num; i++) {
103 uv[i].
u = uu*cs + vv*sn + 0.5;
104 uv[i].
v = -uu*sn + vv*cs + 0.5;
115 for (
int i=0; i<num; i++) {
118 uv[i].
u = uu*cs + vv*sn + 0.5;
119 uv[i].
v = -uu*sn + vv*cs + 0.5;
151 fprintf(fp,
"TextureParam.name = %s\n",
name.
buf);
152 fprintf(fp,
"TextureParam.color = (%f,%f,%f,%f) [RGBA]\n",
color[0],
color[1],
color[2],
color[3]);
153 fprintf(fp,
"TextureParam.shiftU = %f\n",
shiftU);
154 fprintf(fp,
"TextureParam.shiftV = %f\n",
shiftV);
155 fprintf(fp,
"TextureParam.scaleU = %f\n",
scaleU);
156 fprintf(fp,
"TextureParam.scaleV = %f\n",
scaleV);
157 fprintf(fp,
"TextureParam.rotate = %f\n",
rotate);
159 if (
flipU) fprintf(fp,
"TextureParam.flipU = true\n");
160 else fprintf(fp,
"TextureParam.flipU = false\n");
161 if (
flipV) fprintf(fp,
"TextureParam.flipV = true\n");
162 else fprintf(fp,
"TextureParam.flipV = false\n");
164 if (
alphaChannel) fprintf(fp,
"TextureParam.alphaChannel = true\n");
165 else fprintf(fp,
"TextureParam.alphaChannel = flase\n");
168 fprintf(fp,
"TextureParam.alphaCutoff = %f\n",
alphaCutoff);
186 if (a_name!=NULL && b_name!=NULL) {
187 if (strcmp(a_name, b_name))
return false;
189 else if (a_name!=NULL || b_name!=NULL)
return false;
192 for (
int i=0; i<4; i++) {
276 if (ext==NULL)
return;
317 fprintf(fp,
"MaterialParam::printParam: MaterialParam is disable\n");
321 fprintf(fp,
"----------------------------------------------\n");
323 fprintf(fp,
"Texture\n");
327 fprintf(fp,
"SpecMap\n");
332 fprintf(fp,
"BumpMap\n");
337 fprintf(fp,
"----------------------------------------------\n");
338 fprintf(fp,
"MaterialParam.paramstr = %s\n",
paramstr.
buf);
340 fprintf(fp,
"MaterialParam.shininess = %f\n",
shininess);
341 fprintf(fp,
"MaterialParam.glow = %f\n",
glow);
342 fprintf(fp,
"MaterialParam.bright = %f\n",
bright);
343 fprintf(fp,
"MaterialParam.mapping = %d\n",
mapping);
344 fprintf(fp,
"MaterialParam.mflags = %d\n",
mflags);
345 fprintf(fp,
"MaterialParam.others = %d\n",
others);
347 fprintf(fp,
"MaterialParam.glossiness = %f\n",
glossiness);
348 fprintf(fp,
"MaterialParam.environment = %f\n",
environment);
384 if (hasAlpha) alphamode = alphaMode*10 + 1;
385 else alphamode = alphaMode*10;
432 if (a_param!=NULL && b_param!=NULL) {
433 if (strcmp(a_param, b_param)) ret =
false;
435 else if (a_param!=NULL || b_param!=NULL) {
438 if (a_param!=NULL) ::free(a_param);
439 if (b_param!=NULL) ::free(b_param);
#define MATERIAL_ATTR_TRANSPARENT
#define MATERIAL_ATTR_ALPHACUTOFF
#define MATERIAL_ATTR_COLOR_RED
#define MATERIAL_ATTR_BRIGHT
#define MATERIAL_ATTR_GLOW
#define MATERIAL_ATTR_SHININESS
#define MATERIAL_ATTR_LIGHT
#define MATERIAL_ATTR_ALPHAMODE
#define MATERIAL_ATTR_OBJECT
#define MATERIAL_ATTR_COLOR_GREEN
#define MATERIAL_ATTR_COLOR_BLUE
#define MATERIAL_ALPHA_BLENDING
#define MATERIAL_ATTR_LEN
void free_Buffer(Buffer *buf)
Buffer型変数のバッファ部を解放する
Buffer init_Buffer()
初期化したBuffer型変数を返す.
Buffer dup_Buffer(Buffer buf)
Buffer型変数のコピーをつくる.
#define make_Buffer_str(str)
set_Buffer()
TextureParam bumpmap
Bumpmap テクスチャ
char * getBase64Params(unsigned char cc='-')
char kind
オブジェクトの種類.'O', 'T', 'G', 'E'
char * getParamString(void)
void printParam(FILE *fp)
void setFullName(const char *extname)
Buffer paramstr
パラメータ文字列 (Base64文字列)
TextureParam texture
テクスチャ
void dup(MaterialParam m)
TextureParam specmap
Specular マップ テクスチャ
double alphaCutoff
アルファチャンネルの Cutoff値.alphaMode==MATERIAL_ALPHA_MASKING の場合に有効
void execFlipV(UVMap< double > *uv, int n)
double scaleV
UVマップのスケール (V方向)
void addName(const char *nm)
int alphaMode
アルファチャンネルのモード
void execInvShift(UVMap< double > *uv, int n)
void printParam(FILE *fp)
bool alphaChannel
テクスチャデータがアルファチャンネルを持っているかどうか.
bool flipV
UVマップで V方向の反転を行うか
double shiftV
UVマップのシフト (V方向)
void execShift(UVMap< double > *uv, int n)
double scaleU
UVマップのスケール (U方向)
double getAlphaCutoff(void)
bool hasAlphaChannel(void)
void execInvTrans(UVMap< double > *uv, int n)
Shift -> Scale -> Rotate.
Vector< double > getColor(void)
void execFlipU(UVMap< double > *uv, int n)
void execInvScale(UVMap< double > *uv, int n)
void execInvRotate(UVMap< double > *uv, int n)
void execRotate(UVMap< double > *uv, int n)
void execTrans(UVMap< double > *uv, int n)
Rotate -> Scale -> Shift.
double shiftU
UVマップのシフト (U方向)
bool flipU
UVマップで U方向の反転を行うか
void execScale(UVMap< double > *uv, int n)
bool isSameMaterial(MaterialParam a, MaterialParam b)
compare each texture names and colors
bool isSameTexture(TextureParam a, TextureParam b)
compare texture ma,e and color
unsigned char * buf
バッファの先頭へのポインタ.str[bufsz]は必ず 0x00となる.