add readonly getter

This commit is contained in:
jerrywwl
2019-04-23 10:52:45 +08:00
parent befa4a3728
commit 3c57deb11f
+27
View File
@@ -432,6 +432,10 @@ class Node extends BaseNode {
}
}
public get localPosition (): Readonly<Vec3> {
return this._lpos;
}
/**
* Sets local rotation.
* @param rotation - The new local rotation.
@@ -489,6 +493,10 @@ class Node extends BaseNode {
}
}
public get localRotation (): Readonly<Quat> {
return this._lrot;
}
/**
* Sets local scale.
* @param scale - The new local scale.
@@ -534,6 +542,10 @@ class Node extends BaseNode {
}
}
public get localScale (): Readonly<Vec3> {
return this._lscale;
}
/**
* Sets world position.
* @param position - The new world position.
@@ -593,6 +605,11 @@ class Node extends BaseNode {
}
}
public get worldPosition (): Readonly<Vec3> {
this.updateWorldTransform();
return this._pos;
}
/**
* Sets world rotation.
* @param rotation - The new world rotation.
@@ -672,6 +689,11 @@ class Node extends BaseNode {
}
}
public get worldRotation (): Readonly<Quat> {
this.updateWorldTransform();
return this._rot;
}
/**
* Sets world scale.
* @param scale - The new world scale.
@@ -727,6 +749,11 @@ class Node extends BaseNode {
}
}
public get worldScale (): Readonly<Vec3> {
this.updateWorldTransform();
return this._scale;
}
public getWorldMatrix<Out extends mat4> (out?: Out): Out;
public getWorldMatrix (): Mat4;