19 lines
362 B
Plaintext
19 lines
362 B
Plaintext
// for n points
|
|
translate :: (amount: Vec2s64, pn: ..*Vec2s64) {
|
|
for pn {
|
|
it.x += amount.x;
|
|
it.y += amount.y;
|
|
}
|
|
}
|
|
|
|
// for a triangle
|
|
translate :: (amount: Vec2s64, t: *Triangle) {
|
|
translate(amount, *t.p1, *t.p2, *t.p3);
|
|
}
|
|
|
|
|
|
// for a quad
|
|
translate :: (amount: Vec2s64, q: *Quad) {
|
|
translate(amount, *q.p1, *q.p2, *q.p3, *q.p4);
|
|
}
|