Unity3D中怎么判断一个物体是否超出相机照射范围?

1回答

Unity3D中怎么判断一个物体是否超出相机照射范围?

提问者 程序媛Adele 2015-04-30 346浏览

快来消灭0回答吧

{{ dataList.answer_count | view-format }}回答
  • asokawu 2015-05-04 14:43
    专家回答
    public bool IsVisibleFrom(Bounds bounds, Camera camera)   
    {       
         Plane[] planes = GeometryUtility.CalculateFrustumPlanes(camera);       
         return GeometryUtility.TestPlanesAABB(planes, bounds);   
    }

    Bound可以简单提供一个界限,比如:
    public Bounds VisualBounds
    {
        get
        {
            Bounds ret = new Bounds(mPos + 0.5f * cAvatarHeight * Vector3.up, new Vector3(cAvatarWidth, cAvatarHeight, cAvatarWidth));
            return ret;
        }
    }

    0评论
  • rajRKO 2017-06-21 15:51

    Most of the MP3 music downloader apps can be downloaded for free. However, the available apps are free to download MP3 music; you should remember that it doesn’t mean with copyright owner’s permission. free mp3 music The Free MP3 Music Downloader for Android is an application for Android to download and play some MP3 music from online websites.

    0评论
  • {{ answer.user.NickName }} {{ answer.profession }} {{ answer.created_at | time-format }}
    专家回答
    {{{ answer.answer }}}
    {{ answer.answer_count | view-format }}评论
加载中... 查看更多回答