mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
1a99b886b6
* basic physics abstract spec * spec tweaks * stash * cannon refactor * builtin refactor * cannon wrapper & framework tweaks * cannon wrapper import tweaks * remve unneeded code * group mask tweaks * hiding, wait for 1.0.3 * builtin tweaks * delete unneed code * export CANNON * update @cocos/cannon to 1.0.3 * using hasTigger property * fix remove cannon body * rebase * update cannon version to 1.0.4 * rename stash * rename I-rigid-body to i-rigid-body
31 lines
776 B
TypeScript
31 lines
776 B
TypeScript
/**
|
|
* @hidden
|
|
*/
|
|
|
|
import { Vec3 } from '../../core/math';
|
|
import { IVec3Like, IQuatLike } from '../../core/math/type-define';
|
|
|
|
export function stringfyVec3 (value: IVec3Like): string {
|
|
return `(x: ${value.x}, y: ${value.y}, z: ${value.z})`;
|
|
}
|
|
|
|
export function stringfyQuat (value: IQuatLike): string {
|
|
return `(x: ${value.x}, y: ${value.y}, z: ${value.z}, w: ${value.w})`;
|
|
}
|
|
|
|
interface IWrapped<T> {
|
|
__cc_wrapper__: T;
|
|
}
|
|
|
|
export function setWrap<Wrapper> (object: any, wrapper: Wrapper) {
|
|
(object as IWrapped<Wrapper>).__cc_wrapper__ = wrapper;
|
|
}
|
|
|
|
export function getWrap<Wrapper> (object: any) {
|
|
return (object as IWrapped<Wrapper>).__cc_wrapper__;
|
|
}
|
|
|
|
export function maxComponent (v: Vec3) {
|
|
return Math.max(v.x, Math.max(v.y, v.z));
|
|
}
|