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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? transformations.vb

?? 一個.Net下用VB編寫的用于游戲的人工智能引擎
?? VB
字號:
'//  Desc:   Functions for converting 2D vectors between World and Local space.
Public Class Transformations


    '//--------------------------- WorldTransform -----------------------------
    '//
    '//  given a std::vector of 2D vectors, a position, orientation and scale,
    '//  this function transforms the 2D vectors into the object's world space
    '//------------------------------------------------------------------------
    Public Shared Function WorldTransform(ByVal points As ArrayList, ByVal pos As Vector2D, ByVal forward As Vector2D, ByVal side As Vector2D, ByVal scale As Vector2D) As ArrayList
        '//copy the original vertices into the buffer about to be transformed
        Dim TranVector2Ds As New ArrayList
        Dim i As Integer
        For i = 0 To points.Count - 1
            TranVector2Ds.Add(CType(points(i), Vector2D).Copy)
        Next

        '//create a transformation matrix
        Dim matTransform As New C2DMatrix

        '//scale
        If (scale.x <> 1.0) Or (scale.y <> 1.0) Then matTransform.Scale(scale.x, scale.y)

        '//rotate
        matTransform.Rotate(forward, side)

        '//and translate
        matTransform.Translate(pos.x, pos.y)

        '//now transform the object's vertices
        matTransform.TransformVector2Ds(TranVector2Ds)

        Return TranVector2Ds
    End Function

    '//--------------------------- WorldTransform -----------------------------
    '//
    '//  given a std::vector of 2D vectors, a position and  orientation
    '//  this function transforms the 2D vectors into the object's world space
    '/------------------------------------------------------------------------
    Public Shared Function WorldTransform(ByVal points As ArrayList, ByVal pos As Vector2D, ByVal forward As Vector2D, ByVal side As Vector2D) As ArrayList
        '//copy the original vertices into the buffer about to be transformed
        Dim TranVector2Ds As ArrayList = points

        '//create a transformation matrix
        Dim matTransform As New C2DMatrix

        '//rotate
        matTransform.Rotate(forward, side)

        '//and translate
        matTransform.Translate(pos.x, pos.y)

        '//now transform the object's vertices
        matTransform.TransformVector2Ds(TranVector2Ds)

        Return TranVector2Ds '

    End Function

    '//--------------------- PointToWorldSpace --------------------------------
    '//
    '//  Transforms a point from the agent's local space into world space
    '//------------------------------------------------------------------------
    Public Shared Function PointToWorldSpace(ByVal point As Vector2D, ByVal AgentHeading As Vector2D, ByVal AgentSide As Vector2D, ByVal AgentPosition As Vector2D) As Vector2D
        '//make a copy of the point
        Dim TransPoint As Vector2D = point

        '//create a transformation matrix
        Dim matTransform As New C2DMatrix

        '//rotate
        matTransform.Rotate(AgentHeading, AgentSide)

        '//and translate
        matTransform.Translate(AgentPosition.x, AgentPosition.y)

        '//now transform the vertices
        matTransform.TransformVector2Ds(TransPoint)

        Return TransPoint
    End Function

    '//--------------------- VectorToWorldSpace --------------------------------
    '//
    '//  Transforms a vector from the agent's local space into world space
    '//------------------------------------------------------------------------
    Public Shared Function VectorToWorldSpace(ByVal vec As Vector2D, ByVal AgentHeading As Vector2D, ByVal AgentSide As Vector2D) As Vector2D
        '//make a copy of the point
        Dim TransVec As Vector2D = vec

        '//create a transformation matrix
        Dim matTransform As New C2DMatrix

        '//rotate
        matTransform.Rotate(AgentHeading, AgentSide)

        '//now transform the vertices
        matTransform.TransformVector2Ds(TransVec)

        Return TransVec
    End Function

    '//--------------------- PointToLocalSpace --------------------------------
    '//
    '//------------------------------------------------------------------------
    Public Shared Function PointToLocalSpace(ByVal point As Vector2D, ByVal AgentHeading As Vector2D, ByVal AgentSide As Vector2D, ByVal AgentPosition As Vector2D) As Vector2D
        '//make a copy of the point
        Dim TransPoint As Vector2D = point.Copy

        '//create a transformation matrix
        Dim matTransform As New C2DMatrix

        Dim Tx As Double = -AgentPosition.Dot(AgentHeading)
        Dim Ty As Double = -AgentPosition.Dot(AgentSide)

        '//create the transformation matrix
        matTransform._11(AgentHeading.x)
        matTransform._12(AgentSide.x)
        matTransform._21(AgentHeading.y)
        matTransform._22(AgentSide.y)
        matTransform._31(Tx)
        matTransform._32(Ty)

        '//now transform the vertices
        matTransform.TransformVector2Ds(TransPoint)

        Return TransPoint
    End Function

    '//--------------------- VectorToLocalSpace --------------------------------
    '//
    '//------------------------------------------------------------------------
    Public Shared Function VectorToLocalSpace(ByVal vec As Vector2D, ByVal AgentHeading As Vector2D, ByVal AgentSide As Vector2D) As Vector2D
        '//make a copy of the point
        Dim TransPoint As Vector2D = vec.Copy

        '//create a transformation matrix
        Dim matTransform As New C2DMatrix

        '//create the transformation matrix
        matTransform._11(AgentHeading.x)
        matTransform._12(AgentSide.x)
        matTransform._21(AgentHeading.y)
        matTransform._22(AgentSide.y)

        '//now transform the vertices
        matTransform.TransformVector2Ds(TransPoint)

        Return TransPoint
    End Function

    '//-------------------------- Vec2DRotateAroundOrigin --------------------------
    '//
    '//  rotates a vector ang rads around the origin
    '//-----------------------------------------------------------------------------
    Public Shared Sub Vec2DRotateAroundOrigin(ByVal v As Vector2D, ByVal ang As Double)
        '//create a transformation matrix
        Dim mat As New C2DMatrix

        '//rotate
        mat.Rotate(ang)

        '//now transform the object's vertices
        mat.TransformVector2Ds(v)
    End Sub

    '//------------------------ CreateWhiskers ------------------------------------
    '//
    '//  given an origin, a facing direction, a 'field of view' describing the 
    '//  limit of the outer whiskers, a whisker length and the number of whiskers
    '//  this method returns a vector containing the end positions of a series
    '//  of whiskers radiating away from the origin and with equal distance between
    '//  them. (like the spokes of a wheel clipped to a specific segment size)
    '//----------------------------------------------------------------------------
    Public Shared Function CreateWhiskers(ByVal NumWhiskers As Integer, ByVal WhiskerLength As Double, ByVal fov As Double, ByVal facing As Vector2D, ByVal origin As Vector2D) As ArrayList
        '//this is the magnitude of the angle separating each whisker
        Dim SectorSize As Double = fov / (NumWhiskers - 1)

        Dim whiskers As New ArrayList
        Dim temp As Vector2D
        Dim angle As Double = -fov * 0.5

        Dim w As Integer
        For w = 0 To NumWhiskers - 1
            '//create the whisker extending outwards at this angle
            temp = facing
            Vec2DRotateAroundOrigin(temp, angle)
            whiskers.Add(origin.Plus(temp.Mutiply(WhiskerLength)))

            angle += SectorSize
        Next
        Return whiskers
    End Function

End Class

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人三级在线| 7777精品伊人久久久大香线蕉的 | 国产精品69毛片高清亚洲| 亚洲欧美日韩一区二区| 久久婷婷成人综合色| 欧美精品粉嫩高潮一区二区| 91香蕉视频污在线| 成人网在线免费视频| 国产盗摄一区二区| 不卡欧美aaaaa| av不卡免费电影| 91同城在线观看| 欧美mv日韩mv国产网站app| 亚洲欧洲三级电影| 亚洲人妖av一区二区| 中文字幕日韩精品一区| 精品在线播放免费| 国产在线一区二区| 99精品欧美一区二区三区综合在线| k8久久久一区二区三区| 欧美成人精品二区三区99精品| 一区二区日韩电影| 婷婷激情综合网| 久久国产精品无码网站| 精品一区二区三区在线播放| 欧美视频一区二| 欧美一区二区精品在线| 久久男人中文字幕资源站| 亚洲欧洲日韩一区二区三区| 韩国女主播一区| 精品久久久久久久久久久久包黑料| 亚洲一区免费在线观看| 美女在线一区二区| 成人小视频免费在线观看| 精品乱人伦小说| 美日韩黄色大片| 91精品国产丝袜白色高跟鞋| 日日夜夜免费精品| 国产成人在线色| 久久午夜色播影院免费高清 | 欧美在线视频你懂得| 日韩久久免费av| 中文字幕一区二区三区四区不卡 | 欧美午夜精品免费| 亚洲电影一级片| 成人av综合一区| 国产精品视频第一区| 亚洲国产精品人人做人人爽| 精品亚洲欧美一区| 久久久亚洲欧洲日产国码αv| 国产一区在线不卡| 欧美丰满少妇xxxxx高潮对白 | 青青草原综合久久大伊人精品| 成人免费视频caoporn| 国产女主播一区| 久久精品国产色蜜蜜麻豆| 久久免费偷拍视频| 91在线精品一区二区三区| 一区二区三区高清在线| 欧美日韩一区二区三区不卡| 中文字幕+乱码+中文字幕一区| 五月天丁香久久| 欧美一区二区久久| 国产超碰在线一区| 久久精品亚洲国产奇米99| 日韩精品电影在线观看| 精品入口麻豆88视频| 福利电影一区二区| 亚洲电影一级片| 精品99999| 久久99久国产精品黄毛片色诱| 久久精品人人爽人人爽| 欧美吞精做爰啪啪高潮| 国产一区二区三区不卡在线观看 | 亚洲欧洲国产日韩| 欧美日韩成人一区二区| 亚洲国产精品一区二区久久| 日韩欧美123| 91麻豆免费看片| 美女脱光内衣内裤视频久久网站 | 欧美在线视频日韩| 国产精品一品视频| 亚洲不卡av一区二区三区| 国产日韩欧美一区二区三区乱码 | 亚洲精品日韩综合观看成人91| 成人黄页毛片网站| 日日夜夜精品免费视频| 国产精品女主播在线观看| 欧美高清视频不卡网| 日本道精品一区二区三区| 亚洲三级在线免费| 日韩一卡二卡三卡四卡| 国产成人精品免费| 丝袜美腿亚洲综合| 亚洲一区二区三区在线看| 国产精品美女久久久久aⅴ国产馆| 欧美嫩在线观看| 色94色欧美sute亚洲线路一ni| 国产一区二区三区四| 视频一区在线播放| 一区二区三区美女视频| 自拍偷拍国产精品| 国产农村妇女精品| 精品日本一线二线三线不卡| 777久久久精品| 欧美午夜精品理论片a级按摩| 99国产麻豆精品| 成人网在线免费视频| 国产成人自拍网| 国产精品69久久久久水密桃| 青青草91视频| 麻豆91在线看| 美国十次了思思久久精品导航| 天天做天天摸天天爽国产一区| 一区二区三区精品久久久| 亚洲欧美偷拍三级| 亚洲乱码中文字幕| 亚洲黄一区二区三区| 亚洲激情在线播放| 亚洲综合色视频| 亚洲福利国产精品| 丝袜美腿亚洲综合| 秋霞电影网一区二区| 麻豆精品久久久| 国产在线乱码一区二区三区| 国产一区999| gogo大胆日本视频一区| 成人av免费观看| 色综合天天天天做夜夜夜夜做| 国产精品久久久久影院老司| 欧美日本在线观看| 欧美精品日韩一区| 日韩欧美在线一区二区三区| 精品国产91乱码一区二区三区 | 视频在线观看一区二区三区| 日韩精品色哟哟| 久久国产夜色精品鲁鲁99| 激情六月婷婷综合| 国产精品综合在线视频| 懂色av一区二区夜夜嗨| 顶级嫩模精品视频在线看| 99久久伊人久久99| 欧美性xxxxx极品少妇| 日韩色在线观看| 国产精品妹子av| 亚洲午夜一区二区| 久久99久久99| 91老师国产黑色丝袜在线| 欧美日本乱大交xxxxx| 精品国产91洋老外米糕| 中文字幕亚洲电影| 日本aⅴ亚洲精品中文乱码| 国产一区二区在线视频| 99久久99久久精品免费观看| 精品视频一区二区三区免费| 日韩精品一区国产麻豆| 国产精品久久久久国产精品日日| 亚洲国产一区二区三区青草影视 | 国产91丝袜在线18| 精品视频一区二区不卡| 久久久久国产精品厨房| 亚洲一区在线观看视频| 国产aⅴ综合色| 欧美日韩黄色一区二区| 国产精品你懂的在线| 日韩国产在线观看| 日本亚洲一区二区| 粉嫩aⅴ一区二区三区四区| 欧美三级欧美一级| 国产日韩欧美电影| 日本麻豆一区二区三区视频| 成人av在线播放网址| 欧美一区午夜视频在线观看 | www.久久精品| 日韩欧美在线123| 一区二区三区中文字幕在线观看| 久久国产精品99久久人人澡| 91久久香蕉国产日韩欧美9色| 精品国产乱码91久久久久久网站| 亚洲一区二区三区精品在线| 成人午夜av影视| www国产亚洲精品久久麻豆| 亚洲成年人网站在线观看| 不卡的电视剧免费网站有什么| 欧美一二三区在线观看| 亚洲综合丁香婷婷六月香| www.成人在线| 日本一区二区三区国色天香| 国内不卡的二区三区中文字幕 | 久久精品国产久精国产| 欧美三级电影在线看| 91精品国产aⅴ一区二区| 国产精选一区二区三区| 91超碰这里只有精品国产| 亚洲欧美综合色| 国产一区二区三区四区五区入口 | 青娱乐精品视频| 欧美日韩精品久久久| 亚洲视频在线一区| 成人免费高清在线|