# automatically generated by the FlatBuffers compiler, do not modify

# namespace: isp

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

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

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

    @classmethod
    def GetRootAsVehiclePhysics(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    @classmethod
    def VehiclePhysicsBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x49\x53\x50\x46", size_prefixed=size_prefixed)

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

    # VehiclePhysics
    def TorqueCurve(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from communications.isp.Tensor import Tensor
            obj = Tensor()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # VehiclePhysics
    def MaxRpm(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # VehiclePhysics
    def Moi(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # VehiclePhysics
    def DampingRateFullThrottle(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # VehiclePhysics
    def DampingRateZeroThrottleClutchEngaged(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # VehiclePhysics
    def DampingRateZeroThrottleClutchDisengaged(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # VehiclePhysics
    def UseGearAutobox(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # VehiclePhysics
    def GearSwitchTime(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # VehiclePhysics
    def ClutchStrength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # VehiclePhysics
    def FinalRatio(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # VehiclePhysics
    def ForwardGears(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from communications.isp.ForwardGears import ForwardGears
            obj = ForwardGears()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # VehiclePhysics
    def ForwardGearsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # VehiclePhysics
    def ForwardGearsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        return o == 0

    # VehiclePhysics
    def Mass(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # VehiclePhysics
    def DragCoefficient(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # VehiclePhysics
    def CenterOfMass(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from communications.isp.Tensor import Tensor
            obj = Tensor()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # VehiclePhysics
    def SteeringCurve(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from communications.isp.Tensor import Tensor
            obj = Tensor()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # VehiclePhysics
    def SteeringCurveLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # VehiclePhysics
    def SteeringCurveIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
        return o == 0

    # VehiclePhysics
    def UseSweepWheelCollision(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # VehiclePhysics
    def Wheels(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from communications.isp.WheelPhysics import WheelPhysics
            obj = WheelPhysics()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # VehiclePhysics
    def WheelsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # VehiclePhysics
    def WheelsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        return o == 0

def VehiclePhysicsStart(builder): builder.StartObject(17)
def Start(builder):
    return VehiclePhysicsStart(builder)
def VehiclePhysicsAddTorqueCurve(builder, torqueCurve): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(torqueCurve), 0)
def AddTorqueCurve(builder, torqueCurve):
    return VehiclePhysicsAddTorqueCurve(builder, torqueCurve)
def VehiclePhysicsAddMaxRpm(builder, maxRpm): builder.PrependFloat64Slot(1, maxRpm, 0.0)
def AddMaxRpm(builder, maxRpm):
    return VehiclePhysicsAddMaxRpm(builder, maxRpm)
def VehiclePhysicsAddMoi(builder, moi): builder.PrependFloat64Slot(2, moi, 0.0)
def AddMoi(builder, moi):
    return VehiclePhysicsAddMoi(builder, moi)
def VehiclePhysicsAddDampingRateFullThrottle(builder, dampingRateFullThrottle): builder.PrependFloat64Slot(3, dampingRateFullThrottle, 0.0)
def AddDampingRateFullThrottle(builder, dampingRateFullThrottle):
    return VehiclePhysicsAddDampingRateFullThrottle(builder, dampingRateFullThrottle)
def VehiclePhysicsAddDampingRateZeroThrottleClutchEngaged(builder, dampingRateZeroThrottleClutchEngaged): builder.PrependFloat64Slot(4, dampingRateZeroThrottleClutchEngaged, 0.0)
def AddDampingRateZeroThrottleClutchEngaged(builder, dampingRateZeroThrottleClutchEngaged):
    return VehiclePhysicsAddDampingRateZeroThrottleClutchEngaged(builder, dampingRateZeroThrottleClutchEngaged)
def VehiclePhysicsAddDampingRateZeroThrottleClutchDisengaged(builder, dampingRateZeroThrottleClutchDisengaged): builder.PrependFloat64Slot(5, dampingRateZeroThrottleClutchDisengaged, 0.0)
def AddDampingRateZeroThrottleClutchDisengaged(builder, dampingRateZeroThrottleClutchDisengaged):
    return VehiclePhysicsAddDampingRateZeroThrottleClutchDisengaged(builder, dampingRateZeroThrottleClutchDisengaged)
def VehiclePhysicsAddUseGearAutobox(builder, useGearAutobox): builder.PrependBoolSlot(6, useGearAutobox, 0)
def AddUseGearAutobox(builder, useGearAutobox):
    return VehiclePhysicsAddUseGearAutobox(builder, useGearAutobox)
def VehiclePhysicsAddGearSwitchTime(builder, gearSwitchTime): builder.PrependFloat64Slot(7, gearSwitchTime, 0.0)
def AddGearSwitchTime(builder, gearSwitchTime):
    return VehiclePhysicsAddGearSwitchTime(builder, gearSwitchTime)
def VehiclePhysicsAddClutchStrength(builder, clutchStrength): builder.PrependFloat64Slot(8, clutchStrength, 0.0)
def AddClutchStrength(builder, clutchStrength):
    return VehiclePhysicsAddClutchStrength(builder, clutchStrength)
def VehiclePhysicsAddFinalRatio(builder, finalRatio): builder.PrependFloat64Slot(9, finalRatio, 0.0)
def AddFinalRatio(builder, finalRatio):
    return VehiclePhysicsAddFinalRatio(builder, finalRatio)
def VehiclePhysicsAddForwardGears(builder, forwardGears): builder.PrependUOffsetTRelativeSlot(10, flatbuffers.number_types.UOffsetTFlags.py_type(forwardGears), 0)
def AddForwardGears(builder, forwardGears):
    return VehiclePhysicsAddForwardGears(builder, forwardGears)
def VehiclePhysicsStartForwardGearsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartForwardGearsVector(builder, numElems):
    return VehiclePhysicsStartForwardGearsVector(builder, numElems)
def VehiclePhysicsAddMass(builder, mass): builder.PrependFloat64Slot(11, mass, 0.0)
def AddMass(builder, mass):
    return VehiclePhysicsAddMass(builder, mass)
def VehiclePhysicsAddDragCoefficient(builder, dragCoefficient): builder.PrependFloat64Slot(12, dragCoefficient, 0.0)
def AddDragCoefficient(builder, dragCoefficient):
    return VehiclePhysicsAddDragCoefficient(builder, dragCoefficient)
def VehiclePhysicsAddCenterOfMass(builder, centerOfMass): builder.PrependUOffsetTRelativeSlot(13, flatbuffers.number_types.UOffsetTFlags.py_type(centerOfMass), 0)
def AddCenterOfMass(builder, centerOfMass):
    return VehiclePhysicsAddCenterOfMass(builder, centerOfMass)
def VehiclePhysicsAddSteeringCurve(builder, steeringCurve): builder.PrependUOffsetTRelativeSlot(14, flatbuffers.number_types.UOffsetTFlags.py_type(steeringCurve), 0)
def AddSteeringCurve(builder, steeringCurve):
    return VehiclePhysicsAddSteeringCurve(builder, steeringCurve)
def VehiclePhysicsStartSteeringCurveVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartSteeringCurveVector(builder, numElems):
    return VehiclePhysicsStartSteeringCurveVector(builder, numElems)
def VehiclePhysicsAddUseSweepWheelCollision(builder, useSweepWheelCollision): builder.PrependBoolSlot(15, useSweepWheelCollision, 0)
def AddUseSweepWheelCollision(builder, useSweepWheelCollision):
    return VehiclePhysicsAddUseSweepWheelCollision(builder, useSweepWheelCollision)
def VehiclePhysicsAddWheels(builder, wheels): builder.PrependUOffsetTRelativeSlot(16, flatbuffers.number_types.UOffsetTFlags.py_type(wheels), 0)
def AddWheels(builder, wheels):
    return VehiclePhysicsAddWheels(builder, wheels)
def VehiclePhysicsStartWheelsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartWheelsVector(builder, numElems):
    return VehiclePhysicsStartWheelsVector(builder, numElems)
def VehiclePhysicsEnd(builder): return builder.EndObject()
def End(builder):
    return VehiclePhysicsEnd(builder)