// Copyright (C) 2015 Jérôme Leclercq // This file is part of the "Nazara Development Kit" // For conditions of distribution and use, see copyright notice in Prerequesites.hpp #include #include #include #include namespace Ndk { VelocitySystem::VelocitySystem() { Requires(); Excludes(); } void VelocitySystem::OnUpdate(float elapsedTime) { for (const Ndk::EntityHandle& entity : GetEntities()) { NodeComponent& node = entity->GetComponent(); const VelocityComponent& velocity = entity->GetComponent(); node.Move(velocity.linearVelocity * elapsedTime, Nz::CoordSys_Global); } } SystemIndex VelocitySystem::systemIndex; }