• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1-- automatically generated by the FlatBuffers compiler, do not modify
2
3-- namespace: Sample
4
5local flatbuffers = require('flatbuffers')
6
7local Vec3 = {} -- the module
8local Vec3_mt = {} -- the class metatable
9
10function Vec3.New()
11    local o = {}
12    setmetatable(o, {__index = Vec3_mt})
13    return o
14end
15function Vec3_mt:Init(buf, pos)
16    self.view = flatbuffers.view.New(buf, pos)
17end
18function Vec3_mt:X()
19    return self.view:Get(flatbuffers.N.Float32, self.view.pos + 0)
20end
21function Vec3_mt:Y()
22    return self.view:Get(flatbuffers.N.Float32, self.view.pos + 4)
23end
24function Vec3_mt:Z()
25    return self.view:Get(flatbuffers.N.Float32, self.view.pos + 8)
26end
27function Vec3.CreateVec3(builder, x, y, z)
28    builder:Prep(4, 12)
29    builder:PrependFloat32(z)
30    builder:PrependFloat32(y)
31    builder:PrependFloat32(x)
32    return builder:Offset()
33end
34
35return Vec3 -- return the module