public
Last active

  • Download Gist
gistfile1.java
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
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
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.