@alexandernanberg/rapier3d 0.0.2 → 0.0.3

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.
package/dist/simd.mjs CHANGED
@@ -4461,22 +4461,6 @@ var RawRigidBodySet = class RawRigidBodySet {
4461
4461
  wasm.rawrigidbodyset_rbSetNextKinematicTransform(this.__wbg_ptr, handle, tx, ty, tz, rx, ry, rz, rw);
4462
4462
  }
4463
4463
  /**
4464
- * Sets next kinematic transforms for multiple rigid-bodies in a single WASM call.
4465
- *
4466
- * # Parameters
4467
- * - `data`: Float32Array with layout [handle, tx, ty, tz, rx, ry, rz, rw] × N
4468
- * - `count`: Number of bodies in the batch
4469
- * @param {Float32Array} data
4470
- * @param {number} count
4471
- */
4472
- rbSetNextKinematicTransformsBatch(data, count) {
4473
- try {
4474
- wasm.rawrigidbodyset_rbSetNextKinematicTransformsBatch(this.__wbg_ptr, addBorrowedObject(data), count);
4475
- } finally {
4476
- heap[stack_pointer++] = void 0;
4477
- }
4478
- }
4479
- /**
4480
4464
  * If this rigid body is kinematic, sets its future translation after the next timestep integration.
4481
4465
  *
4482
4466
  * This should be used instead of `rigidBody.setTranslation` to make the dynamic object
@@ -4547,24 +4531,6 @@ var RawRigidBodySet = class RawRigidBodySet {
4547
4531
  wasm.rawrigidbodyset_rbSetTransform(this.__wbg_ptr, handle, tx, ty, tz, rx, ry, rz, rw, wakeUp);
4548
4532
  }
4549
4533
  /**
4550
- * Sets transforms for multiple rigid-bodies in a single WASM call.
4551
- *
4552
- * # Parameters
4553
- * - `data`: Float32Array with layout [handle, tx, ty, tz, rx, ry, rz, rw] × N
4554
- * - `count`: Number of bodies in the batch
4555
- * - `wakeUp`: forces the rigid-bodies to wake-up
4556
- * @param {Float32Array} data
4557
- * @param {number} count
4558
- * @param {boolean} wakeUp
4559
- */
4560
- rbSetTransformsBatch(data, count, wakeUp) {
4561
- try {
4562
- wasm.rawrigidbodyset_rbSetTransformsBatch(this.__wbg_ptr, addBorrowedObject(data), count, wakeUp);
4563
- } finally {
4564
- heap[stack_pointer++] = void 0;
4565
- }
4566
- }
4567
- /**
4568
4534
  * Sets the translation of this rigid-body.
4569
4535
  *
4570
4536
  * # Parameters
@@ -5614,9 +5580,6 @@ function __wbg_get_imports() {
5614
5580
  __wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
5615
5581
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
5616
5582
  },
5617
- __wbg_prototypesetcall_c7e6a26aeade796d: function(arg0, arg1, arg2) {
5618
- Float32Array.prototype.set.call(getArrayF32FromWasm0(arg0, arg1), getObject(arg2));
5619
- },
5620
5583
  __wbg_rawcontactforceevent_new: function(arg0) {
5621
5584
  return addHeapObject(RawContactForceEvent.__wrap(arg0));
5622
5585
  },
@@ -8197,111 +8160,6 @@ var IslandManager = class {
8197
8160
  }
8198
8161
  };
8199
8162
 
8200
- //#endregion
8201
- //#region src/dynamics/transform_batch.ts
8202
- /**
8203
- * A batch of transforms for efficient bulk updates.
8204
- *
8205
- * This class allows you to collect multiple body transforms and apply them
8206
- * all in a single WASM call, reducing boundary-crossing overhead.
8207
- *
8208
- * @example
8209
- * ```typescript
8210
- * const batch = RAPIER.createTransformBatch(1000);
8211
- *
8212
- * // In your game loop:
8213
- * batch.clear();
8214
- * for (const body of kinematicBodies) {
8215
- * batch.add(body.handle, mesh.position, mesh.quaternion);
8216
- * }
8217
- * world.setNextKinematicTransformsBatch(batch);
8218
- * world.step();
8219
- * ```
8220
- */
8221
- var TransformBatch = class TransformBatch {
8222
- static {
8223
- this.FLOATS_PER_ENTRY = 8;
8224
- }
8225
- /**
8226
- * Creates a new TransformBatch with the given initial capacity.
8227
- *
8228
- * @param capacity - The initial number of transforms this batch can hold.
8229
- */
8230
- constructor(capacity) {
8231
- this.count = 0;
8232
- this.buffer = new Float32Array(capacity * TransformBatch.FLOATS_PER_ENTRY);
8233
- }
8234
- /**
8235
- * The current number of transforms in the batch.
8236
- */
8237
- get length() {
8238
- return this.count;
8239
- }
8240
- /**
8241
- * The maximum number of transforms this batch can hold without growing.
8242
- */
8243
- get capacity() {
8244
- return this.buffer.length / TransformBatch.FLOATS_PER_ENTRY;
8245
- }
8246
- /**
8247
- * Clears all transforms from the batch.
8248
- * Call this at the start of each frame before adding new transforms.
8249
- */
8250
- clear() {
8251
- this.count = 0;
8252
- }
8253
- /**
8254
- * Adds a transform to the batch.
8255
- *
8256
- * @param handle - The rigid body handle.
8257
- * @param translation - The position to set.
8258
- * @param rotation - The rotation quaternion to set.
8259
- */
8260
- add(handle, translation, rotation) {
8261
- if (this.count >= this.capacity) this.grow();
8262
- const offset = this.count * TransformBatch.FLOATS_PER_ENTRY;
8263
- this.buffer[offset] = handle;
8264
- this.buffer[offset + 1] = translation.x;
8265
- this.buffer[offset + 2] = translation.y;
8266
- this.buffer[offset + 3] = translation.z;
8267
- this.buffer[offset + 4] = rotation.x;
8268
- this.buffer[offset + 5] = rotation.y;
8269
- this.buffer[offset + 6] = rotation.z;
8270
- this.buffer[offset + 7] = rotation.w;
8271
- this.count++;
8272
- }
8273
- grow() {
8274
- const newBuffer = new Float32Array(this.buffer.length * 2);
8275
- newBuffer.set(this.buffer);
8276
- this.buffer = newBuffer;
8277
- }
8278
- };
8279
- /**
8280
- * Creates a new TransformBatch for efficient bulk body updates.
8281
- *
8282
- * @param capacity - The initial number of transforms the batch can hold.
8283
- * The batch will automatically grow if more are added.
8284
- * @returns A new TransformBatch instance.
8285
- *
8286
- * @example
8287
- * ```typescript
8288
- * // Create once, reuse every frame
8289
- * const batch = RAPIER.createTransformBatch(1000);
8290
- *
8291
- * function update() {
8292
- * batch.clear();
8293
- * for (const body of kinematicBodies) {
8294
- * batch.add(body.handle, mesh.position, mesh.quaternion);
8295
- * }
8296
- * world.setNextKinematicTransformsBatch(batch);
8297
- * world.step();
8298
- * }
8299
- * ```
8300
- */
8301
- function createTransformBatch(capacity) {
8302
- return new TransformBatch(capacity);
8303
- }
8304
-
8305
8163
  //#endregion
8306
8164
  //#region src/geometry/feature.ts
8307
8165
  let FeatureType = /* @__PURE__ */ function(FeatureType) {
@@ -10645,50 +10503,6 @@ var World = class World {
10645
10503
  return this.bodies.createRigidBody(this.colliders, body);
10646
10504
  }
10647
10505
  /**
10648
- * Sets transforms for multiple rigid-bodies in a single WASM call.
10649
- *
10650
- * This is more efficient than calling `setTransform` on each body individually
10651
- * when you need to update many bodies at once.
10652
- *
10653
- * @param batch - The batch of transforms to apply.
10654
- * @param wakeUp - Forces the rigid-bodies to wake-up so they are properly affected by forces.
10655
- *
10656
- * @example
10657
- * ```typescript
10658
- * const batch = RAPIER.createTransformBatch(1000);
10659
- * batch.clear();
10660
- * for (const body of dynamicBodies) {
10661
- * batch.add(body.handle, newPosition, newRotation);
10662
- * }
10663
- * world.setTransformsBatch(batch, true);
10664
- * ```
10665
- */
10666
- setTransformsBatch(batch, wakeUp) {
10667
- this.bodies.raw.rbSetTransformsBatch(batch.buffer, batch.count, wakeUp);
10668
- }
10669
- /**
10670
- * Sets next kinematic transforms for multiple rigid-bodies in a single WASM call.
10671
- *
10672
- * This is more efficient than calling `setNextKinematicTransform` on each body individually
10673
- * when you need to update many kinematic bodies at once.
10674
- *
10675
- * @param batch - The batch of transforms to apply.
10676
- *
10677
- * @example
10678
- * ```typescript
10679
- * const batch = RAPIER.createTransformBatch(1000);
10680
- * batch.clear();
10681
- * for (const body of kinematicBodies) {
10682
- * batch.add(body.handle, mesh.position, mesh.quaternion);
10683
- * }
10684
- * world.setNextKinematicTransformsBatch(batch);
10685
- * world.step();
10686
- * ```
10687
- */
10688
- setNextKinematicTransformsBatch(batch) {
10689
- this.bodies.raw.rbSetNextKinematicTransformsBatch(batch.buffer, batch.count);
10690
- }
10691
- /**
10692
10506
  * Creates a new character controller.
10693
10507
  *
10694
10508
  * @param offset - The artificial gap added between the character’s chape and its environment.
@@ -12818,7 +12632,6 @@ var exports_exports = /* @__PURE__ */ __exportAll({
12818
12632
  SpringImpulseJoint: () => SpringImpulseJoint,
12819
12633
  TempContactForceEvent: () => TempContactForceEvent,
12820
12634
  TempContactManifold: () => TempContactManifold,
12821
- TransformBatch: () => TransformBatch,
12822
12635
  TriMesh: () => TriMesh,
12823
12636
  TriMeshFlags: () => TriMeshFlags,
12824
12637
  Triangle: () => Triangle,
@@ -12828,7 +12641,6 @@ var exports_exports = /* @__PURE__ */ __exportAll({
12828
12641
  VectorOps: () => VectorOps,
12829
12642
  Voxels: () => Voxels,
12830
12643
  World: () => World,
12831
- createTransformBatch: () => createTransformBatch,
12832
12644
  reserveMemory: () => reserveMemory,
12833
12645
  version: () => version
12834
12646
  });
@@ -12855,5 +12667,5 @@ async function init(input) {
12855
12667
  var rapier_simd_default = exports_exports;
12856
12668
 
12857
12669
  //#endregion
12858
- export { ActiveCollisionTypes, ActiveEvents, ActiveHooks, Ball, BroadPhase, CCDSolver, Capsule, CharacterCollision, CoefficientCombineRule, Collider, ColliderDesc, ColliderSet, ColliderShapeCastHit, Cone, ConvexPolyhedron, Cuboid, Cylinder, DebugRenderBuffers, DebugRenderPipeline, DynamicRayCastVehicleController, EventQueue, FeatureType, FixedImpulseJoint, FixedMultibodyJoint, GenericImpulseJoint, HalfSpace, HeightFieldFlags, Heightfield, ImpulseJoint, ImpulseJointSet, IntegrationParameters, IslandManager, JointAxesMask, JointData, JointType, KinematicCharacterController, MassPropsMode, MotorModel, MultibodyJoint, MultibodyJointSet, NarrowPhase, PhysicsPipeline, PidAxesMask, PidController, PointColliderProjection, PointProjection, Polyline, PrismaticImpulseJoint, PrismaticMultibodyJoint, Quaternion, QueryFilterFlags, Ray, RayColliderHit, RayColliderIntersection, RayIntersection, RevoluteImpulseJoint, RevoluteMultibodyJoint, RigidBody, RigidBodyDesc, RigidBodySet, RigidBodyType, RopeImpulseJoint, RotationOps, RoundCone, RoundConvexPolyhedron, RoundCuboid, RoundCylinder, RoundTriangle, SdpMatrix3, SdpMatrix3Ops, Segment, SerializationPipeline, Shape, ShapeCastHit, ShapeContact, ShapeType, SolverFlags, SphericalImpulseJoint, SphericalMultibodyJoint, SpringImpulseJoint, TempContactForceEvent, TempContactManifold, TransformBatch, TriMesh, TriMeshFlags, Triangle, UnitImpulseJoint, UnitMultibodyJoint, Vector3, VectorOps, Voxels, World, createTransformBatch, rapier_simd_default as default, init, reserveMemory, version };
12670
+ export { ActiveCollisionTypes, ActiveEvents, ActiveHooks, Ball, BroadPhase, CCDSolver, Capsule, CharacterCollision, CoefficientCombineRule, Collider, ColliderDesc, ColliderSet, ColliderShapeCastHit, Cone, ConvexPolyhedron, Cuboid, Cylinder, DebugRenderBuffers, DebugRenderPipeline, DynamicRayCastVehicleController, EventQueue, FeatureType, FixedImpulseJoint, FixedMultibodyJoint, GenericImpulseJoint, HalfSpace, HeightFieldFlags, Heightfield, ImpulseJoint, ImpulseJointSet, IntegrationParameters, IslandManager, JointAxesMask, JointData, JointType, KinematicCharacterController, MassPropsMode, MotorModel, MultibodyJoint, MultibodyJointSet, NarrowPhase, PhysicsPipeline, PidAxesMask, PidController, PointColliderProjection, PointProjection, Polyline, PrismaticImpulseJoint, PrismaticMultibodyJoint, Quaternion, QueryFilterFlags, Ray, RayColliderHit, RayColliderIntersection, RayIntersection, RevoluteImpulseJoint, RevoluteMultibodyJoint, RigidBody, RigidBodyDesc, RigidBodySet, RigidBodyType, RopeImpulseJoint, RotationOps, RoundCone, RoundConvexPolyhedron, RoundCuboid, RoundCylinder, RoundTriangle, SdpMatrix3, SdpMatrix3Ops, Segment, SerializationPipeline, Shape, ShapeCastHit, ShapeContact, ShapeType, SolverFlags, SphericalImpulseJoint, SphericalMultibodyJoint, SpringImpulseJoint, TempContactForceEvent, TempContactManifold, TriMesh, TriMeshFlags, Triangle, UnitImpulseJoint, UnitMultibodyJoint, Vector3, VectorOps, Voxels, World, rapier_simd_default as default, init, reserveMemory, version };
12859
12671
  //# sourceMappingURL=simd.mjs.map