| 531 | } |
| 532 | |
| 533 | s32 compile_spring_joint(Buffer &output, UnitCompiler &compiler, FlatJsonObject &obj, CompileOptions &opts) |
| 534 | { |
| 535 | SpringJoint spring = {}; |
| 536 | JointDesc jd; |
| 537 | s32 err = joint_common_parse(jd, JointType::SPRING, compiler, obj, opts); |
| 538 | ENSURE_OR_RETURN(PHYSICS_RESOURCE, err == 0, opts); |
| 539 | |
| 540 | spring.stiffness = RETURN_IF_ERROR(sjson::parse_float(flat_json_object::get(obj, "data.stiffness"))); |
| 541 | spring.damping = RETURN_IF_ERROR(sjson::parse_float(flat_json_object::get(obj, "data.damping"))); |
| 542 | |
| 543 | FileBuffer fb(output); |
| 544 | err = joint_common_write(fb, jd); |
| 545 | ENSURE_OR_RETURN(PHYSICS_RESOURCE, err == 0, opts); |
| 546 | |
| 547 | BinaryWriter bw(fb); |
| 548 | bw.write(spring.stiffness); |
| 549 | bw.write(spring.damping); |
| 550 | return 0; |
| 551 | } |
| 552 | |
| 553 | s32 compile_d6_joint(Buffer &output, UnitCompiler &compiler, FlatJsonObject &obj, CompileOptions &opts) |
| 554 | { |
nothing calls this directly
no test coverage detected