File size: 636 Bytes
e6b949c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import * as SPLAT from "gsplat";
import { Action } from "./Action";

class RotateAction implements Action {
    private _object: SPLAT.Splat;
    private _oldRotation: SPLAT.Quaternion;
    private _newRotation: SPLAT.Quaternion;

    constructor(object: SPLAT.Splat, oldRotation: SPLAT.Quaternion, newRotation: SPLAT.Quaternion) {
        this._object = object;
        this._oldRotation = oldRotation;
        this._newRotation = newRotation;
    }

    execute(): void {
        this._object.rotation = this._newRotation;
    }

    undo(): void {
        this._object.rotation = this._oldRotation;
    }
}

export { RotateAction };