blob: 62ef33187ce6a4236e580213d1349f2e2912accc [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001// automatically generated by the FlatBuffers compiler, do not modify
2
3package MyGame.Example;
4
5import java.nio.*;
6import java.lang.*;
7import java.util.*;
8import com.google.flatbuffers.*;
9
10@SuppressWarnings("unused")
11public final class Vec3 extends Struct {
12 public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
13 public Vec3 __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
14
15 public float x() { return bb.getFloat(bb_pos + 0); }
16 public void mutateX(float x) { bb.putFloat(bb_pos + 0, x); }
17 public float y() { return bb.getFloat(bb_pos + 4); }
18 public void mutateY(float y) { bb.putFloat(bb_pos + 4, y); }
19 public float z() { return bb.getFloat(bb_pos + 8); }
20 public void mutateZ(float z) { bb.putFloat(bb_pos + 8, z); }
21 public double test1() { return bb.getDouble(bb_pos + 16); }
22 public void mutateTest1(double test1) { bb.putDouble(bb_pos + 16, test1); }
23 public int test2() { return bb.get(bb_pos + 24) & 0xFF; }
James Kuszmaul8e62b022022-03-22 09:33:25 -070024 public void mutateTest2(int test2) { bb.put(bb_pos + 24, (byte) test2); }
Austin Schuhe89fa2d2019-08-14 20:24:23 -070025 public MyGame.Example.Test test3() { return test3(new MyGame.Example.Test()); }
26 public MyGame.Example.Test test3(MyGame.Example.Test obj) { return obj.__assign(bb_pos + 26, bb); }
27
28 public static int createVec3(FlatBufferBuilder builder, float x, float y, float z, double test1, int test2, short test3_a, byte test3_b) {
29 builder.prep(8, 32);
30 builder.pad(2);
31 builder.prep(2, 4);
32 builder.pad(1);
33 builder.putByte(test3_b);
34 builder.putShort(test3_a);
35 builder.pad(1);
James Kuszmaul8e62b022022-03-22 09:33:25 -070036 builder.putByte((byte) test2);
Austin Schuhe89fa2d2019-08-14 20:24:23 -070037 builder.putDouble(test1);
38 builder.pad(4);
39 builder.putFloat(z);
40 builder.putFloat(y);
41 builder.putFloat(x);
42 return builder.offset();
43 }
Austin Schuh272c6132020-11-14 16:37:52 -080044
45 public static final class Vector extends BaseVector {
46 public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }
47
48 public Vec3 get(int j) { return get(new Vec3(), j); }
49 public Vec3 get(Vec3 obj, int j) { return obj.__assign(__element(j), bb); }
50 }
James Kuszmaul8e62b022022-03-22 09:33:25 -070051 public Vec3T unpack() {
52 Vec3T _o = new Vec3T();
53 unpackTo(_o);
54 return _o;
55 }
56 public void unpackTo(Vec3T _o) {
57 float _oX = x();
58 _o.setX(_oX);
59 float _oY = y();
60 _o.setY(_oY);
61 float _oZ = z();
62 _o.setZ(_oZ);
63 double _oTest1 = test1();
64 _o.setTest1(_oTest1);
65 int _oTest2 = test2();
66 _o.setTest2(_oTest2);
67 test3().unpackTo(_o.getTest3());
68 }
69 public static int pack(FlatBufferBuilder builder, Vec3T _o) {
70 if (_o == null) return 0;
71 short _test3_a = _o.getTest3().getA();
72 byte _test3_b = _o.getTest3().getB();
73 return createVec3(
74 builder,
75 _o.getX(),
76 _o.getY(),
77 _o.getZ(),
78 _o.getTest1(),
79 _o.getTest2(),
80 _test3_a,
81 _test3_b);
82 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -070083}
84