- Timestamp:
- Jan 28, 2007, 1:29:11 AM (18 years ago)
- Location:
- branches/blink/src/world_entities/effects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blink/src/world_entities/effects/blink.cc
r10426 r10427 64 64 this->toList(OM_COMMON); 65 65 66 //this->material = new Material();67 //this->material->setIllum(0);68 //this->material->setDiffuse(1.0,1.0,1.0);69 //this->material->setTransparency(0.0);70 // this->material->setSpecular(0.0,0.0,0.0);71 // this->material->setAmbient(1.0, 1.0, 1.0);72 //this->material->setBlendFunc(GL_ZERO,GL_ZERO);73 //this->material->setDiffuseMap("pictures/rblink2.png");74 //this->material->setDiffuseMap("maps/star_alpha.png");75 //this->setAbsCoor(0, 0, 0);d76 //this->setVisibiliy(true);77 // this->setSize(5, 5);78 79 //srand((unsigned)time(NULL));80 81 82 66 this->bBoard = new Billboard; 83 67 this->bBoard->setVisibiliy(true); … … 111 95 LoadParam(root, "color", this, Blink, setColor); 112 96 LoadParam(root, "omega", this, Blink, setOmega); 113 // LoadParam(root, "watersize", this, Blink, setWaterSize);114 // LoadParam(root, "wateruv", this, Blink, setWaterUV);115 // LoadParam(root, "waterflow", this, Blink, setWaterFlow);116 // LoadParam(root, "lightpos", this, Blink, setLightPos);117 // LoadParam(root, "waterangle", this, Blink, setWaterAngle);118 // LoadParam(root, "normalmapscale", this, Blink, setNormalMapScale);119 // LoadParam(root, "shinesize", this, Blink, setShineSize);120 // LoadParam(root, "shinestrength", this, Blink, setShineStrength);121 // LoadParam(root, "reflstrength", this, Blink, setReflStrength);122 // LoadParam(root, "refraction", this, Blink, setRefraction);123 // LoadParam(root, "watercolor", this, Blink, setWaterColor);124 /*LoadParam(root, "texture", this->material, Material, setDiffuseMap)125 .describe("the texture-file to load onto the Blink");126 127 LoadParam(root, "size", this, Blink, setSize)128 .describe("the size of the Blink in Pixels");*/129 97 } 130 98 … … 142 110 143 111 this->blinkStr = sinf(angle); 112 113 this->bBoard->colorTexture(Color(color.r(), color.g(), color.b(), 1)); 144 114 } 145 115 … … 150 120 void Blink::draw() const 151 121 { 152 // glPushAttrib(GL_ENABLE_BIT);153 // glEnable(GL_LIGHTING); //glDisable(GL_LIGHTING);154 // glDisable(GL_FOG);155 // glMatrixMode(GL_MODELVIEW);156 // glPushMatrix();157 122 158 // Vector pos = this->getAbsCoor();159 // Vector dir = pos - State::getCameraNode()->getAbsCoor();160 // dir.normalize();161 //162 // Vector up = Vector(0, 1, 0);163 // Vector h = dir.cross(up);164 //165 // Vector pos = this->getAbsCoor();166 // glTranslatef(pos.x, pos.y, pos.z);167 168 /* translate */169 // glTranslatef (this->getAbsCoor ().x,170 // this->getAbsCoor ().y,171 // this->getAbsCoor ().z);172 // Vector tmpRot = this->getAbsDir().getSpacialAxis();173 // glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );174 175 // glBlendFunc(GL_SRC_ALPHA,GL_ONE); // Set The Blending Function For Translucency176 // glEnable(GL_BLEND);177 // glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);178 // glShadeModel(GL_SMOOTH);179 180 /*181 Vector camCoor = State::getCameraNode()->getAbsCoor();182 Vector diff = camCoor - this->position;183 184 185 //glTranslatef(position.x + size/2, position.y + size/2, position.z);186 187 glTranslatef(this->position.x - this->size/2, this->position.y - this->size/2, this->position.z);*/188 189 // Vector view = this->getAbsCoor() - State::getCameraNode()->getAbsCoor();190 // view.normalize();191 //192 // Vector up = Vector(0, 1, 0);193 // Vector h = view.cross(up);194 195 //this->material->select();196 // PRINTF(0)("\n\n\n\n::%f,%f,%f\n\n\n\n", color.r(), color.g(), color.b());197 this->bBoard->colorTexture(Color(color.r(), color.g(), color.b(), 1));198 199 glPopMatrix();200 glPopAttrib();201 123 } -
branches/blink/src/world_entities/effects/blink.h
r10425 r10427 28 28 void setOmega(float w) { this->omega = w; } 29 29 void setColor(float r, float g, float b) { this->color = Color(r/255, g/255, b/255); } 30 //void setTexture(const std::string& textureFile);31 30 32 31 virtual void tick(float dt); … … 34 33 35 34 private: 36 //Material* material;37 35 Billboard* bBoard; 38 36 Vector position;
Note: See TracChangeset
for help on using the changeset viewer.