box3d-rust 0.1.0

Pure Rust port of the Box3D 3D physics engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
//! Framed joint op writers for `Recording`, split from ops.rs to satisfy
//! the file-length limit. Layouts mirror recording_ops.inl.
//!
//! SPDX-FileCopyrightText: 2026 Erin Catto
//! SPDX-License-Identifier: MIT

use crate::id::JointId;
use crate::math_functions::{Quat, Vec3};

use crate::recording::ops::RecOp;
use crate::recording::session::Recording;

impl Recording {
    /// Write framed `ParallelJointSetSpringHertz` op.
    pub fn write_parallel_joint_set_spring_hertz(&mut self, joint: JointId, hertz: f32) {
        self.begin_record(RecOp::ParallelJointSetSpringHertz as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(hertz);
        self.end_record();
    }

    /// Write framed `ParallelJointSetSpringDampingRatio` op.
    pub fn write_parallel_joint_set_spring_damping_ratio(
        &mut self,
        joint: JointId,
        damping_ratio: f32,
    ) {
        self.begin_record(RecOp::ParallelJointSetSpringDampingRatio as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(damping_ratio);
        self.end_record();
    }

    /// Write framed `ParallelJointSetMaxTorque` op.
    pub fn write_parallel_joint_set_max_torque(&mut self, joint: JointId, max_torque: f32) {
        self.begin_record(RecOp::ParallelJointSetMaxTorque as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(max_torque);
        self.end_record();
    }

    /// Write framed `DistanceJointSetLength` op.
    pub fn write_distance_joint_set_length(&mut self, joint: JointId, length: f32) {
        self.begin_record(RecOp::DistanceJointSetLength as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(length);
        self.end_record();
    }

    /// Write framed `DistanceJointEnableSpring` op.
    pub fn write_distance_joint_enable_spring(&mut self, joint: JointId, enable_spring: bool) {
        self.begin_record(RecOp::DistanceJointEnableSpring as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_spring);
        self.end_record();
    }

    /// Write framed `DistanceJointSetSpringForceRange` op.
    pub fn write_distance_joint_set_spring_force_range(
        &mut self,
        joint: JointId,
        lower_force: f32,
        upper_force: f32,
    ) {
        self.begin_record(RecOp::DistanceJointSetSpringForceRange as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(lower_force);
        self.buffer.append_f32(upper_force);
        self.end_record();
    }

    /// Write framed `DistanceJointSetSpringHertz` op.
    pub fn write_distance_joint_set_spring_hertz(&mut self, joint: JointId, hertz: f32) {
        self.begin_record(RecOp::DistanceJointSetSpringHertz as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(hertz);
        self.end_record();
    }

    /// Write framed `DistanceJointSetSpringDampingRatio` op.
    pub fn write_distance_joint_set_spring_damping_ratio(
        &mut self,
        joint: JointId,
        damping_ratio: f32,
    ) {
        self.begin_record(RecOp::DistanceJointSetSpringDampingRatio as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(damping_ratio);
        self.end_record();
    }

    /// Write framed `DistanceJointEnableLimit` op.
    pub fn write_distance_joint_enable_limit(&mut self, joint: JointId, enable_limit: bool) {
        self.begin_record(RecOp::DistanceJointEnableLimit as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_limit);
        self.end_record();
    }

    /// Write framed `DistanceJointSetLengthRange` op.
    pub fn write_distance_joint_set_length_range(
        &mut self,
        joint: JointId,
        min_length: f32,
        max_length: f32,
    ) {
        self.begin_record(RecOp::DistanceJointSetLengthRange as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(min_length);
        self.buffer.append_f32(max_length);
        self.end_record();
    }

    /// Write framed `DistanceJointEnableMotor` op.
    pub fn write_distance_joint_enable_motor(&mut self, joint: JointId, enable_motor: bool) {
        self.begin_record(RecOp::DistanceJointEnableMotor as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_motor);
        self.end_record();
    }

    /// Write framed `DistanceJointSetMotorSpeed` op.
    pub fn write_distance_joint_set_motor_speed(&mut self, joint: JointId, motor_speed: f32) {
        self.begin_record(RecOp::DistanceJointSetMotorSpeed as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(motor_speed);
        self.end_record();
    }

    /// Write framed `DistanceJointSetMaxMotorForce` op.
    pub fn write_distance_joint_set_max_motor_force(&mut self, joint: JointId, force: f32) {
        self.begin_record(RecOp::DistanceJointSetMaxMotorForce as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(force);
        self.end_record();
    }

    /// Write framed `MotorJointSetLinearVelocity` op.
    pub fn write_motor_joint_set_linear_velocity(&mut self, joint: JointId, velocity: Vec3) {
        self.begin_record(RecOp::MotorJointSetLinearVelocity as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_vec3(velocity);
        self.end_record();
    }

    /// Write framed `MotorJointSetAngularVelocity` op.
    pub fn write_motor_joint_set_angular_velocity(&mut self, joint: JointId, velocity: Vec3) {
        self.begin_record(RecOp::MotorJointSetAngularVelocity as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_vec3(velocity);
        self.end_record();
    }

    /// Write framed `MotorJointSetMaxVelocityForce` op.
    pub fn write_motor_joint_set_max_velocity_force(&mut self, joint: JointId, max_force: f32) {
        self.begin_record(RecOp::MotorJointSetMaxVelocityForce as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(max_force);
        self.end_record();
    }

    /// Write framed `MotorJointSetMaxVelocityTorque` op.
    pub fn write_motor_joint_set_max_velocity_torque(&mut self, joint: JointId, max_torque: f32) {
        self.begin_record(RecOp::MotorJointSetMaxVelocityTorque as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(max_torque);
        self.end_record();
    }

    /// Write framed `MotorJointSetLinearHertz` op.
    pub fn write_motor_joint_set_linear_hertz(&mut self, joint: JointId, hertz: f32) {
        self.begin_record(RecOp::MotorJointSetLinearHertz as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(hertz);
        self.end_record();
    }

    /// Write framed `MotorJointSetLinearDampingRatio` op.
    pub fn write_motor_joint_set_linear_damping_ratio(&mut self, joint: JointId, damping: f32) {
        self.begin_record(RecOp::MotorJointSetLinearDampingRatio as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(damping);
        self.end_record();
    }

    /// Write framed `MotorJointSetAngularHertz` op.
    pub fn write_motor_joint_set_angular_hertz(&mut self, joint: JointId, hertz: f32) {
        self.begin_record(RecOp::MotorJointSetAngularHertz as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(hertz);
        self.end_record();
    }

    /// Write framed `MotorJointSetAngularDampingRatio` op.
    pub fn write_motor_joint_set_angular_damping_ratio(&mut self, joint: JointId, damping: f32) {
        self.begin_record(RecOp::MotorJointSetAngularDampingRatio as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(damping);
        self.end_record();
    }

    /// Write framed `MotorJointSetMaxSpringForce` op.
    pub fn write_motor_joint_set_max_spring_force(&mut self, joint: JointId, max_force: f32) {
        self.begin_record(RecOp::MotorJointSetMaxSpringForce as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(max_force);
        self.end_record();
    }

    /// Write framed `MotorJointSetMaxSpringTorque` op.
    pub fn write_motor_joint_set_max_spring_torque(&mut self, joint: JointId, max_torque: f32) {
        self.begin_record(RecOp::MotorJointSetMaxSpringTorque as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(max_torque);
        self.end_record();
    }

    /// Write framed `PrismaticJointEnableSpring` op.
    pub fn write_prismatic_joint_enable_spring(&mut self, joint: JointId, enable_spring: bool) {
        self.begin_record(RecOp::PrismaticJointEnableSpring as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_spring);
        self.end_record();
    }

    /// Write framed `PrismaticJointSetSpringHertz` op.
    pub fn write_prismatic_joint_set_spring_hertz(&mut self, joint: JointId, hertz: f32) {
        self.begin_record(RecOp::PrismaticJointSetSpringHertz as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(hertz);
        self.end_record();
    }

    /// Write framed `PrismaticJointSetSpringDampingRatio` op.
    pub fn write_prismatic_joint_set_spring_damping_ratio(
        &mut self,
        joint: JointId,
        damping_ratio: f32,
    ) {
        self.begin_record(RecOp::PrismaticJointSetSpringDampingRatio as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(damping_ratio);
        self.end_record();
    }

    /// Write framed `PrismaticJointSetTargetTranslation` op.
    pub fn write_prismatic_joint_set_target_translation(
        &mut self,
        joint: JointId,
        translation: f32,
    ) {
        self.begin_record(RecOp::PrismaticJointSetTargetTranslation as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(translation);
        self.end_record();
    }

    /// Write framed `PrismaticJointEnableLimit` op.
    pub fn write_prismatic_joint_enable_limit(&mut self, joint: JointId, enable_limit: bool) {
        self.begin_record(RecOp::PrismaticJointEnableLimit as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_limit);
        self.end_record();
    }

    /// Write framed `PrismaticJointSetLimits` op.
    pub fn write_prismatic_joint_set_limits(&mut self, joint: JointId, lower: f32, upper: f32) {
        self.begin_record(RecOp::PrismaticJointSetLimits as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(lower);
        self.buffer.append_f32(upper);
        self.end_record();
    }

    /// Write framed `PrismaticJointEnableMotor` op.
    pub fn write_prismatic_joint_enable_motor(&mut self, joint: JointId, enable_motor: bool) {
        self.begin_record(RecOp::PrismaticJointEnableMotor as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_motor);
        self.end_record();
    }

    /// Write framed `PrismaticJointSetMotorSpeed` op.
    pub fn write_prismatic_joint_set_motor_speed(&mut self, joint: JointId, motor_speed: f32) {
        self.begin_record(RecOp::PrismaticJointSetMotorSpeed as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(motor_speed);
        self.end_record();
    }

    /// Write framed `PrismaticJointSetMaxMotorForce` op.
    pub fn write_prismatic_joint_set_max_motor_force(&mut self, joint: JointId, force: f32) {
        self.begin_record(RecOp::PrismaticJointSetMaxMotorForce as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(force);
        self.end_record();
    }

    /// Write framed `RevoluteJointEnableSpring` op.
    pub fn write_revolute_joint_enable_spring(&mut self, joint: JointId, enable_spring: bool) {
        self.begin_record(RecOp::RevoluteJointEnableSpring as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_spring);
        self.end_record();
    }

    /// Write framed `RevoluteJointSetSpringHertz` op.
    pub fn write_revolute_joint_set_spring_hertz(&mut self, joint: JointId, hertz: f32) {
        self.begin_record(RecOp::RevoluteJointSetSpringHertz as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(hertz);
        self.end_record();
    }

    /// Write framed `RevoluteJointSetSpringDampingRatio` op.
    pub fn write_revolute_joint_set_spring_damping_ratio(
        &mut self,
        joint: JointId,
        damping_ratio: f32,
    ) {
        self.begin_record(RecOp::RevoluteJointSetSpringDampingRatio as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(damping_ratio);
        self.end_record();
    }

    /// Write framed `RevoluteJointSetTargetAngle` op.
    pub fn write_revolute_joint_set_target_angle(&mut self, joint: JointId, angle: f32) {
        self.begin_record(RecOp::RevoluteJointSetTargetAngle as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(angle);
        self.end_record();
    }

    /// Write framed `RevoluteJointEnableLimit` op.
    pub fn write_revolute_joint_enable_limit(&mut self, joint: JointId, enable_limit: bool) {
        self.begin_record(RecOp::RevoluteJointEnableLimit as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_limit);
        self.end_record();
    }

    /// Write framed `RevoluteJointSetLimits` op.
    pub fn write_revolute_joint_set_limits(&mut self, joint: JointId, lower: f32, upper: f32) {
        self.begin_record(RecOp::RevoluteJointSetLimits as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(lower);
        self.buffer.append_f32(upper);
        self.end_record();
    }

    /// Write framed `RevoluteJointEnableMotor` op.
    pub fn write_revolute_joint_enable_motor(&mut self, joint: JointId, enable_motor: bool) {
        self.begin_record(RecOp::RevoluteJointEnableMotor as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_motor);
        self.end_record();
    }

    /// Write framed `RevoluteJointSetMotorSpeed` op.
    pub fn write_revolute_joint_set_motor_speed(&mut self, joint: JointId, motor_speed: f32) {
        self.begin_record(RecOp::RevoluteJointSetMotorSpeed as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(motor_speed);
        self.end_record();
    }

    /// Write framed `RevoluteJointSetMaxMotorTorque` op.
    pub fn write_revolute_joint_set_max_motor_torque(&mut self, joint: JointId, torque: f32) {
        self.begin_record(RecOp::RevoluteJointSetMaxMotorTorque as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(torque);
        self.end_record();
    }

    /// Write framed `SphericalJointEnableConeLimit` op.
    pub fn write_spherical_joint_enable_cone_limit(&mut self, joint: JointId, enable_limit: bool) {
        self.begin_record(RecOp::SphericalJointEnableConeLimit as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_limit);
        self.end_record();
    }

    /// Write framed `SphericalJointSetConeLimit` op.
    pub fn write_spherical_joint_set_cone_limit(&mut self, joint: JointId, angle_radians: f32) {
        self.begin_record(RecOp::SphericalJointSetConeLimit as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(angle_radians);
        self.end_record();
    }

    /// Write framed `SphericalJointEnableTwistLimit` op.
    pub fn write_spherical_joint_enable_twist_limit(&mut self, joint: JointId, enable_limit: bool) {
        self.begin_record(RecOp::SphericalJointEnableTwistLimit as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_limit);
        self.end_record();
    }

    /// Write framed `SphericalJointSetTwistLimits` op.
    pub fn write_spherical_joint_set_twist_limits(
        &mut self,
        joint: JointId,
        lower: f32,
        upper: f32,
    ) {
        self.begin_record(RecOp::SphericalJointSetTwistLimits as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(lower);
        self.buffer.append_f32(upper);
        self.end_record();
    }

    /// Write framed `SphericalJointEnableSpring` op.
    pub fn write_spherical_joint_enable_spring(&mut self, joint: JointId, enable_spring: bool) {
        self.begin_record(RecOp::SphericalJointEnableSpring as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_spring);
        self.end_record();
    }

    /// Write framed `SphericalJointSetSpringHertz` op.
    pub fn write_spherical_joint_set_spring_hertz(&mut self, joint: JointId, hertz: f32) {
        self.begin_record(RecOp::SphericalJointSetSpringHertz as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(hertz);
        self.end_record();
    }

    /// Write framed `SphericalJointSetSpringDampingRatio` op.
    pub fn write_spherical_joint_set_spring_damping_ratio(
        &mut self,
        joint: JointId,
        damping_ratio: f32,
    ) {
        self.begin_record(RecOp::SphericalJointSetSpringDampingRatio as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(damping_ratio);
        self.end_record();
    }

    /// Write framed `SphericalJointSetTargetRotation` op.
    pub fn write_spherical_joint_set_target_rotation(
        &mut self,
        joint: JointId,
        target_rotation: Quat,
    ) {
        self.begin_record(RecOp::SphericalJointSetTargetRotation as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_quat(target_rotation);
        self.end_record();
    }

    /// Write framed `SphericalJointEnableMotor` op.
    pub fn write_spherical_joint_enable_motor(&mut self, joint: JointId, enable_motor: bool) {
        self.begin_record(RecOp::SphericalJointEnableMotor as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(enable_motor);
        self.end_record();
    }

    /// Write framed `SphericalJointSetMotorVelocity` op.
    pub fn write_spherical_joint_set_motor_velocity(
        &mut self,
        joint: JointId,
        motor_velocity: Vec3,
    ) {
        self.begin_record(RecOp::SphericalJointSetMotorVelocity as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_vec3(motor_velocity);
        self.end_record();
    }

    /// Write framed `SphericalJointSetMaxMotorTorque` op.
    pub fn write_spherical_joint_set_max_motor_torque(&mut self, joint: JointId, torque: f32) {
        self.begin_record(RecOp::SphericalJointSetMaxMotorTorque as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(torque);
        self.end_record();
    }

    /// Write framed `WeldJointSetLinearHertz` op.
    pub fn write_weld_joint_set_linear_hertz(&mut self, joint: JointId, hertz: f32) {
        self.begin_record(RecOp::WeldJointSetLinearHertz as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(hertz);
        self.end_record();
    }

    /// Write framed `WeldJointSetLinearDampingRatio` op.
    pub fn write_weld_joint_set_linear_damping_ratio(
        &mut self,
        joint: JointId,
        damping_ratio: f32,
    ) {
        self.begin_record(RecOp::WeldJointSetLinearDampingRatio as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(damping_ratio);
        self.end_record();
    }

    /// Write framed `WeldJointSetAngularHertz` op.
    pub fn write_weld_joint_set_angular_hertz(&mut self, joint: JointId, hertz: f32) {
        self.begin_record(RecOp::WeldJointSetAngularHertz as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(hertz);
        self.end_record();
    }

    /// Write framed `WeldJointSetAngularDampingRatio` op.
    pub fn write_weld_joint_set_angular_damping_ratio(
        &mut self,
        joint: JointId,
        damping_ratio: f32,
    ) {
        self.begin_record(RecOp::WeldJointSetAngularDampingRatio as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(damping_ratio);
        self.end_record();
    }

    /// Write framed `WheelJointEnableSuspension` op.
    pub fn write_wheel_joint_enable_suspension(&mut self, joint: JointId, flag: bool) {
        self.begin_record(RecOp::WheelJointEnableSuspension as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(flag);
        self.end_record();
    }

    /// Write framed `WheelJointSetSuspensionHertz` op.
    pub fn write_wheel_joint_set_suspension_hertz(&mut self, joint: JointId, hertz: f32) {
        self.begin_record(RecOp::WheelJointSetSuspensionHertz as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(hertz);
        self.end_record();
    }

    /// Write framed `WheelJointSetSuspensionDampingRatio` op.
    pub fn write_wheel_joint_set_suspension_damping_ratio(
        &mut self,
        joint: JointId,
        damping_ratio: f32,
    ) {
        self.begin_record(RecOp::WheelJointSetSuspensionDampingRatio as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(damping_ratio);
        self.end_record();
    }

    /// Write framed `WheelJointEnableSuspensionLimit` op.
    pub fn write_wheel_joint_enable_suspension_limit(&mut self, joint: JointId, flag: bool) {
        self.begin_record(RecOp::WheelJointEnableSuspensionLimit as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(flag);
        self.end_record();
    }

    /// Write framed `WheelJointSetSuspensionLimits` op.
    pub fn write_wheel_joint_set_suspension_limits(
        &mut self,
        joint: JointId,
        lower: f32,
        upper: f32,
    ) {
        self.begin_record(RecOp::WheelJointSetSuspensionLimits as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(lower);
        self.buffer.append_f32(upper);
        self.end_record();
    }

    /// Write framed `WheelJointEnableSpinMotor` op.
    pub fn write_wheel_joint_enable_spin_motor(&mut self, joint: JointId, flag: bool) {
        self.begin_record(RecOp::WheelJointEnableSpinMotor as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(flag);
        self.end_record();
    }

    /// Write framed `WheelJointSetSpinMotorSpeed` op.
    pub fn write_wheel_joint_set_spin_motor_speed(&mut self, joint: JointId, speed: f32) {
        self.begin_record(RecOp::WheelJointSetSpinMotorSpeed as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(speed);
        self.end_record();
    }

    /// Write framed `WheelJointSetMaxSpinTorque` op.
    pub fn write_wheel_joint_set_max_spin_torque(&mut self, joint: JointId, torque: f32) {
        self.begin_record(RecOp::WheelJointSetMaxSpinTorque as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(torque);
        self.end_record();
    }

    /// Write framed `WheelJointEnableSteering` op.
    pub fn write_wheel_joint_enable_steering(&mut self, joint: JointId, flag: bool) {
        self.begin_record(RecOp::WheelJointEnableSteering as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(flag);
        self.end_record();
    }

    /// Write framed `WheelJointSetSteeringHertz` op.
    pub fn write_wheel_joint_set_steering_hertz(&mut self, joint: JointId, hertz: f32) {
        self.begin_record(RecOp::WheelJointSetSteeringHertz as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(hertz);
        self.end_record();
    }

    /// Write framed `WheelJointSetSteeringDampingRatio` op.
    pub fn write_wheel_joint_set_steering_damping_ratio(
        &mut self,
        joint: JointId,
        damping_ratio: f32,
    ) {
        self.begin_record(RecOp::WheelJointSetSteeringDampingRatio as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(damping_ratio);
        self.end_record();
    }

    /// Write framed `WheelJointSetMaxSteeringTorque` op.
    pub fn write_wheel_joint_set_max_steering_torque(&mut self, joint: JointId, torque: f32) {
        self.begin_record(RecOp::WheelJointSetMaxSteeringTorque as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(torque);
        self.end_record();
    }

    /// Write framed `WheelJointEnableSteeringLimit` op.
    pub fn write_wheel_joint_enable_steering_limit(&mut self, joint: JointId, flag: bool) {
        self.begin_record(RecOp::WheelJointEnableSteeringLimit as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_bool(flag);
        self.end_record();
    }

    /// Write framed `WheelJointSetSteeringLimits` op.
    pub fn write_wheel_joint_set_steering_limits(
        &mut self,
        joint: JointId,
        lower: f32,
        upper: f32,
    ) {
        self.begin_record(RecOp::WheelJointSetSteeringLimits as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(lower);
        self.buffer.append_f32(upper);
        self.end_record();
    }

    /// Write framed `WheelJointSetTargetSteeringAngle` op.
    pub fn write_wheel_joint_set_target_steering_angle(&mut self, joint: JointId, radians: f32) {
        self.begin_record(RecOp::WheelJointSetTargetSteeringAngle as u8);
        self.buffer.append_joint_id(joint);
        self.buffer.append_f32(radians);
        self.end_record();
    }
}