# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flat

import flatbuffers

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

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

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

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

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

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

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

def DesiredPhysicsStart(builder): builder.StartObject(4)
def DesiredPhysicsAddLocation(builder, location): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(location), 0)
def DesiredPhysicsAddRotation(builder, rotation): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(rotation), 0)
def DesiredPhysicsAddVelocity(builder, velocity): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(velocity), 0)
def DesiredPhysicsAddAngularVelocity(builder, angularVelocity): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(angularVelocity), 0)
def DesiredPhysicsEnd(builder): return builder.EndObject()
