Point lights
This commit is contained in:
@@ -24,11 +24,26 @@ void HydraLightSpawnerActor::FixedTick(float delta_t)
|
||||
actor_manager->InitialiseActor(actor_id);
|
||||
actor_manager->SetPosition(actor_id, pos_comp.position);
|
||||
actor_manager->SetLinearVelocity(actor_id, m_spawn_direction * m_spawn_velocity);
|
||||
m_last_tick = current_tick;
|
||||
|
||||
SpawnedActor actor = {};
|
||||
actor.actor_id = actor_id;
|
||||
actor.spawned_time = current_tick;
|
||||
m_spawned_actors.push(actor);
|
||||
m_last_tick = current_tick;
|
||||
|
||||
}
|
||||
if(m_spawned_actors.size() > 0)
|
||||
{
|
||||
SpawnedActor actor = m_spawned_actors.front();
|
||||
long actor_spawned_time_ms = std::chrono::duration_cast<std::chrono::milliseconds>(current_tick - actor.spawned_time).count();
|
||||
if(actor_spawned_time_ms > (m_spawn_duration * 1000.0f ))
|
||||
{
|
||||
GetEngine()->ActorManager()->DeleteActor(actor.actor_id);
|
||||
m_spawned_actors.pop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void HydraLightSpawnerActor::_CreatePosition()
|
||||
|
||||
Reference in New Issue
Block a user