mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
add readonly getter
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user