亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? steeringbehavior.vb

?? 一個(gè).Net下用VB編寫的用于游戲的人工智能引擎
?? VB
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
        m_vSteeringForce.Truncate(m_pVehicle.MaxForce())

        Return m_vSteeringForce
    End Function

    '//---------------------- CalculatePrioritized ----------------------------
    '//
    '//  this method calls each active steering behavior in order of priority
    '//  and acumulates their forces until the max steering force magnitude
    '//  is reached, at which time the function returns the steering force 
    '//  accumulated to that  point
    '//------------------------------------------------------------------------
    Private Function CalculatePrioritized() As Vector2D
        Dim force As Vector2D

        If IsOn(behavior_type.wall_avoidance) Then
            force = WallAvoidance(m_pVehicle.World().Walls()).Mutiply(m_dWeightWallAvoidance)
            If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
        End If

        If IsOn(behavior_type.obstacle_avoidance) Then
            force = ObstacleAvoidance(m_pVehicle.World().Obstacles()).Mutiply(m_dWeightObstacleAvoidance)
            If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
        End If

        If IsOn(behavior_type.evade) Then
            'assert(m_pTargetAgent1 && "Evade target not assigned");
            force = Evade(m_pTargetAgent1).Mutiply(m_dWeightEvade)
            If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
        End If


        If IsOn(behavior_type.flee) Then
            force = Flee(m_pVehicle.World().Crosshair()).Mutiply(m_dWeightFlee)
            If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
        End If
        If Not isSpacePartitioningOn() Then
            If IsOn(behavior_type.separation) Then
                force = Separation(m_pVehicle.World().Agents()).Mutiply(m_dWeightSeparation)
                If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
            End If

            If IsOn(behavior_type.allignment) Then
                force = Alignment(m_pVehicle.World().Agents()).Mutiply(m_dWeightAlignment)
                If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
            End If

            If IsOn(behavior_type.cohesion) Then
                force = Cohesion(m_pVehicle.World().Agents()).Mutiply(m_dWeightCohesion)
                If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
            End If
        Else

            If IsOn(behavior_type.separation) Then
                force = SeparationPlus(m_pVehicle.World().Agents()).Mutiply(m_dWeightSeparation)
                If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
            End If

            If IsOn(behavior_type.allignment) Then
                force = AlignmentPlus(m_pVehicle.World().Agents()).Mutiply(m_dWeightAlignment)
                If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
            End If

            If IsOn(behavior_type.cohesion) Then
                force = CohesionPlus(m_pVehicle.World().Agents()).Mutiply(m_dWeightCohesion)
                If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
            End If

        End If

        If IsOn(behavior_type.seek) Then
            force = Seek(m_pVehicle.World().Crosshair()).Mutiply(m_dWeightSeek)
            If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
        End If

        If IsOn(behavior_type.arrive) Then
            force = Arrive(m_pVehicle.World().Crosshair(), m_Deceleration).Mutiply(m_dWeightArrive)
            If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
        End If

        If IsOn(behavior_type.wander) Then
            force = Wander().Mutiply(m_dWeightWander)
            If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
        End If

        If IsOn(behavior_type.pursuit) Then
            'assert(m_pTargetAgent1 && "pursuit target not assigned");
            force = Pursuit(m_pTargetAgent1).Mutiply(m_dWeightPursuit)
            If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
        End If

        If IsOn(behavior_type.offset_pursuit) Then
            'assert (m_pTargetAgent1 && "pursuit target not assigned");
            'assert (!m_vOffset.isZero() && "No offset assigned");
            force = OffsetPursuit(m_pTargetAgent1, m_vOffset)
            If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
        End If

        If IsOn(behavior_type.interpose) Then
            'assert (m_pTargetAgent1 && m_pTargetAgent2 && "Interpose agents not assigned");
            force = Interpose(m_pTargetAgent1, m_pTargetAgent2).Mutiply(m_dWeightInterpose)
            If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
        End If

        If IsOn(behavior_type.hide) Then
            'assert(m_pTargetAgent1 && "Hide target not assigned");
            force = Hide(m_pTargetAgent1, m_pVehicle.World().Obstacles()).Mutiply(m_dWeightHide)
            If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
        End If


        If IsOn(behavior_type.follow_path) Then
            force = FollowPath().Mutiply(m_dWeightFollowPath)
            If Not AccumulateForce(m_vSteeringForce, force) Then Return m_vSteeringForce
        End If

        Return m_vSteeringForce
    End Function

    '//helper method for Hide. Returns a position located on the other
    '//side of an obstacle to the pursuer
    '//---------------------- CalculateDithered ----------------------------
    '//
    '//  this method sums up the active behaviors by assigning a probabilty
    '//  of being calculated to each behavior. It then tests the first priority
    '//  to see if it should be calcukated this simulation-step. If so, it
    '//  calculates the steering force resulting from this behavior. If it is
    '//  more than zero it returns the force. If zero, or if the behavior is
    '//  skipped it continues onto the next priority, and so on.
    '//
    '//  NOTE: Not all of the behaviors have been implemented in this method,
    '//        just a few, so you get the general idea
    '//------------------------------------------------------------------------    

    Private Function CalculateDithered() As Vector2D
        '//reset the steering force
        m_vSteeringForce.Zero()

        If IsOn(behavior_type.wall_avoidance) And Utils.RandFloat() < Prm.prWallAvoidance Then
            m_vSteeringForce = WallAvoidance(m_pVehicle.World().Walls()).Mutiply(m_dWeightWallAvoidance / Prm.prWallAvoidance)
            If Not m_vSteeringForce.IsZero() Then
                m_vSteeringForce.Truncate(m_pVehicle.MaxForce())
                Return m_vSteeringForce
            End If
        End If

        If IsOn(behavior_type.obstacle_avoidance) And Utils.RandFloat() < Prm.prObstacleAvoidance Then
            m_vSteeringForce.PlusEqual(ObstacleAvoidance(m_pVehicle.World().Obstacles()).Mutiply(m_dWeightObstacleAvoidance / Prm.prObstacleAvoidance))
            If Not m_vSteeringForce.IsZero() Then
                m_vSteeringForce.Truncate(m_pVehicle.MaxForce())
                Return m_vSteeringForce
            End If
        End If

        If Not isSpacePartitioningOn() Then
            If IsOn(behavior_type.separation) And Utils.RandFloat() < Prm.prSeparation Then
                m_vSteeringForce.PlusEqual(Separation(m_pVehicle.World().Agents()).Mutiply(m_dWeightSeparation / Prm.prSeparation))
                If Not m_vSteeringForce.IsZero() Then
                    m_vSteeringForce.Truncate(m_pVehicle.MaxForce())
                    Return m_vSteeringForce
                End If
            End If
        Else
            If IsOn(behavior_type.separation) And Utils.RandFloat() < Prm.prSeparation Then
                m_vSteeringForce.PlusEqual(SeparationPlus(m_pVehicle.World().Agents()).Mutiply(m_dWeightSeparation / Prm.prSeparation))
                If Not m_vSteeringForce.IsZero() Then
                    m_vSteeringForce.Truncate(m_pVehicle.MaxForce())

                    Return m_vSteeringForce
                End If
            End If
        End If

        If IsOn(behavior_type.flee) And Utils.RandFloat() < Prm.prFlee Then
            m_vSteeringForce.PlusEqual(Flee(m_pVehicle.World().Crosshair()).Mutiply(m_dWeightFlee / Prm.prFlee))

            If Not m_vSteeringForce.IsZero() Then
                m_vSteeringForce.Truncate(m_pVehicle.MaxForce())
                Return m_vSteeringForce
            End If
        End If

        If IsOn(behavior_type.evade) And Utils.RandFloat() < Prm.prEvade Then
            'assert(m_pTargetAgent1 && "Evade target not assigned");
            m_vSteeringForce.PlusEqual(Evade(m_pTargetAgent1).Mutiply(m_dWeightEvade / Prm.prEvade))
            If Not m_vSteeringForce.IsZero() Then
                m_vSteeringForce.Truncate(m_pVehicle.MaxForce())
                Return m_vSteeringForce
            End If
        End If

        If Not isSpacePartitioningOn() Then
            If IsOn(behavior_type.allignment) And Utils.RandFloat() < Prm.prAlignment Then
                m_vSteeringForce.PlusEqual(Alignment(m_pVehicle.World().Agents()).Mutiply(m_dWeightAlignment / Prm.prAlignment))
                If Not m_vSteeringForce.IsZero() Then
                    m_vSteeringForce.Truncate(m_pVehicle.MaxForce())
                    Return m_vSteeringForce
                End If
            End If

            If IsOn(behavior_type.cohesion) And Utils.RandFloat() < Prm.prCohesion Then
                m_vSteeringForce.PlusEqual(Cohesion(m_pVehicle.World().Agents()).Mutiply(m_dWeightCohesion / Prm.prCohesion))
                If Not m_vSteeringForce.IsZero() Then
                    m_vSteeringForce.Truncate(m_pVehicle.MaxForce())
                    Return m_vSteeringForce
                End If
            End If
        Else
            If IsOn(behavior_type.allignment) And Utils.RandFloat() < Prm.prAlignment Then
                m_vSteeringForce.PlusEqual(AlignmentPlus(m_pVehicle.World().Agents()).Mutiply(m_dWeightAlignment / Prm.prAlignment))

                If Not m_vSteeringForce.IsZero() Then
                    m_vSteeringForce.Truncate(m_pVehicle.MaxForce())
                    Return m_vSteeringForce
                End If
            End If

            If IsOn(behavior_type.cohesion) And Utils.RandFloat() < Prm.prCohesion Then
                m_vSteeringForce.PlusEqual(CohesionPlus(m_pVehicle.World().Agents()).Mutiply(m_dWeightCohesion / Prm.prCohesion))
                If Not m_vSteeringForce.IsZero() Then
                    m_vSteeringForce.Truncate(m_pVehicle.MaxForce())
                    Return m_vSteeringForce
                End If
            End If
        End If

        If IsOn(behavior_type.wander) And Utils.RandFloat() < Prm.prWander Then
            m_vSteeringForce.PlusEqual(Wander().Mutiply(m_dWeightWander / Prm.prWander))
            If Not m_vSteeringForce.IsZero() Then
                m_vSteeringForce.Truncate(m_pVehicle.MaxForce())
                Return m_vSteeringForce
            End If
        End If

        If IsOn(behavior_type.seek) And Utils.RandFloat() < Prm.prSeek Then
            m_vSteeringForce.PlusEqual(Seek(m_pVehicle.World().Crosshair()).Mutiply(m_dWeightSeek / Prm.prSeek))
            If Not m_vSteeringForce.IsZero() Then
                m_vSteeringForce.Truncate(m_pVehicle.MaxForce())
                Return m_vSteeringForce
            End If
        End If

        If IsOn(behavior_type.arrive) And Utils.RandFloat() < Prm.prArrive Then
            m_vSteeringForce.PlusEqual(Arrive(m_pVehicle.World().Crosshair(), m_Deceleration).Mutiply(m_dWeightArrive / Prm.prArrive))
            If Not m_vSteeringForce.IsZero() Then
                m_vSteeringForce.Truncate(m_pVehicle.MaxForce())
                Return m_vSteeringForce
            End If
        End If

        Return m_vSteeringForce
    End Function

    '//------------------------- GetHidingPosition ----------------------------
    '//
    '//  Given the position of a hunter, and the position and radius of
    '//  an obstacle, this method calculates a position DistanceFromBoundary 
    '//  away from its bounding radius and directly opposite the hunter
    '//------------------------------------------------------------------------
    Private Function GetHidingPosition(ByVal posOb As Vector2D, ByVal radiusOb As Double, ByVal posHunter As Vector2D) As Vector2D
        '//calculate how far away the agent is to be from the chosen obstacle's
        '//bounding radius
        Dim DistanceFromBoundary As Double = 30.0
        Dim DistAway As Double = radiusOb + DistanceFromBoundary

        '//calculate the heading toward the object from the hunter
        Dim ToOb As Vector2D = Vector2D.Vec2DNormalize(posOb.Minus(posHunter))

        '//scale it to size and add to the obstacles position to get
        '//the hiding spot.
        Return ToOb.Mutiply(DistAway).Plus(posOb)

    End Function


    Public Sub New(ByVal agent As Vehicle)

        m_pVehicle = agent
        m_iFlags = 0
        m_dDBoxLength = Prm.MinDetectionBoxLength
        m_dWeightCohesion = Prm.CohesionWeight
        m_dWeightAlignment = Prm.AlignmentWeight
        m_dWeightSeparation = Prm.SeparationWeight
        m_dWeightObstacleAvoidance = Prm.ObstacleAvoidanceWeight
        m_dWeightWander = Prm.WanderWeight
        m_dWeightWallAvoidance = Prm.WallAvoidanceWeight
        m_dViewDistance = Prm.ViewDistance
        m_dWallDetectionFeelerLength = Prm.WallDetectionFeelerLength
        m_Feelers = New ArrayList
        m_Deceleration = Deceleration.normal
        m_pTargetAgent1 = Nothing
        m_pTargetAgent2 = Nothing
        m_dWanderDistance = WanderDist
        m_dWanderJitter = WanderJitterPerSec
        m_dWanderRadius = WanderRad
        m_dWaypointSeekDistSq = WaypointSeekDist * WaypointSeekDist
        m_dWeightSeek = Prm.SeekWeight
        m_dWeightFlee = Prm.FleeWeight
        m_dWeightArrive = Prm.ArriveWeight
        m_dWeightPursuit = Prm.PursuitWeight
        m_dWeightOffsetPursuit = Prm.OffsetPursuitWeight
        m_dWeightInterpose = Prm.InterposeWeight
        m_dWeightHide = Prm.HideWeight
        m_dWeightEvade = Prm.EvadeWeight
        m_dWeightFollowPath = Prm.FollowPathWeight
        m_bCellSpaceOn = False
        m_SummingMethod = summing_method.prioritized

        '//stuff for the wander behavior

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品爽啪视频| 国产精品一二三四五| 国产三级三级三级精品8ⅰ区| 91小视频在线免费看| 麻豆国产欧美日韩综合精品二区 | 中文字幕第一区第二区| 欧美日韩专区在线| 国产不卡视频在线播放| 91麻豆精品国产91久久久 | 色婷婷精品久久二区二区蜜臂av| 亚洲一卡二卡三卡四卡无卡久久| 欧美日韩成人综合| 国产麻豆一精品一av一免费| 亚洲精品水蜜桃| 欧美刺激午夜性久久久久久久| 高清久久久久久| 五月开心婷婷久久| 国产日韩欧美精品综合| 欧美中文字幕亚洲一区二区va在线| 精品写真视频在线观看| 亚洲精品国产一区二区三区四区在线 | 亚洲免费毛片网站| 欧美成人猛片aaaaaaa| 99国产精品一区| 精品一区二区三区av| 亚洲免费看黄网站| 国产亚洲综合av| 欧美三级视频在线播放| 蜜臀久久久久久久| 亚洲乱码中文字幕| 国产日本欧美一区二区| 中文字幕中文在线不卡住| 欧美一卡二卡在线观看| 日韩黄色免费电影| 亚洲高清不卡在线| 欧美日本一区二区三区| 免费在线观看视频一区| 欧美大胆人体bbbb| 国产成人精品亚洲日本在线桃色| 日韩欧美专区在线| 亚洲网友自拍偷拍| 欧美一二三区在线观看| 亚洲欧洲国产日韩| 国产精品亚洲а∨天堂免在线| 日韩一区二区三区观看| 国产白丝网站精品污在线入口| 99久精品国产| 亚洲综合小说图片| 欧美变态口味重另类| 成人综合日日夜夜| 日韩av不卡一区二区| 91精品国产色综合久久不卡电影 | 国产一区二区三区av电影| 中国av一区二区三区| 成人午夜激情在线| 国产日韩精品一区二区三区| 91国产精品成人| jlzzjlzz亚洲日本少妇| 99久久精品情趣| 综合色中文字幕| 成人免费黄色大片| 国产一级精品在线| 国内精品写真在线观看| 麻豆成人久久精品二区三区红| 亚洲sss视频在线视频| 依依成人综合视频| 亚洲国产欧美在线人成| 亚洲线精品一区二区三区八戒| 亚洲黄一区二区三区| 欧美一级搡bbbb搡bbbb| 色哟哟一区二区在线观看| 国产一区二区精品久久| 日韩黄色在线观看| 亚洲激情一二三区| 欧美韩国日本一区| 亚洲国产成人91porn| 69堂国产成人免费视频| 久久99精品一区二区三区| 麻豆国产精品一区二区三区 | 韩国毛片一区二区三区| 精品一区二区在线看| 国内精品嫩模私拍在线| 成人在线视频一区二区| 91麻豆国产福利在线观看| 色综合天天做天天爱| 欧洲一区在线电影| 3d动漫精品啪啪一区二区竹菊| 欧美一级精品在线| 国产午夜精品福利| 国产精品第13页| 一区二区在线免费观看| 亚洲国产综合在线| 久久99久国产精品黄毛片色诱| 国产成人精品网址| 91福利社在线观看| 欧美电视剧在线看免费| 国产日韩av一区| 亚洲成a人片综合在线| 精品一区二区免费视频| 99久精品国产| 日韩免费成人网| 国产精品毛片久久久久久久| 亚洲成人在线网站| 国产精品888| 欧美日韩国产在线播放网站| 日韩欧美资源站| 亚洲人成人一区二区在线观看| 首页亚洲欧美制服丝腿| 国产二区国产一区在线观看| 欧美亚洲自拍偷拍| 久久久www成人免费无遮挡大片| 亚洲免费视频中文字幕| 精品中文字幕一区二区| 色丁香久综合在线久综合在线观看| 欧美一区二区三区电影| 最新成人av在线| 久久精品国产99| 欧美色区777第一页| 久久日一线二线三线suv| 亚洲欧美福利一区二区| 日本vs亚洲vs韩国一区三区二区| 大尺度一区二区| 日韩精品一区二区三区视频在线观看| 日韩毛片高清在线播放| 激情文学综合丁香| 欧美一区中文字幕| 亚洲自拍都市欧美小说| 成人午夜视频免费看| 日韩视频一区在线观看| 亚洲一区二区三区中文字幕| 成人免费视频播放| 精品精品欲导航| 亚洲电影欧美电影有声小说| 99国产精品久久| 欧美激情一区二区在线| 久久国内精品自在自线400部| 欧美少妇bbb| 一区二区成人在线视频| 国产成人av影院| 久久精品欧美日韩| 激情综合色丁香一区二区| 欧美丰满少妇xxxxx高潮对白 | 国产91清纯白嫩初高中在线观看| 91精品国产综合久久久久久| 一区二区三区久久久| 国产91精品露脸国语对白| 日韩一区和二区| 日韩精品欧美成人高清一区二区| 色哟哟一区二区在线观看| 1区2区3区精品视频| 丰满亚洲少妇av| 国产蜜臀97一区二区三区| 韩国午夜理伦三级不卡影院| 日韩一区二区精品在线观看| 午夜影院在线观看欧美| 欧美制服丝袜第一页| 亚洲激情网站免费观看| 日本乱人伦一区| 亚洲一区二区三区四区在线观看 | 在线观看欧美黄色| 亚洲精品伦理在线| 欧美色视频一区| 日韩有码一区二区三区| 3d动漫精品啪啪| 久久99久久久欧美国产| 精品少妇一区二区| 国产麻豆视频一区| 欧美一区二区黄色| 久久国产夜色精品鲁鲁99| 日韩欧美一级精品久久| 亚洲五月六月丁香激情| 欧美区视频在线观看| 青青草97国产精品免费观看无弹窗版| 日韩欧美在线影院| 捆绑调教一区二区三区| 久久久久久久久蜜桃| 一区二区三区在线免费| 日韩一区二区三区在线| 成人深夜视频在线观看| 午夜日韩在线观看| 久久久91精品国产一区二区精品 | 国产一区不卡精品| 亚洲欧美另类小说视频| 欧美一级艳片视频免费观看| 国产aⅴ综合色| 天天操天天干天天综合网| 久久一区二区三区四区| 在线免费观看日韩欧美| 久久se精品一区精品二区| 亚洲女子a中天字幕| 精品国产乱码久久久久久久久| 色噜噜偷拍精品综合在线| 精品一区二区日韩| 午夜精品视频在线观看| 国产精品免费av| 日韩一区二区高清| 在线观看网站黄不卡| 高清成人在线观看| 美国三级日本三级久久99| 一区二区三区丝袜|