ParticleEmitter Visibility

I can’t get my effect to render when I’m looking away from the world coordinates (0,0,0)…

Within screen:

http://puu.sh/4XlF0/4503191a9f.png[/t]

Looking away:
[t]http://puu.sh/4XlFH/ca58d08e5e.png

Quick way to create:


lua_run_cl local d = EffectData() d:SetEntity(LocalPlayer()) util.Effect( "testeffect", d )


function EFFECT:Init( Data )
	self.m_Entity = Data:GetEntity();
	self.m_fNextEmit = CurTime();
	self.m_fDelay = 0.025;
	self.m_fDieTime = CurTime() + 60;
end

local BEAM_MATERIAL = Material( "cable/physbeam" );
local WORLD_ORIGIN = Vector( 0, 0, 0 );

function EFFECT:Render()
	if ( self.m_vOrigin != nil ) then
		render.SetMaterial( BEAM_MATERIAL );
		render.DrawBeam( WORLD_ORIGIN, self.m_vOrigin, 8, 0, 0, color_white );
	end
	
	if ( CurTime() < self.m_fNextEmit ) then
		return;
	end
	
	if ( self.m_Entity == nil ) then
		return;
	end
	
	self.m_vOrigin = self.m_Entity:EyePos() + ( self.m_Entity:EyeAngles():Forward() * 32 );
	
	-- If the emitter doesn't exist, create it and immediately re-render.
	if ( self.m_Emitter == nil ) then
		self.m_Emitter = ParticleEmitter( self.m_vOrigin );
		self.m_fNextEmit = CurTime();
		return;
	end
	
	self.m_Emitter:SetPos( self.m_vOrigin ); -- Set emitter position
	
	local Particle = self.m_Emitter:Add( "sprites/flamelet" .. math.random( 1, 5 ), self.m_vOrigin + ( VectorRand() * 2 ) );
	Particle:SetVelocity( Vector( math.Rand( -1, 1 ) * 4, math.Rand( -1, 1 ) * 4, 0 ) );
	Particle:SetAirResistance( 1 );
	Particle:SetGravity( Vector( 0, 0, 24 ) );
	Particle:SetStartSize( 4 );
	Particle:SetEndSize( 1 );
	Particle:SetStartAlpha( 255 );
	Particle:SetEndAlpha( 0 );
	Particle:SetLifeTime( 0 );
	Particle:SetDieTime( 3 );
	
	self.m_fNextEmit = CurTime() + self.m_fDelay;
end

function EFFECT:Think()
	return CurTime() < self.m_fDieTime;
end

Is there some other origin/position that needs to be set?

I guess it’s a mystery then. :suicide: