# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flat

import flatbuffers

class Physics(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsPhysics(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = Physics()
        x.Init(buf, n + offset)
        return x

    # Physics
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # Physics
    def Location(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = o + self._tab.Pos
            from .Vector3 import Vector3
            obj = Vector3()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Physics
    def Rotation(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = o + self._tab.Pos
            from .Rotator import Rotator
            obj = Rotator()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Physics
    def Velocity(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = o + self._tab.Pos
            from .Vector3 import Vector3
            obj = Vector3()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Physics
    def AngularVelocity(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            x = o + self._tab.Pos
            from .Vector3 import Vector3
            obj = Vector3()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def PhysicsStart(builder): builder.StartObject(4)
def PhysicsAddLocation(builder, location): builder.PrependStructSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(location), 0)
def PhysicsAddRotation(builder, rotation): builder.PrependStructSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(rotation), 0)
def PhysicsAddVelocity(builder, velocity): builder.PrependStructSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(velocity), 0)
def PhysicsAddAngularVelocity(builder, angularVelocity): builder.PrependStructSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(angularVelocity), 0)
def PhysicsEnd(builder): return builder.EndObject()
