Claw
1.7.3
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
code
tween
easing
easing_bounce.cpp
Go to the documentation of this file.
1
/*
2
CLAW - a C++ Library Absolutely Wonderful
3
4
CLAW is a free library without any particular aim but being useful to
5
anyone.
6
7
Copyright (C) 2005-2011 Julien Jorge
8
9
This library is free software; you can redistribute it and/or
10
modify it under the terms of the GNU Lesser General Public
11
License as published by the Free Software Foundation; either
12
version 2.1 of the License, or (at your option) any later version.
13
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Lesser General Public License for more details.
18
19
You should have received a copy of the GNU Lesser General Public
20
License along with this library; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
contact: julien.jorge@gamned.org
23
*/
29
#include <
claw/tween/easing/easing_bounce.hpp
>
30
36
double
claw::tween::easing_bounce_func
(
double
t )
37
{
38
const
double
v = 1 - t;
39
double
c;
40
double
d;
41
42
if
( v < (1 / 2.75) )
43
{
44
c = v;
45
d = 0;
46
}
47
else
if
( v < (2 / 2.75) )
48
{
49
c = v - 1.5 / 2.75;
50
d = 0.75;
51
}
52
else
if
( v < (2.5 / 2.75) )
53
{
54
c = v - 2.25 / 2.75;
55
d = 0.9375;
56
}
57
else
58
{
59
c = v - 2.625 / 2.75;
60
d = 0.984375;
61
}
62
63
return
1 - (7.5625 * c * c + d);
64
}
// easing_bounce_func()
claw::tween::easing_bounce_func
double easing_bounce_func(double t)
The default function.
Definition:
easing_bounce.cpp:36
easing_bounce.hpp
Easing functions for the tweener.
Generated on Sun Aug 16 2015 18:54:27 for Claw by
1.8.9.1