Показать сообщение отдельно
Старый 05.01.2013, 02:12   #34
Wegox
Бывалый
 
Аватар для Wegox
 
Регистрация: 17.12.2011
Сообщений: 862
Написано 443 полезных сообщений
(для 1,133 пользователей)
Ответ: Скрытие объектов за стенами

Сообщение от Arton Посмотреть сообщение
Порталом? Не понял? Поясни.

Но ведь разгрузка на полигоны в кадре есть.
Неужели этот код настолько неэффективен?
А что!? не портал что-ли
Function OccludeEntity(CurrentEntity.Entity,Camera)
; Now check if object is occluded or not...

If CurrentEntity\Occluded=False Then ; If entity already is occluded, then skip this...

For OccludeList.Occluder = Each Occluder
; Skip the occluder if it's out of the viewfrustum
If EntityInView(OccludeList\Mesh,Camera)=False Then Goto SkipThisOccluder
EntityHidden=True
For EdgeList.Edge = Each Edge
If OccludeList\ID = EdgeList\Parent Then
If EdgeList\Visible=True Then
If  ((EdgeList\PlaneNX#*EntityX#(CurrentEntity\Entity)+EdgeList\PlaneNY#*EntityY#(CurrentEntity\Entity)+EdgeList\PlaneNZ#*EntityZ#(CurrentEntity\Entity))-EdgeList\PlaneDist#+EntityList\Radius#)>-CurrentEntity\Radius#  Then
EntityHidden=False
EndIf
EndIf
EndIf
Next

If EntityHidden=True Then
CurrentEntity\Occluded=True
;EntityColor EntityList\Entity,255,0,0
ShowEntity CurrentEntity\Entity

Exit
Else
CurrentEntity\Occluded=False
HideEntity CurrentEntity\Entity

EndIf
.SkipThisOccluder
Next

EndIf
End Function
(Offline)
 
Ответить с цитированием