# automatically generated by the FlatBuffers compiler, do not modify

# namespace: FBOutput

import tdw.flatbuffers

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

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

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

    # ObjectColliderIntersection
    def ObjectIdA(self):
        o = tdw.flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(tdw.flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # ObjectColliderIntersection
    def ObjectIdB(self):
        o = tdw.flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(tdw.flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # ObjectColliderIntersection
    def Direction(self):
        o = tdw.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

    # ObjectColliderIntersection
    def Distance(self):
        o = tdw.flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(tdw.flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.0

def ObjectColliderIntersectionStart(builder): builder.StartObject(4)
def ObjectColliderIntersectionAddObjectIdA(builder, objectIdA): builder.PrependInt32Slot(0, objectIdA, 0)
def ObjectColliderIntersectionAddObjectIdB(builder, objectIdB): builder.PrependInt32Slot(1, objectIdB, 0)
def ObjectColliderIntersectionAddDirection(builder, direction): builder.PrependStructSlot(2, tdw.flatbuffers.number_types.UOffsetTFlags.py_type(direction), 0)
def ObjectColliderIntersectionAddDistance(builder, distance): builder.PrependFloat32Slot(3, distance, 0.0)
def ObjectColliderIntersectionEnd(builder): return builder.EndObject()
