UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

59 lines (58 loc) 2.04 kB
/** * @import { AmmoPhysicsWorld } from './ammo-physics-world.js' */ /** * An Ammo.js rigid body. Converts engine math types to Bullet types using the owning world's * cached temporaries - no method allocates. * * @ignore */ export class AmmoPhysicsBody extends PhysicsBody { /** * @param {AmmoPhysicsWorld} world - The owning world. * @param {object} nativeBody - The btRigidBody. * @param {string} type - The body type: BODYTYPE_STATIC, BODYTYPE_DYNAMIC or * BODYTYPE_KINEMATIC. * @param {boolean} noContactResponse - Whether the body has no contact response. */ constructor(world: AmmoPhysicsWorld, nativeBody: object, type: string, noContactResponse: boolean); /** * @type {AmmoPhysicsWorld} * @private */ private _world; /** * The body type the native body was constructed with. * * @type {string} * @private */ private _type; /** * Whether the body was created without contact response (trigger). * * @private */ private _noContactResponse; setFriction(friction: any): void; setRollingFriction(friction: any): void; setRestitution(restitution: any): void; setDamping(linear: any, angular: any): void; setLinearFactor(factor: any): void; setAngularFactor(factor: any): void; setLinearVelocity(velocity: any): void; getLinearVelocity(velocity: any): void; setAngularVelocity(velocity: any): void; getAngularVelocity(velocity: any): void; setMass(mass: any): void; isActive(): any; setTransform(position: any, rotation: any): void; getTransform(position: any, rotation: any): void; setKinematicTarget(position: any, rotation: any): void; applyForce(force: any, relativePoint: any): void; applyTorque(torque: any): void; applyImpulse(impulse: any, relativePoint: any): void; applyTorqueImpulse(torque: any): void; } import { PhysicsBody } from '../physics-body.js'; import type { AmmoPhysicsWorld } from './ammo-physics-world.js';