1 // automatically generated by the FlatBuffers compiler, do not modify 2 3 package MyGame.Example 4 5 import java.nio.* 6 import kotlin.math.sign 7 import com.google.flatbuffers.* 8 9 @Suppress("unused") 10 @ExperimentalUnsignedTypes 11 class Vec3 : Struct() { 12 __initnull13 fun __init(_i: Int, _bb: ByteBuffer) { 14 __reset(_i, _bb) 15 } __assignnull16 fun __assign(_i: Int, _bb: ByteBuffer) : Vec3 { 17 __init(_i, _bb) 18 return this 19 } 20 val x : Float get() = bb.getFloat(bb_pos + 0) mutateXnull21 fun mutateX(x: Float) : ByteBuffer = bb.putFloat(bb_pos + 0, x) 22 val y : Float get() = bb.getFloat(bb_pos + 4) 23 fun mutateY(y: Float) : ByteBuffer = bb.putFloat(bb_pos + 4, y) 24 val z : Float get() = bb.getFloat(bb_pos + 8) 25 fun mutateZ(z: Float) : ByteBuffer = bb.putFloat(bb_pos + 8, z) 26 val test1 : Double get() = bb.getDouble(bb_pos + 16) 27 fun mutateTest1(test1: Double) : ByteBuffer = bb.putDouble(bb_pos + 16, test1) 28 val test2 : UByte get() = bb.get(bb_pos + 24).toUByte() 29 fun mutateTest2(test2: UByte) : ByteBuffer = bb.put(bb_pos + 24, test2.toByte()) 30 val test3 : MyGame.Example.Test? get() = test3(MyGame.Example.Test()) 31 fun test3(obj: MyGame.Example.Test) : MyGame.Example.Test? = obj.__assign(bb_pos + 26, bb) 32 companion object { 33 fun createVec3(builder: FlatBufferBuilder, x: Float, y: Float, z: Float, test1: Double, test2: UByte, test3_a: Short, test3_b: Byte) : Int { 34 builder.prep(8, 32) 35 builder.pad(2) 36 builder.prep(2, 4) 37 builder.pad(1) 38 builder.putByte(test3_b) 39 builder.putShort(test3_a) 40 builder.pad(1) 41 builder.putByte(test2.toByte()) 42 builder.putDouble(test1) 43 builder.pad(4) 44 builder.putFloat(z) 45 builder.putFloat(y) 46 builder.putFloat(x) 47 return builder.offset() 48 } 49 } 50 } 51