void CGameObject::Stop() { SetVelocity(D3DXVECTOR2(0,0)); SetAcceleration(D3DXVECTOR2(0,0)); SetMaxAcceleration(D3DXVECTOR2(0,0)); SetMaxVelocity(D3DXVECTOR2(0,0)); }
FireEffect::FireEffect(const Vector3f& position) { constexpr float minV = 0.886f; constexpr float maxV = minV + 0.2f; constexpr float range = 1.305f; SetMinVelocity(Vector3f(-range,minV,-range) ); SetMaxVelocity(Vector3f(+range,maxV,+range)); SetBaseParticleLifetime(1.5f); SetParticleLifetimeVariance(1.5f); SetBaseStartSize(0.70f); SetBaseEndSize(0.38f); SetStartSizeVariance(0.22f); SetEndSizeVariance(0.16f); SetStartColor(Color(1.0f,0.2f,0.0f,0.6f)); SetEndColor(Color(1.0f,0.2f,0.0f,0.0f)); SetBlendingMode(ADDITIVE_BLENDING_MODE); SetEmitPosition(position); SetEmitPositionVariance(Vector3f(0.05f)); Texture* texture = Texture2D::Load("img/particle_post2.png"); if(!texture) { PrintErrorExit(); } texture->Bind(); texture->SetTextureRepeat(); texture->GenerateMipmap(); texture->SetMinFilter(GL_LINEAR_MIPMAP_LINEAR); texture->SetMagFilter(GL_LINEAR); texture->Unbind(); SetTexture(texture); }