MCPcopy
hub / github.com/jabbany/CommentCoreLibrary / Transform

Class Transform

src/scripting/api/Display/Transform.ts:39–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 }
38
39 export class Transform implements ISerializable {
40 private _parent:Transformable;
41 private _matrix:Matrix = new Matrix();
42 private _matrix3d:Matrix3D = null;
43 private _perspectiveProjection:PerspectiveProjection;
44 private _colorTransform:ColorTransform;
45
46 constructor(parent:Transformable) {
47 this._parent = parent;
48 this._perspectiveProjection = new PerspectiveProjection(parent);
49 this._colorTransform = new ColorTransform();
50 }
51
52 set parent(p:Transformable) {
53 this._parent = p;
54 }
55
56 get parent():Transformable {
57 return this._parent;
58 }
59
60 set perspectiveProjection(projection:PerspectiveProjection) {
61 this._perspectiveProjection = projection;
62 }
63
64 get perspectiveProjection():PerspectiveProjection {
65 return this._perspectiveProjection;
66 }
67
68 set matrix3D(m:Display.Matrix3D) {
69 if (m === null) {
70 if (this._matrix3d === null) {
71 return;
72 }
73 this._matrix3d = null;
74 this._matrix = new Matrix();
75 } else {
76 this._matrix = null;
77 this._matrix3d = m;
78 }
79 this.update();
80 }
81
82 set matrix(m:Display.Matrix) {
83 if (m === null) {
84 if (this._matrix === null) {
85 return;
86 }
87 this._matrix = null;
88 this._matrix3d = new Matrix3D();
89 } else {
90 this._matrix3d = null;
91 this._matrix = m;
92 }
93 this.update();
94 }
95
96 get matrix3D():Display.Matrix3D {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected