# automatically generated by the FlatBuffers compiler, do not modify

# namespace: FBOutput

import tdw.flatbuffers

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

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

    # RigidbodyData
    def Id(self): return self._tab.Get(tdw.flatbuffers.number_types.Int32Flags, self._tab.Pos + tdw.flatbuffers.number_types.UOffsetTFlags.py_type(0))
    # RigidbodyData
    def Velocity(self, obj):
        obj.Init(self._tab.Bytes, self._tab.Pos + 4)
        return obj

    # RigidbodyData
    def AngularVelocity(self, obj):
        obj.Init(self._tab.Bytes, self._tab.Pos + 16)
        return obj

    # RigidbodyData
    def Mass(self): return self._tab.Get(tdw.flatbuffers.number_types.Float32Flags, self._tab.Pos + tdw.flatbuffers.number_types.UOffsetTFlags.py_type(28))
    # RigidbodyData
    def Sleeping(self): return self._tab.Get(tdw.flatbuffers.number_types.BoolFlags, self._tab.Pos + tdw.flatbuffers.number_types.UOffsetTFlags.py_type(32))

def CreateRigidbodyData(builder, id, velocity_x, velocity_y, velocity_z, angular_velocity_x, angular_velocity_y, angular_velocity_z, mass, sleeping):
    builder.Prep(4, 36)
    builder.Pad(3)
    builder.PrependBool(sleeping)
    builder.PrependFloat32(mass)
    builder.Prep(4, 12)
    builder.PrependFloat32(angular_velocity_z)
    builder.PrependFloat32(angular_velocity_y)
    builder.PrependFloat32(angular_velocity_x)
    builder.Prep(4, 12)
    builder.PrependFloat32(velocity_z)
    builder.PrependFloat32(velocity_y)
    builder.PrependFloat32(velocity_x)
    builder.PrependInt32(id)
    return builder.Offset()
