Skip to content

Class: TempPhyMath

Temporary Physics Math Utility

提供临时的 Ammo btVector3 和 btQuaternion 实例,并支持与引擎数据相互转换

Constructors

Properties

Methods

Constructors

constructor

new TempPhyMath(): TempPhyMath

Returns

TempPhyMath

Properties

tmpVecA

Static Readonly tmpVecA: btVector3

Defined in

packages/physics/utils/TempPhyMath.ts:10


tmpVecB

Static Readonly tmpVecB: btVector3

Defined in

packages/physics/utils/TempPhyMath.ts:11


tmpVecC

Static Readonly tmpVecC: btVector3

Defined in

packages/physics/utils/TempPhyMath.ts:12


tmpVecD

Static Readonly tmpVecD: btVector3

Defined in

packages/physics/utils/TempPhyMath.ts:13


tmpQuaA

Static Readonly tmpQuaA: btQuaternion

Defined in

packages/physics/utils/TempPhyMath.ts:14


tmpQuaB

Static Readonly tmpQuaB: btQuaternion

Defined in

packages/physics/utils/TempPhyMath.ts:15

Methods

init

init(): void

初始化 Ammo 后创建预定义的 btVector3 和 btQuaternion 实例,以便复用

Returns

void

Defined in

packages/physics/utils/TempPhyMath.ts:20


toBtQua

toBtQua(qua, btQua?): btQuaternion

Quaternion to Ammo.btQuaternion

Parameters

NameType
quaQuaternion
btQua?btQuaternion

Returns

btQuaternion

Defined in

packages/physics/utils/TempPhyMath.ts:32


toBtVec

toBtVec(vec, btVec?): btVector3

Vector3 to Ammo.btVector3

Parameters

NameType
vecVector3
btVec?btVector3

Returns

btVector3

Defined in

packages/physics/utils/TempPhyMath.ts:41


setBtVec

setBtVec(x, y, z, btVec?): btVector3

Set Ammo.btVector3 using x, y, z

Parameters

NameType
xnumber
ynumber
znumber
btVec?btVector3

Returns

btVector3

Defined in

packages/physics/utils/TempPhyMath.ts:50


setBtQua

setBtQua(x, y, z, w, btQua?): btQuaternion

Set Ammo.btQuaternion using x, y, z, w

Parameters

NameType
xnumber
ynumber
znumber
wnumber
btQua?btQuaternion

Returns

btQuaternion

Defined in

packages/physics/utils/TempPhyMath.ts:59


fromBtVec

fromBtVec(btVec, vec?): Vector3

Ammo.btVector3 to Vector3

Parameters

NameType
btVecbtVector3
vec?Vector3

Returns

Vector3

Defined in

packages/physics/utils/TempPhyMath.ts:68


fromBtQua

fromBtQua(btQua, qua?): Quaternion

Ammo.btQuaternion to Quaternion

Parameters

NameType
btQuabtQuaternion
qua?Quaternion

Returns

Quaternion

Defined in

packages/physics/utils/TempPhyMath.ts:77


eulerToBtQua

eulerToBtQua(vec, qua?): btQuaternion

Euler Vector3 to Ammo.Quaternion

Parameters

NameType
vecVector3
qua?btQuaternion

Returns

btQuaternion

Defined in

packages/physics/utils/TempPhyMath.ts:86


zeroBtVec

zeroBtVec(btVec?): btVector3

Sets the given Ammo.btVector3 to (0, 0, 0)

Parameters

NameType
btVec?btVector3

Returns

btVector3

Defined in

packages/physics/utils/TempPhyMath.ts:95


resetBtQua

resetBtQua(btQua?): btQuaternion

Sets the given Ammo.btQuaternion to (0, 0, 0, 1)

Parameters

NameType
btQua?btQuaternion

Returns

btQuaternion

Defined in

packages/physics/utils/TempPhyMath.ts:102