File: Vec3.nim

package info (click to toggle)
golang-github-google-flatbuffers 24.3.25-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 17,356 kB
  • sloc: cpp: 49,726; python: 6,901; cs: 5,566; java: 4,370; ansic: 2,512; php: 1,460; javascript: 1,053; xml: 1,016; sh: 870; makefile: 13
file content (52 lines) | stat: -rw-r--r-- 1,874 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#[ MyGame.Example.Vec3
  Automatically generated by the FlatBuffers compiler, do not modify.
  Or modify. I'm a message, not a cop.

  flatc version: 24.3.25

  Declared by  : 
  Rooting type : MyGame.Example.Monster ()
]#

import Color as MyGame_Example_Color
import Test as MyGame_Example_Test
import flatbuffers

type Vec3* = object of FlatObj
func x*(self: Vec3): float32 =
  return Get[float32](self.tab, self.tab.Pos + 0)
func `x=`*(self: var Vec3, n: float32): bool =
  return self.tab.Mutate(self.tab.Pos + 0, n)
func y*(self: Vec3): float32 =
  return Get[float32](self.tab, self.tab.Pos + 4)
func `y=`*(self: var Vec3, n: float32): bool =
  return self.tab.Mutate(self.tab.Pos + 4, n)
func z*(self: Vec3): float32 =
  return Get[float32](self.tab, self.tab.Pos + 8)
func `z=`*(self: var Vec3, n: float32): bool =
  return self.tab.Mutate(self.tab.Pos + 8, n)
func test1*(self: Vec3): float64 =
  return Get[float64](self.tab, self.tab.Pos + 16)
func `test1=`*(self: var Vec3, n: float64): bool =
  return self.tab.Mutate(self.tab.Pos + 16, n)
func test2*(self: Vec3): MyGame_Example_Color.Color =
  return MyGame_Example_Color.Color(Get[uint8](self.tab, self.tab.Pos + 24))
func `test2=`*(self: var Vec3, n: MyGame_Example_Color.Color): bool =
  return self.tab.Mutate(self.tab.Pos + 24, n)
func test3*(self: Vec3): MyGame_Example_Test.Test =
  return MyGame_Example_Test.Test(tab: Vtable(Bytes: self.tab.Bytes, Pos: self.tab.Pos + 26))
proc Vec3Create*(self: var Builder, x: float32, y: float32, z: float32, test1: float64, test2: MyGame_Example_Color.Color, test3_a: int16, test3_b: int8): uoffset =
  self.Prep(8, 32)
  self.Pad(2)
  self.Prep(2, 4)
  self.Pad(1)
  self.Prepend(test3_b)
  self.Prepend(test3_a)
  self.Pad(1)
  self.Prepend(test2)
  self.Prepend(test1)
  self.Pad(4)
  self.Prepend(z)
  self.Prepend(y)
  self.Prepend(x)
  return self.Offset()