Created
April 30, 2011 22:23
-
-
Save spockz/950045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void update(Vector3 position, Vector3 speed, float dt){ | |
Vector3 displacement = new Vector3(speed); | |
displacement.assignMul(dt); | |
position.assignAdd(displacement); | |
} | |
/* | |
This might provide a better abstraction over what you want to do. | |
If you can fix this in your EDSL together with the semantics, you | |
may do analysis on the computation you are building so that in | |
the end you can write your `inlined' function. | |
*/ | |
void update(Vector3 position, Vector3 speed, float dt){ | |
position.assign(position.add(speed.mul(dt))); | |
} | |
public Vector3 mul(int m) { | |
x *= m | |
y *= m | |
z *= m | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment