UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

146 lines (145 loc) 8.95 kB
import { Vector3 } from 'three'; import { PhysicsJointAttribute } from './PhysicsJoint'; import { CoreObjectType, ObjectContent } from '../geometry/ObjectContent'; export declare enum PhysicsIdAttribute { WORLD = "PhysicsIdAttribute_worldId", RBD_HANDLE = "PhysicsIdAttribute_rbdHandle", DEBUG_WORLD = "PhysicsIdAttribute_debugWorldId" } export declare enum PhysicsRBDType { FIXED = "fixed", DYNAMIC = "dynamic", KINEMATIC_VEL = "kinematicVelocityBased", KINEMATIC_POS = "kinematicPositionBased" } export declare const PHYSICS_RBD_TYPES: PhysicsRBDType[]; export declare const PHYSICS_RBD_TYPE_MENU_ENTRIES: { name: PhysicsRBDType; value: number; }[]; export declare enum PhysicsRBDColliderType { CAPSULE = "capsule", CONE = "cone", CONVEX_HULL = "convex hull", CUBOID = "cuboid", CYLINDER = "cylinder", SPHERE = "sphere", TRIMESH = "trimesh", HEIGHT_FIELD = "heightField" } export declare const PHYSICS_RBD_COLLIDER_TYPES: PhysicsRBDColliderType[]; export declare const PHYSICS_RBD_COLLIDER_TYPE_MENU_ENTRIES: { name: PhysicsRBDColliderType; value: number; }[]; export declare enum PhysicsRBDCuboidAttribute { SIZES = "sizes", SIZE = "size" } export declare enum PhysicsRBDRadiusAttribute { RADIUS = "radius" } export declare enum PhysicsRBDHeightAttribute { HEIGHT = "height" } export declare enum PhysicsRBDCylinderAttribute { HEIGHT = "height" } export declare enum PhysicsRBDHeightFieldAttribute { HEIGHT_FIELD_ROWS = "heightFieldRows", HEIGHT_FIELD_COLS = "heightFieldCols" } export declare enum PhysicsCommonAttribute { RBD_ID = "RBDId", RBD_TYPE = "RBDType", COLLIDER_TYPE = "RBDColliderType", BORDER_RADIUS = "borderRadius", CAN_SLEEP = "RBDCanSleep", DENSITY = "density", RESTITUTION = "restitution", FRICTION = "friction", LINEAR_DAMPING = "linearDamping", ANGULAR_DAMPING = "angularDamping", LINEAR_VELOCITY = "linearVelocity", ANGULAR_VELOCITY = "angularVelocity", GRAVITY_SCALE = "gravityScale", CHARACTER_CONTROLLER_ID = "characterControllerId", CHARACTER_CONTROLLER_OFFSET = "characterControllerOffset", CHARACTER_CONTROLLER_APPLY_IMPULSES_TO_DYNAMIC = "characterControllerApplyImpulsesToDynamic", CHARACTER_CONTROLLER_SNAP_TO_GROUND_DISTANCE = "characterControllerSnapToGroundDistance", CHARACTER_CONTROLLER_AUTO_STEP_MAX_HEIGHT = "characterControllerAutoStepMaxHeight", CHARACTER_CONTROLLER_AUTO_STEP_MIN_WIDTH = "characterControllerAutoStepMinWidth", CHARACTER_CONTROLLER_AUTO_STEP_ON_DYNAMIC = "characterControllerAutoStepOnDynamic", CHARACTER_CONTROLLER_MAX_SLOPE_CLIMB_ANGLE = "characterControllerMaxSlopeClimbAngle", CHARACTER_CONTROLLER_MIN_SLOPE_CLIMB_ANGLE = "characterControllerMinSlopeSlideAngle", CHARACTER_CONTROLLER_UP = "characterControllerUp", CHARACTER_CONTROLLER_CAMERA_OBJECT_PATH = "characterControllerCameraObjectPath" } type PhysicsAttribute = PhysicsCommonAttribute | PhysicsRBDCuboidAttribute | PhysicsRBDRadiusAttribute | PhysicsRBDHeightAttribute | PhysicsRBDHeightFieldAttribute | PhysicsJointAttribute; export declare function physicsAttribNameLive(attribute: PhysicsAttribute): string; export declare class CorePhysicsAttribute { static setRBDHandle(object: ObjectContent<CoreObjectType>, value: number): void; static getRBDHandle(object: ObjectContent<CoreObjectType>): number; static deleteRBDHandle(object: ObjectContent<CoreObjectType>): void; static setRBDId(object: ObjectContent<CoreObjectType>, value: string): void; static getRBDId(object: ObjectContent<CoreObjectType>): string; static setRBDType(object: ObjectContent<CoreObjectType>, value: PhysicsRBDType): void; static getRBDType(object: ObjectContent<CoreObjectType>): PhysicsRBDType | undefined; static setColliderType(object: ObjectContent<CoreObjectType>, value: PhysicsRBDColliderType): void; static getColliderType(object: ObjectContent<CoreObjectType>): PhysicsRBDColliderType | undefined; static setCanSleep(object: ObjectContent<CoreObjectType>, value: boolean): void; static getCanSleep(object: ObjectContent<CoreObjectType>): boolean; static setDensity(object: ObjectContent<CoreObjectType>, value: number): void; static getDensity(object: ObjectContent<CoreObjectType>): number; static setRestitution(object: ObjectContent<CoreObjectType>, value: number): void; static getRestitution(object: ObjectContent<CoreObjectType>): number; static setFriction(object: ObjectContent<CoreObjectType>, value: number): void; static getFriction(object: ObjectContent<CoreObjectType>): number; static setLinearDamping(object: ObjectContent<CoreObjectType>, value: number): void; static getLinearDamping(object: ObjectContent<CoreObjectType>): number; static setAngularDamping(object: ObjectContent<CoreObjectType>, value: number): void; static getAngularDamping(object: ObjectContent<CoreObjectType>): number; static setLinearVelocity(object: ObjectContent<CoreObjectType>, value: Vector3): void; static getLinearVelocity(object: ObjectContent<CoreObjectType>, target: Vector3): void; static setAngularVelocity(object: ObjectContent<CoreObjectType>, value: Vector3): void; static getAngularVelocity(object: ObjectContent<CoreObjectType>, target: Vector3): void; static setGravityScale(object: ObjectContent<CoreObjectType>, value: number): void; static getGravityScale(object: ObjectContent<CoreObjectType>): number; static setBorderRadius(object: ObjectContent<CoreObjectType>, value: number): void; static getBorderRadius(object: ObjectContent<CoreObjectType>): number; static setCuboidSizes(object: ObjectContent<CoreObjectType>, value: Vector3): void; static getCuboidSizes(object: ObjectContent<CoreObjectType>, value: Vector3): void; static setCuboidSize(object: ObjectContent<CoreObjectType>, value: number): void; static getCuboidSize(object: ObjectContent<CoreObjectType>): number; static setRadius(object: ObjectContent<CoreObjectType>, value: number): void; static getRadius(object: ObjectContent<CoreObjectType>): number; static setHeight(object: ObjectContent<CoreObjectType>, value: number): void; static getHeight(object: ObjectContent<CoreObjectType>): number; static setHeightFieldRows(object: ObjectContent<CoreObjectType>, value: number): void; static getHeightFieldRows(object: ObjectContent<CoreObjectType>): number; static setHeightFieldCols(object: ObjectContent<CoreObjectType>, value: number): void; static getHeightFieldCols(object: ObjectContent<CoreObjectType>): number; static setCharacterControllerId(object: ObjectContent<CoreObjectType>, value: string): void; static getCharacterControllerId(object: ObjectContent<CoreObjectType>): string; static setCharacterControllerOffset(object: ObjectContent<CoreObjectType>, value: number): void; static getCharacterControllerOffset(object: ObjectContent<CoreObjectType>): number; static setCharacterControllerUp(object: ObjectContent<CoreObjectType>, value: Vector3): void; static getCharacterControllerUp(object: ObjectContent<CoreObjectType>, target: Vector3): void; static setCharacterControllerMaxSlopeClimbAngle(object: ObjectContent<CoreObjectType>, value: number): void; static getCharacterControllerMaxSlopeClimbAngle(object: ObjectContent<CoreObjectType>): number; static setCharacterControllerMinSlopeSlideAngle(object: ObjectContent<CoreObjectType>, value: number): void; static getCharacterControllerMinSlopeSlideAngle(object: ObjectContent<CoreObjectType>): number; static setCharacterControllerApplyImpulsesToDynamic(object: ObjectContent<CoreObjectType>, value: boolean): void; static getCharacterControllerApplyImpulsesToDynamic(object: ObjectContent<CoreObjectType>): boolean; static setCharacterControllerSnapToGroundDistance(object: ObjectContent<CoreObjectType>, value: number): void; static getCharacterControllerSnapToGroundDistance(object: ObjectContent<CoreObjectType>): number; static setCharacterControllerAutoStepMaxHeight(object: ObjectContent<CoreObjectType>, value: number): void; static getCharacterControllerAutoStepMaxHeight(object: ObjectContent<CoreObjectType>): number; static setCharacterControllerAutoStepMinWidth(object: ObjectContent<CoreObjectType>, value: number): void; static getCharacterControllerAutoStepMinWidth(object: ObjectContent<CoreObjectType>): number; static setCharacterControllerAutoStepOnDynamic(object: ObjectContent<CoreObjectType>, value: boolean): void; static getCharacterControllerAutoStepOnDynamic(object: ObjectContent<CoreObjectType>): boolean; static setCharacterControllerCameraPath(object: ObjectContent<CoreObjectType>, value: string): void; static getCharacterControllerCameraPath(object: ObjectContent<CoreObjectType>): string; } export {};