// Copyright (C) 2009-present, Panagiotis Christopoulos Charitos and contributors. // All rights reserved. // Code licensed under the BSD License. // http://www.anki3d.org/LICENSE #include #include #include #include namespace anki { void Event::init(Second startTime, Second duration) { m_startTime = startTime; m_duration = (duration < 0.0) ? kMaxSecond : duration; if(duration < 0.0) { m_reanimate = true; } } Second Event::getDelta(Second crntTime) const { const Second d = crntTime - m_startTime; // delta const Second dp = d / m_duration; // delta as persentage return dp; } } // end namespace anki