| 114 | } |
| 115 | |
| 116 | static s32 compile_transform(Buffer &output, UnitCompiler &compiler, FlatJsonObject &obj, CompileOptions &opts) |
| 117 | { |
| 118 | CE_UNUSED_2(compiler, opts); |
| 119 | |
| 120 | TransformDesc td; |
| 121 | td.position = RETURN_IF_ERROR(sjson::parse_vector3 (flat_json_object::get(obj, "data.position"))); |
| 122 | td.rotation = RETURN_IF_ERROR(sjson::parse_quaternion(flat_json_object::get(obj, "data.rotation"))); |
| 123 | td.scale = RETURN_IF_ERROR(sjson::parse_vector3 (flat_json_object::get(obj, "data.scale"))); |
| 124 | if (flat_json_object::has(obj, "data.name")) { |
| 125 | td.name = RETURN_IF_ERROR(sjson::parse_string_id(flat_json_object::get(obj, "data.name"))); |
| 126 | } |
| 127 | |
| 128 | FileBuffer fb(output); |
| 129 | BinaryWriter bw(fb); |
| 130 | bw.write(td.position); |
| 131 | bw.write(td.rotation); |
| 132 | bw.write(td.scale); |
| 133 | bw.write(td.name); |
| 134 | return 0; |
| 135 | } |
| 136 | |
| 137 | static s32 compile_camera(Buffer &output, UnitCompiler &compiler, FlatJsonObject &obj, CompileOptions &opts) |
| 138 | { |
nothing calls this directly
no test coverage detected