00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <sprites/TeleportRenderer.h>
00022 #include <graph/ParticleEmitter.h>
00023 #include <client/ScorchedClient.h>
00024 #include <sprites/ExplosionTextures.h>
00025
00026 TeleportRenderer::TeleportRenderer(Vector &position, Vector &color) :
00027 position_(position), color_(color)
00028 {
00029 }
00030
00031 TeleportRenderer::~TeleportRenderer()
00032 {
00033 }
00034
00035 void TeleportRenderer::draw(Action *action)
00036 {
00037 }
00038
00039 void TeleportRenderer::simulate(Action *action, float timepassed, bool &remove)
00040 {
00041 remove = true;
00042 ParticleEmitter emitter;
00043 emitter.setAttributes(
00044 2.5f, 2.0f,
00045 0.2f, 0.5f,
00046 0.01f, 0.02f,
00047 Vector(0.0f, 0.0f, 0.0f), Vector(0.0f, 0.0f, 0.0f),
00048 color_, 1.0f,
00049 color_, 1.0f,
00050 color_, 0.0f,
00051 color_, 0.0f,
00052 0.7f, 1.0f, 0.7f, 1.0f,
00053 0.7f, 1.0f, 0.7f, 1.0f,
00054 Vector(0.0f, 0.0f, 0.0f),
00055 false,
00056 false);
00057
00058 GLTextureSet *set = ExplosionTextures::instance()->getTextureSetByName("trans");
00059 if (!set) return;
00060
00061 emitter.emitTransport(position_,
00062 ScorchedClient::instance()->getParticleEngine(),
00063 set);
00064 }