remove templateScale
This commit is contained in:
parent
e37c7e5998
commit
f5f677291d
|
@ -142,10 +142,8 @@
|
||||||
SetPen
|
SetPen
|
||||||
Home
|
Home
|
||||||
|
|
||||||
[ 1.414 1 1 PenScale ] to big
|
|
||||||
[ 1 1 1 PenScale ] to normal
|
|
||||||
[ 1 to k k / [dup F] k times drop ] to ff
|
[ 1 to k k / [dup F] k times drop ] to ff
|
||||||
[ 2 / dup R big 0 F R normal 0 F ] to rr
|
[ 2 / dup R 0 F R 0 F ] to rr
|
||||||
|
|
||||||
PenDown
|
PenDown
|
||||||
1 ff 90 rr 1 ff 90 rr 1 ff 90 rr 1 ff 90 rr
|
1 ff 90 rr 1 ff 90 rr 1 ff 90 rr 1 ff 90 rr
|
||||||
|
|
|
@ -13,7 +13,6 @@ import { VM as BaseVM, Input, Primitives, Environment } from './cat.js';
|
||||||
export class PenState {
|
export class PenState {
|
||||||
templatePath: Vector3[] = [new Vector3()];
|
templatePath: Vector3[] = [new Vector3()];
|
||||||
paths: Vector3[][] | null = null;
|
paths: Vector3[][] | null = null;
|
||||||
templateScale = new Vector3(1, 1, 1);
|
|
||||||
|
|
||||||
get isDown(): boolean {
|
get isDown(): boolean {
|
||||||
return this.paths !== null;
|
return this.paths !== null;
|
||||||
|
@ -37,8 +36,9 @@ export class PenState {
|
||||||
push(pos: Vector3, q: Quaternion) {
|
push(pos: Vector3, q: Quaternion) {
|
||||||
this.templatePath.forEach((p, i) => {
|
this.templatePath.forEach((p, i) => {
|
||||||
const r = new Vector3();
|
const r = new Vector3();
|
||||||
p.multiplyToRef(this.templateScale, r);
|
// p.multiplyToRef(this.templateScale, r);
|
||||||
r.rotateByQuaternionToRef(q, r);
|
// r.rotateByQuaternionToRef(q, r);
|
||||||
|
p.rotateByQuaternionToRef(q, r);
|
||||||
r.addInPlace(pos);
|
r.addInPlace(pos);
|
||||||
this.paths![i].push(r);
|
this.paths![i].push(r);
|
||||||
});
|
});
|
||||||
|
@ -162,10 +162,6 @@ export const TurtlePrimitives: Environment<TurtleVM> = Object.assign({}, Primiti
|
||||||
'ClearPen'() { this.pen.clear(); return []; },
|
'ClearPen'() { this.pen.clear(); return []; },
|
||||||
'SetPen'() { this.pen.set(); return []; },
|
'SetPen'() { this.pen.set(); return []; },
|
||||||
|
|
||||||
'PenScale'(sx, sy, sz) {
|
|
||||||
this.pen.templateScale = new Vector3(sx as number, sy as number, sz as number);
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
'PenDown'() { this.penDown(); return []; },
|
'PenDown'() { this.penDown(); return []; },
|
||||||
'PenUp'() { this.penUp(false); return []; },
|
'PenUp'() { this.penUp(false); return []; },
|
||||||
'Close'() { this.penUp(true); return []; },
|
'Close'() { this.penUp(true); return []; },
|
||||||
|
|
Loading…
Reference in New Issue