@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
43 lines (42 loc) • 2.56 kB
TypeScript
import { Object3D, Vector3, Quaternion } from 'three';
import { World, RigidBody } from '@dimforge/rapier3d-compat';
import { PhysicsLib } from './CorePhysics';
import { PolyScene } from '../../engine/scene/PolyScene';
export declare enum RBDProperty {
ANGULAR_VELOCITY = "angVel",
LINEAR_VELOCITY = "linVel",
POSITION = "position",
ROTATION = "rotation",
LINEAR_DAMPING = "linearDamping",
ANGULAR_DAMPING = "angularDamping",
IS_SLEEPING = "isSleeping",
IS_MOVING = "isMoving"
}
export declare function _getRBDFromId(rbdId: string): Object3D | undefined;
export declare function _getRBDFromObject(object: Object3D): RigidBody | undefined;
export declare function _getPhysicsWorldFromRBD(object: Object3D): World | undefined;
export declare function _physicsRBDDelete(scene: PolyScene, object: Object3D): void;
interface PhysicsCreateRBDOptions {
PhysicsLib: PhysicsLib;
world: World;
object: Object3D;
rigidBodyById: Map<string, RigidBody>;
objectsByRBD: WeakMap<RigidBody, Object3D>;
newRBDIds: Set<string>;
}
export declare function _physicsCreateRBD(options: PhysicsCreateRBDOptions): void;
export declare function physicsUpdateRBD(object: Object3D, rigidBody: RigidBody): void;
export declare function _physicsRBDApplyImpulse(object: Object3D, impulse: Vector3): void;
export declare function _physicsRBDApplyImpulseAtPoint(object: Object3D, impulse: Vector3, point: Vector3): void;
export declare function _physicsRBDApplyTorqueImpulse(object: Object3D, impulse: Vector3): void;
export declare function _physicsRBDAddForce(object: Object3D, force: Vector3): void;
export declare function _physicsRBDAddForceAtPoint(object: Object3D, force: Vector3, point: Vector3): void;
export declare function _physicsRBDAddTorque(object: Object3D, torque: Vector3): void;
export declare function _physicsRBDResetAll(object: Object3D, wakeup: boolean): void;
export declare function _physicsRBDResetForces(object: Object3D, wakeup: boolean): void;
export declare function _physicsRBDResetTorques(object: Object3D, wakeup: boolean): void;
export declare function _setPhysicsRBDPosition(object: Object3D, targetPosition: Vector3, lerp: number): void;
export declare function _setPhysicsRBDRotation(object: Object3D, targetQuaternion: Quaternion, lerp: number): void;
export declare function _setPhysicsRBDLinearVelocity(object: Object3D, targetVelocity: Vector3, lerp: number): void;
export declare function _setPhysicsRBDAngularVelocity(object: Object3D, targetVelocity: Vector3, lerp: number): void;
export {};