@absolutejs/rapier3d 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +85 -2
  3. package/dist/provenance.json +10 -0
  4. package/dist/rapier.mjs +1 -0
  5. package/dist/types/coarena.d.ts +15 -0
  6. package/dist/types/control/character_controller.d.ts +191 -0
  7. package/dist/types/control/index.d.ts +3 -0
  8. package/dist/types/control/pid_controller.d.ts +50 -0
  9. package/dist/types/control/ray_cast_vehicle_controller.d.ts +277 -0
  10. package/dist/types/dynamics/ccd_solver.d.ts +15 -0
  11. package/dist/types/dynamics/coefficient_combine_rule.d.ts +13 -0
  12. package/dist/types/dynamics/impulse_joint.d.ts +359 -0
  13. package/dist/types/dynamics/impulse_joint_set.d.ts +84 -0
  14. package/dist/types/dynamics/index.d.ts +12 -0
  15. package/dist/types/dynamics/integration_parameters.d.ts +109 -0
  16. package/dist/types/dynamics/island_manager.d.ts +24 -0
  17. package/dist/types/dynamics/multibody_joint.d.ts +42 -0
  18. package/dist/types/dynamics/multibody_joint_set.d.ts +81 -0
  19. package/dist/types/dynamics/rigid_body.d.ts +839 -0
  20. package/dist/types/dynamics/rigid_body_set.d.ts +90 -0
  21. package/dist/types/dynamics/soft_body.d.ts +1210 -0
  22. package/dist/types/dynamics/soft_body_set.d.ts +99 -0
  23. package/dist/types/exports.d.ts +8 -0
  24. package/dist/types/geometry/broad_phase.d.ts +162 -0
  25. package/dist/types/geometry/collider.d.ts +1016 -0
  26. package/dist/types/geometry/collider_set.d.ts +97 -0
  27. package/dist/types/geometry/contact.d.ts +36 -0
  28. package/dist/types/geometry/feature.d.ts +6 -0
  29. package/dist/types/geometry/index.d.ts +11 -0
  30. package/dist/types/geometry/interaction_groups.d.ts +18 -0
  31. package/dist/types/geometry/narrow_phase.d.ts +151 -0
  32. package/dist/types/geometry/point.d.ts +58 -0
  33. package/dist/types/geometry/ray.d.ts +108 -0
  34. package/dist/types/geometry/shape.d.ts +681 -0
  35. package/dist/types/geometry/toi.d.ts +59 -0
  36. package/dist/types/init.d.ts +3 -0
  37. package/dist/types/math.d.ts +98 -0
  38. package/dist/types/pipeline/debug_render_pipeline.d.ts +40 -0
  39. package/dist/types/pipeline/event_queue.d.ts +113 -0
  40. package/dist/types/pipeline/index.d.ts +7 -0
  41. package/dist/types/pipeline/physics_hooks.d.ts +39 -0
  42. package/dist/types/pipeline/physics_pipeline.d.ts +12 -0
  43. package/dist/types/pipeline/query_pipeline.d.ts +38 -0
  44. package/dist/types/pipeline/serialization_pipeline.d.ts +37 -0
  45. package/dist/types/pipeline/world.d.ts +674 -0
  46. package/dist/types/rapier.d.ts +3 -0
  47. package/dist/types/rapier_wasm3d.d.ts +2929 -0
  48. package/dist/types/raw.d.ts +1 -0
  49. package/package.json +33 -4
@@ -0,0 +1,90 @@
1
+ import { RawRigidBodySet } from "../raw";
2
+ import { RigidBody, RigidBodyDesc, RigidBodyHandle } from "./rigid_body";
3
+ import { ColliderSet } from "../geometry";
4
+ import { ImpulseJointSet } from "./impulse_joint_set";
5
+ import { MultibodyJointSet } from "./multibody_joint_set";
6
+ import { IslandManager } from "./island_manager";
7
+ import { SoftBodySet } from "./soft_body_set";
8
+ /**
9
+ * A set of rigid bodies that can be handled by a physics pipeline.
10
+ *
11
+ * To avoid leaking WASM resources, this MUST be freed manually with `rigidBodySet.free()`
12
+ * once you are done using it (and all the rigid-bodies it created).
13
+ */
14
+ export declare class RigidBodySet {
15
+ raw: RawRigidBodySet;
16
+ private map;
17
+ /**
18
+ * Release the WASM memory occupied by this rigid-body set.
19
+ */
20
+ free(): void;
21
+ constructor(raw?: RawRigidBodySet);
22
+ /**
23
+ * Internal method, do not call this explicitly.
24
+ */
25
+ finalizeDeserialization(colliderSet: ColliderSet): void;
26
+ /**
27
+ * Creates a new rigid-body and return its integer handle.
28
+ *
29
+ * @param desc - The description of the rigid-body to create.
30
+ */
31
+ createRigidBody(colliderSet: ColliderSet, desc: RigidBodyDesc): RigidBody;
32
+ /**
33
+ * Removes a rigid-body from this set.
34
+ *
35
+ * This will also remove all the colliders and joints attached to the rigid-body.
36
+ *
37
+ * @param handle - The integer handle of the rigid-body to remove.
38
+ * @param colliders - The set of colliders that may contain colliders attached to the removed rigid-body.
39
+ * @param softBodies - The set of soft bodies: removing a cluster proxy removes its cluster.
40
+ * @param impulseJoints - The set of impulse joints that may contain joints attached to the removed rigid-body.
41
+ * @param multibodyJoints - The set of multibody joints that may contain joints attached to the removed rigid-body.
42
+ */
43
+ remove(handle: RigidBodyHandle, islands: IslandManager, colliders: ColliderSet, softBodies: SoftBodySet, impulseJoints: ImpulseJointSet, multibodyJoints: MultibodyJointSet): void;
44
+ /**
45
+ * Wraps the rigid-bodies the engine created on its own (the proxies of soft bodies and
46
+ * their clusters) that have no JavaScript wrapper yet.
47
+ */
48
+ mapNewBodies(colliders: ColliderSet): void;
49
+ /**
50
+ * Drops the wrappers of the rigid-bodies the engine removed on its own (the proxies of
51
+ * removed soft bodies and clusters).
52
+ */
53
+ unmapRemovedBodies(): void;
54
+ /**
55
+ * The number of rigid-bodies on this set.
56
+ */
57
+ len(): number;
58
+ /**
59
+ * Does this set contain a rigid-body with the given handle?
60
+ *
61
+ * @param handle - The rigid-body handle to check.
62
+ */
63
+ contains(handle: RigidBodyHandle): boolean;
64
+ /**
65
+ * Gets the rigid-body with the given handle.
66
+ *
67
+ * @param handle - The handle of the rigid-body to retrieve.
68
+ */
69
+ get(handle: RigidBodyHandle): RigidBody | null;
70
+ /**
71
+ * Applies the given closure to each rigid-body contained by this set.
72
+ *
73
+ * @param f - The closure to apply.
74
+ */
75
+ forEach(f: (body: RigidBody) => void): void;
76
+ /**
77
+ * Applies the given closure to each active rigid-bodies contained by this set.
78
+ *
79
+ * A rigid-body is active if it is not sleeping, i.e., if it moved recently.
80
+ *
81
+ * @param f - The closure to apply.
82
+ */
83
+ forEachActiveRigidBody(islands: IslandManager, f: (body: RigidBody) => void): void;
84
+ /**
85
+ * Gets all rigid-bodies in the list.
86
+ *
87
+ * @returns rigid-bodies list.
88
+ */
89
+ getAll(): RigidBody[];
90
+ }