Portion: original image and sound resources
Source: http://www.nether.org.uk/bad_mac_code.html
-Copyright: Neil Carter
+Copyright: © 2003, Neil Carter
License: zlib-libpng
Portion: cml
inherit autotools eutils games
DESCRIPTION="Alien-smashing action game"
-HOMEPAGE="http://www.dogcows.com/"
+HOMEPAGE="http://www.dogcows.com/yoink/"
SRC_URI="http://www.dogcows.com/yoink/${P}.tar.bz2
http://eng.utah.edu/~mcgarvey/yoink/${P}.tar.bz2"
-LICENSE="BSD-2"
+LICENSE="BSD-2 BSD LGPL-2.1 ZLIB"
SLOT="0"
KEYWORDS="amd64 ~ppc x86"
IUSE="debug profile"
;; Modern UI Configuration ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-!define MUI_ICON "$ROOT_DIR/src/yoink.ico"
-!define MUI_UNICON "$ROOT_DIR/src/yoink.ico"
+!define MUI_ICON "$ROOT_DIR/src/yoink_setup.ico"
+!define MUI_UNICON "$ROOT_DIR/src/yoink_uninstall.ico"
; Language
!define MUI_LANGDLL_ALWAYSSHOW
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
current.recalculate();
previous = current;
-
- //updateContainers();
}
Mf::Scalar mag = x.length();
Mf::Scalar d = 50.0;
+ // gravity:
current.force = Mf::Vector2(0.0, -2000.0);
+ // spring:
//current.force += -15.0 * x - 1.5 * current.velocity;
current.force += -20.0 * (mag - d) * (x / mag) - 2.0 * current.velocity;
+ // internal:
current.force += userForce;
current.recalculate();
//std::cout << "force: " << current.momentum << std::endl;
- Mf::integrate<State,Derivative>(current, t, dt);
+ Mf::euler<State,Derivative>(current, t, dt);
animation_.update(t, dt);
-
- //updateContainers();
}
-//void Character::updateContainers()
-//{
- //aabb_.init(Mf::Vector3(current.position[0]-16.0, current.position[1]-16.0, z),
- //Mf::Vector3(current.position[0]+16.0, current.position[1]+16.0, z));
- //sphere_.point = Mf::Vector3(current.position[0], current.position[1], z);
- //sphere_.radius = (aabb_.min - sphere_.point).length();
-//}
-
void Character::draw(Mf::Scalar alpha) const
{
//derivative.force = Mf::Vector2(0.0, 0.0);
derivative.velocity = velocity;
derivative.force = force;
+
+ //Mf::Vector2 x = position - Mf::Vector2(500.0, 200.0);
+ //derivative.force += -15.0 * x - 1.5 * velocity;
}
void applyDerivative(const Derivative& derivative, Mf::Scalar dt)
Mf::Tilemap tilemap_;
Mf::Animation animation_;
- //void updateContainers();
-
protected:
Mf::Vector2 userForce;
};
-//inline Character::State operator*(Mf::Scalar scalar,
- //const Character::State& state)
-//{
- //Character::State newState = state;
- //newState.position *= scalar;
- //newState.momentum *= scalar;
- //newState.recalculate();
- //return newState;
-//}
-
-
#endif // _CHARACTER_HH_
/** vim: set ts=4 sw=4 tw=80: *************************************************/
namespace Mf {
-// Generic implementation of the RK4 integrator. To use, you need one type
-// representing the state and another containing the derivatives of the primary
-// state variables. The state class must implement these methods:
+// Generic implementations of a few simple integrators. To use, you need one
+// type representing the state and another containing the derivatives of the
+// primary state variables. The state class must implement these methods:
//
// void getDerivative(Derivative_Type& derivative, Scalar absoluteTime);
// void applyDerivative(const Derivative_Type& derivative, Scalar deltaTime);
template<typename S, typename D>
-inline void integrate(S& state, Scalar t, Scalar dt)
+inline void euler(S& state, Scalar t, Scalar dt)
+{
+ D a = evaluate<S,D>(state, t);
+
+ state.applyDerivative(a, dt);
+}
+
+template<typename S, typename D>
+inline void rk2(S& state, Scalar t, Scalar dt)
+{
+ D a = evaluate<S,D>(state, t);
+ D b = evaluate<S,D>(state, t, dt * 0.5, a);
+
+ state.applyDerivative(b, dt);
+}
+
+template<typename S, typename D>
+inline void rk4(S& state, Scalar t, Scalar dt)
{
D a = evaluate<S,D>(state, t);
D b = evaluate<S,D>(state, t, dt * 0.5, a);
nPrinted = std::min(nPrinted, (int)sizeof(buffer) - 1);
}
+
/** vim: set ts=4 sw=4 tw=80: *************************************************/