Class: TempPhyMath
Temporary Physics Math Utility
提供临时的 Ammo btVector3 和 btQuaternion 实例,并支持与引擎数据相互转换
Constructors
Properties
Methods
Constructors
constructor
• new TempPhyMath(): TempPhyMath
Returns
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
Name | Type |
---|---|
qua | Quaternion |
btQua? | btQuaternion |
Returns
Defined in
packages/physics/utils/TempPhyMath.ts:32
toBtVec
▸ toBtVec(vec
, btVec?
): btVector3
Vector3 to Ammo.btVector3
Parameters
Name | Type |
---|---|
vec | Vector3 |
btVec? | btVector3 |
Returns
Defined in
packages/physics/utils/TempPhyMath.ts:41
setBtVec
▸ setBtVec(x
, y
, z
, btVec?
): btVector3
Set Ammo.btVector3 using x, y, z
Parameters
Name | Type |
---|---|
x | number |
y | number |
z | number |
btVec? | btVector3 |
Returns
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
Name | Type |
---|---|
x | number |
y | number |
z | number |
w | number |
btQua? | btQuaternion |
Returns
Defined in
packages/physics/utils/TempPhyMath.ts:59
fromBtVec
▸ fromBtVec(btVec
, vec?
): Vector3
Ammo.btVector3 to Vector3
Parameters
Name | Type |
---|---|
btVec | btVector3 |
vec? | Vector3 |
Returns
Vector3
Defined in
packages/physics/utils/TempPhyMath.ts:68
fromBtQua
▸ fromBtQua(btQua
, qua?
): Quaternion
Ammo.btQuaternion to Quaternion
Parameters
Name | Type |
---|---|
btQua | btQuaternion |
qua? | Quaternion |
Returns
Quaternion
Defined in
packages/physics/utils/TempPhyMath.ts:77
eulerToBtQua
▸ eulerToBtQua(vec
, qua?
): btQuaternion
Euler Vector3 to Ammo.Quaternion
Parameters
Name | Type |
---|---|
vec | Vector3 |
qua? | btQuaternion |
Returns
Defined in
packages/physics/utils/TempPhyMath.ts:86
zeroBtVec
▸ zeroBtVec(btVec?
): btVector3
Sets the given Ammo.btVector3 to (0, 0, 0)
Parameters
Name | Type |
---|---|
btVec? | btVector3 |
Returns
Defined in
packages/physics/utils/TempPhyMath.ts:95
resetBtQua
▸ resetBtQua(btQua?
): btQuaternion
Sets the given Ammo.btQuaternion to (0, 0, 0, 1)
Parameters
Name | Type |
---|---|
btQua? | btQuaternion |