import { AmmoJointType, AmmoShapeType, AmmoSoftBodyType } from '.'; import { BaseBodyOptions, Vec3, Vec4 } from '../physics'; import { AmmoRigidBody } from './RigidBody'; export declare type AmmoSoftBodyOptions = BaseBodyOptions & { damping?: number; /** * 质量 */ mass?: number; type?: AmmoSoftBodyType; /** * The stiffness the physics imposter, soft object only */ stiffness?: number; /** * The number of iterations used in maintaining consistent vertex velocities, soft object only */ velocityIterations?: number; /** * The number of iterations used in maintaining consistent vertex positions, soft object only */ positionIterations?: number; /** * The number used to fix points on a cloth (0, 1, 2, 4, 8) or rope (0, 1, 2) only * 0 None, 1, back left or top, 2, back right or bottom, 4, front left, 8, front right * Add to fix multiple points */ fixedPoints?: number; /** * The collision margin around a soft object */ margin?: number; /** * The path for a rope based on an extrusion */ path?: any; /** * The shape of an extrusion used for a rope based on an extrusion */ shape?: any; }; export declare type AmmoClothSoftBodyOptions = AmmoSoftBodyOptions & { type: AmmoSoftBodyType.cloth; widthSegments: number; heightSegments: number; positions: Float32Array; }; export declare type AmmoRopeSoftBodyOptions = AmmoSoftBodyOptions & { type: AmmoSoftBodyType.rope; positions: Float32Array; }; export declare type AmmoVolumeSoftBodyOptions = AmmoSoftBodyOptions & { type: AmmoSoftBodyType.volume; indices: Uint16Array; positions: Float32Array; /** * The pressure inside the physics imposter, soft object only */ pressure?: number; }; export declare type AmmoSoftBodyOptionsAll = AmmoClothSoftBodyOptions | AmmoRopeSoftBodyOptions | AmmoVolumeSoftBodyOptions; export interface AmmoWorldOptions { gravity?: Vec3; Ammo: any; wasm?: string; } export interface AmmoRigidBodyOptions extends BaseBodyOptions { /** * 质量 */ mass?: number; /** * 只有ammo存在margin */ margin?: number; allowSleep?: boolean; shapes?: AmmoShapeOptions; position?: Vec3; rotation?: Vec4; scale?: Vec3; } export interface AmmoShapeOptions { type: AmmoShapeType; /** * shape实例 */ instance?: any; } export interface AmmoBoxShapeOptions extends AmmoShapeOptions { type: AmmoShapeType.box; width: number; height: number; depth: number; } export interface AmmoSphereShapeOptions extends AmmoShapeOptions { type: AmmoShapeType.sphere; radius: number; } export interface AmmoCylinderShapeOptions extends AmmoShapeOptions { type: AmmoShapeType.cylinder; radius: number; height: number; } export interface AmmoBaseJointOptions { type: AmmoJointType; name?: string; collision?: boolean; } export interface AmmoDistanceJointOptions extends AmmoBaseJointOptions { mainBody: AmmoRigidBody; connectedBody: AmmoRigidBody; mainPivot: Vec3; connectedPivot: Vec3; maxDistance: number; } export interface AmmoHingeJointOptions extends AmmoBaseJointOptions { mainBody: AmmoRigidBody; connectedBody: AmmoRigidBody; mainPivot: Vec3; connectedPivot: Vec3; mainAxis: Vec3; connectedAxis: Vec3; } export interface AmmoBallAndSocketJointOptions extends AmmoBaseJointOptions { mainBody: AmmoRigidBody; connectedBody: AmmoRigidBody; mainPivot: Vec3; connectedPivot: Vec3; }