mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
@@ -24,7 +24,6 @@ deprecatedWrapper({
|
||||
['sqrDist', 'squaredDistance'],
|
||||
['mag', 'len'],
|
||||
['sqrMag', 'lengthSqr'],
|
||||
['divide', 'divideScalar'],
|
||||
['scale', 'multiplyScalar'],
|
||||
['exactEquals', 'strictEquals'],
|
||||
],
|
||||
@@ -40,7 +39,6 @@ deprecatedWrapper({
|
||||
['magSqr', 'lengthSqr'],
|
||||
['exactEquals', 'strictEquals'],
|
||||
['scale', 'multiplyScalar'],
|
||||
['divide', 'divideScalar'],
|
||||
],
|
||||
});
|
||||
|
||||
@@ -57,7 +55,6 @@ deprecatedWrapper({
|
||||
['sqrDist', 'squaredDistance'],
|
||||
['mag', 'len'],
|
||||
['sqrMag', 'lengthSqr'],
|
||||
['divide', 'divideScalar'],
|
||||
['scale', 'multiplyScalar'],
|
||||
['exactEquals', 'strictEquals'],
|
||||
],
|
||||
@@ -73,7 +70,6 @@ deprecatedWrapper({
|
||||
['magSqr', 'lengthSqr'],
|
||||
['exactEquals', 'strictEquals'],
|
||||
['scale', 'multiplyScalar'],
|
||||
['divide', 'divideScalar'],
|
||||
],
|
||||
});
|
||||
|
||||
@@ -90,7 +86,6 @@ deprecatedWrapper({
|
||||
['sqrDist', 'squaredDistance'],
|
||||
['mag', 'len'],
|
||||
['sqrMag', 'lengthSqr'],
|
||||
['divide', 'divideScalar'],
|
||||
['scale', 'multiplyScalar'],
|
||||
['exactEquals', 'strictEquals'],
|
||||
],
|
||||
@@ -106,7 +101,6 @@ deprecatedWrapper({
|
||||
['magSqr', 'lengthSqr'],
|
||||
['exactEquals', 'strictEquals'],
|
||||
['scale', 'multiplyScalar'],
|
||||
['divide', 'divideScalar'],
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@@ -102,15 +102,6 @@ export class Vec2 extends ValueType {
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @zh 逐元素向量除法
|
||||
*/
|
||||
public static divideScalar <Out extends IVec2Like> (out: Out, a: Out, b: Out) {
|
||||
out.x = a.x / b.x;
|
||||
out.y = a.y / b.y;
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @zh 逐元素向量向上取整
|
||||
*/
|
||||
@@ -558,16 +549,6 @@ export class Vec2 extends ValueType {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将当前向量的各个分量除以指定标量。相当于 `this.scale(1 / scalar)`。
|
||||
* @param scalar 标量除数。
|
||||
*/
|
||||
public divideScalar (scalar: number) {
|
||||
this.x = this.x / scalar;
|
||||
this.y = this.y / scalar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public divide (other: Vec2) {
|
||||
this.x = this.x / other.x;
|
||||
this.y = this.y / other.y;
|
||||
|
||||
@@ -117,16 +117,6 @@ export class Vec3 extends ValueType {
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @zh 逐元素向量除法
|
||||
*/
|
||||
public static divideScalar<Out extends IVec3Like> (out: Out, a: Out, b: Out) {
|
||||
out.x = a.x / b.x;
|
||||
out.y = a.y / b.y;
|
||||
out.z = a.z / b.z;
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @zh 逐元素向量向上取整
|
||||
*/
|
||||
@@ -754,17 +744,6 @@ export class Vec3 extends ValueType {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将当前向量的各个分量除以指定标量。相当于 `this.scale(1 / scalar)`。
|
||||
* @param scalar 标量除数。
|
||||
*/
|
||||
public divideScalar (scalar: number) {
|
||||
this.x = this.x / scalar;
|
||||
this.y = this.y / scalar;
|
||||
this.z = this.z / scalar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public divide (other: Vec3) {
|
||||
this.x = this.x / other.x;
|
||||
this.y = this.y / other.y;
|
||||
|
||||
@@ -110,17 +110,6 @@ export class Vec4 extends ValueType {
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @zh 逐元素向量除法
|
||||
*/
|
||||
public static divideScalar <Out extends IVec4Like> (out: Out, a: Out, b: Out) {
|
||||
out.x = a.x / b.x;
|
||||
out.y = a.y / b.y;
|
||||
out.z = a.z / b.z;
|
||||
out.w = a.w / b.w;
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @zh 逐元素向量向上取整
|
||||
*/
|
||||
@@ -638,18 +627,6 @@ export class Vec4 extends ValueType {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将当前向量的各个分量除以指定标量。相当于 `this.multiply(1 / scalar, out)`。
|
||||
* @param scalar 标量除数。
|
||||
*/
|
||||
public divideScalar (scalar: number) {
|
||||
this.x = this.x / scalar;
|
||||
this.y = this.y / scalar;
|
||||
this.z = this.z / scalar;
|
||||
this.w = this.w / scalar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public divide (other: Vec4) {
|
||||
this.x = this.x / other.x;
|
||||
this.y = this.y / other.y;
|
||||
|
||||
@@ -193,7 +193,8 @@ export default class Touch {
|
||||
_vec2.set(this._point);
|
||||
_vec2.subtract(this._prevPoint);
|
||||
Vec2.set(out, cc.view.getScaleX(), cc.view.getScaleY());
|
||||
Vec2.divideScalar(out, _vec2, out);
|
||||
out.x = _vec2.x / out.x;
|
||||
out.y = _vec2.y / out.y;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
@@ -170,9 +170,13 @@ export class Node extends BaseNode implements INode {
|
||||
parent.updateWorldTransform();
|
||||
Vec3.subtract(local, this._pos, parent._pos);
|
||||
Vec3.transformQuat(local, local, Quat.conjugate(q_a, parent._rot));
|
||||
Vec3.divideScalar(local, local, parent._scale);
|
||||
local.x /= parent._scale.x;
|
||||
local.y /= parent._scale.y;
|
||||
local.z /= parent._scale.z;
|
||||
Quat.multiply(this._lrot, Quat.conjugate(q_a, parent._rot), this._rot);
|
||||
Vec3.divideScalar(this._lscale, this._scale, parent._scale);
|
||||
this._lscale.x = this._scale.x / parent._scale.x;
|
||||
this._lscale.y = this._scale.y / parent._scale.y;
|
||||
this._lscale.z = this._scale.z / parent._scale.z;
|
||||
} else {
|
||||
Vec3.copy(this._lpos, this._pos);
|
||||
Quat.copy(this._lrot, this._rot);
|
||||
@@ -615,7 +619,9 @@ export class Node extends BaseNode implements INode {
|
||||
parent.updateWorldTransform();
|
||||
Vec3.subtract(local, this._pos, parent._pos);
|
||||
Vec3.transformQuat(local, local, Quat.conjugate(q_a, parent._rot));
|
||||
Vec3.divideScalar(local, local, parent._scale);
|
||||
local.x /= parent._scale.x;
|
||||
local.y /= parent._scale.y;
|
||||
local.z /= parent._scale.z;
|
||||
} else {
|
||||
Vec3.copy(local, this._pos);
|
||||
}
|
||||
@@ -764,7 +770,9 @@ export class Node extends BaseNode implements INode {
|
||||
}
|
||||
if (this._parent) {
|
||||
this._parent.getWorldScale(v3_a);
|
||||
Vec3.divideScalar(this._lscale, this._scale, v3_a);
|
||||
this._lscale.x = this._scale.x / v3_a.x;
|
||||
this._lscale.y = this._scale.y / v3_a.y;
|
||||
this._lscale.z = this._scale.z / v3_a.z;
|
||||
} else {
|
||||
Vec3.copy(this._lscale, this._scale);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user