游戏开发论坛

 找回密码
 立即注册
搜索
查看: 4528|回复: 6

Who can explane what is PVS

[复制链接]

26

主题

76

帖子

76

积分

注册会员

Rank: 2

积分
76
发表于 2003-10-10 07:46:00 | 显示全部楼层 |阅读模式
As title, plus How to implement.(I understand , but I do'nt intend interpret it "KNOW HOW",sorry

6

主题

29

帖子

29

积分

注册会员

Rank: 2

积分
29
发表于 2003-10-11 15:20:00 | 显示全部楼层

Re:Who can explane what is PVS

PVS = Potentially Visible Set

0

主题

1

帖子

0

积分

新手上路

Rank: 1

积分
0
发表于 2003-10-11 15:27:00 | 显示全部楼层

Re:Who can explane what is PVS

一种算法~~~~~~~~~~

60

主题

1319

帖子

1319

积分

金牌会员

Rank: 6Rank: 6

积分
1319
发表于 2003-10-11 16:16:00 | 显示全部楼层

Re:Who can explane what is PVS

Post-Vietnam Syndrome (美国越战退伍军人的)越战战后综合征

16

主题

76

帖子

105

积分

注册会员

Rank: 2

积分
105
发表于 2003-10-11 16:34:00 | 显示全部楼层

Re:Who can explane what is PVS

就是在bsp+portal的基础上进一步优化不可见物体的消隐。是一张表格的形式,存储通过portal可见的东西。

26

主题

76

帖子

76

积分

注册会员

Rank: 2

积分
76
 楼主| 发表于 2003-10-11 17:22:00 | 显示全部楼层

Re:Who can explan what is PVS

Quake technique test, Select a best answer.
1. What is PVS
(1).Possible Vison Set
(2).Post-Vietnam Syndrome
(3).Pigeon View Scens
2.How to represent that BSP's PVS data structure?
choose an answer, But numers are represent some value.
(1).0x8751
(2).00110101.....b
(3).1*8+20*8^2+3*8^3....
(4)."Object1","Object2"
3.What's name is BSP's algorithm.
(1).Parking
(2).Pork
(3).room door portaling
(4).Nurse treats patient


5

主题

31

帖子

31

积分

注册会员

Rank: 2

积分
31
发表于 2003-10-11 21:46:00 | 显示全部楼层

Re:Who can explane what is PVS

// link to PVS leafs
//PVS = Potentially Visible Set
SV_BuildEntityClusterList( ent );

--
//-----------------------------------------------------------------------------
// Purpose: Builds the cluster list for an entity
// Input  : *pEdict -
//-----------------------------------------------------------------------------
void SV_BuildEntityClusterList( edict_t *pEdict )
{
        int                i, j;
        int                topnode;
        int                leafCount;
        int                leafs[MAX_TOTAL_ENT_LEAFS], clusters[MAX_TOTAL_ENT_LEAFS];
        int                area;

        IServerEntity *serverEntity = pEdict->GetIServerEntity();
        Assert( serverEntity );
        if ( !serverEntity )
                return;

        pEdict->clusterCount = 0;
        topnode = -1;
        pEdict->areanum = 0;
        pEdict->areanum2 = 0;

        //get all leafs, including solids
        leafCount = CM_BoxLeafnums( serverEntity->GetAbsMins(), serverEntity->GetAbsMaxs(), leafs, MAX_TOTAL_ENT_LEAFS, &topnode );

        // set areas
        for ( i = 0; i < leafCount; i++ )
        {
                clusters = CM_LeafCluster( leafs );
                area = CM_LeafArea( leafs );
                if ( area )
                {        // doors may legally straggle two areas,
                        // but nothing should evern need more than that
                        if ( pEdict->areanum && pEdict->areanum != area )
                        {
                                if ( pEdict->areanum2 && pEdict->areanum2 != area && sv.state == ss_loading )
                                {
                                        Con_DPrintf ("Object touching 3 areas at %f %f %f\n",
                                                serverEntity->GetAbsMins()[0], serverEntity->GetAbsMins()[1], serverEntity->GetAbsMins()[2]);
                                }
                                pEdict->areanum2 = area;
                        }
                        else
                        {
                                pEdict->areanum = area;
                        }
                }
        }

        pEdict->headnode = topnode;        // save headnode

        if ( leafCount >= MAX_TOTAL_ENT_LEAFS )
        {        // assume we missed some leafs, and mark by headnode
                pEdict->clusterCount = -1;
        }
        else
        {
                for ( i = 0; i < leafCount; i++ )
                {
                        if (clusters == -1)
                                continue;                // not a visible leaf

                        for ( j = 0; j < i; j++ )
                        {
                                if (clusters[j] == clusters)
                                        break;
                        }

                        if ( j == i )
                        {
                                if ( pEdict->clusterCount == MAX_ENT_CLUSTERS )
                                {        // assume we missed some leafs, and mark by headnode
                                        pEdict->clusterCount = -1;
                                        break;
                                }

                                pEdict->clusters[pEdict->clusterCount++] = clusters;
                        }
                }
        }
}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-5-11 03:49

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表