<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head lang="en">
	<title>UnrealWiki: Standard Unreal Object Definition</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<link rel="stylesheet" type="text/css" media="screen, print"
		href="shared/stylebase.structural.css">	
	<link rel="stylesheet" type="text/css" media="screen"
		href="shared/template-default.css">
	<link rel="stylesheet" type="text/css" media="screen"
		href="shared/styles.chblue.css">
	<link rel="stylesheet" type="text/css" media="print"
		href="shared/template-default-print.css">
	<!--[if IE 6]>
			<style>
			/* dirty hack for IE6. */
			#quickbar {
				position: absolute;
				}
			</style>
	<![endif]-->
  <link rel="start" href="http://wiki.beyondunreal.com/">
  <link rel="glossary"  href="http://wiki.beyondunreal.com/wiki/Terminology">
  <link rel="help"  href="http://wiki.beyondunreal.com/wiki/Using_The_Wiki">
<script type="text/javascript" src="shared/dhtml.js"></script>
<script type="text/javascript" src="shared/dhtml-menu.js"></script>
<style type="text/css">#dhtml-menu    { background: #eee; padding: 5px 0px; margin-right: -20px; border: 1px solid #888; border-left: 1px solid #ccc; border-top: 1px solid #ccc;  border-right: 1px solid #888; border-bottom: 1px solid #888 }
#dhtml-menu td { color: #000; font-family: Arial,Helvetica,sans-serif; font-size: 9pt; line-height: 13pt; padding: 1px 10px; cursor: default }
#dhtml-menu a  { color: #000; font-family: Arial,Helvetica,sans-serif; font-size: 9pt; line-height: 13pt; text-decoration: none }
#dhtml-menu tt { font-family: monospace; font-size: 9pt }
#dhtml-menu-separator { height: 1px; background: red }
#dhtml-menu-anchor { cursor: default }
</style>
<script type="text/javascript" src="shared/expandable.js"></script>
</head>
<body onLoad="menuInit(); document.cookie='page=Standard_Unreal_Object_Definition; path=/'" class="default">
<div id="scrolling"><!-- contains all except the fixed sidebar -->
<div id="topbar"  class="bar">
	<div class="righthalf">
		<form class="inline" method="post" action="/wiki" enctype="application/x-www-form-urlencoded"><input type="text" name="search"  size="20" /> <input type="submit" name="search" value="search" /></form>
	</div>
	<div class="lefthalf">
		<script type="text/javascript"><!--
			menuAlignRight = false;
		//--></script>
		<span><script type="text/javascript"><!--
 menuWriteAnchor("Quick Navigation") //--></script></span> | <a href="(start).html">Home Page</a> | <a href="recent-changes.html">Recent Changes</a> | <a href="http://wiki.beyondunreal.com/wiki?action=editprefs">Preferences</a>
	</div>
</div>

<div id="content"><!-- contains the title and article -->
	<h1 class='pagetitle'><a href="http://wiki.beyondunreal.com/wiki?back=Standard Unreal Object Definition">Standard Unreal Object Definition</a></h1>
	<div class="wiki"><p>The header file below is taken from the Publicly Released 432 Header Files, Component of the Engine, Inc. Folder. These files are downloaded from the Epic Games Website.</p>
<p>See <a href="standard-unreal-object-def1.html">/Discuss</a> to comment, debate, analyze, whatever.</p>
<hr class="thin"><h2><a name="0.1"></a>Tim Sweeney, UnObject Header File<br>Standard Unreal Object Definitions, Engine</h2>
<pre class="uscript"><span class="uscript-comment">/*=============================================================================
    UnObj.h: Standard Unreal object definitions.
    Copyright 1997-1999 Epic Games, Inc. All Rights Reserved.

    Revision history:
        * Created by Tim Sweeney
=============================================================================*/</span>

<span class="uscript-comment">/*----------------------------------------------------------------------------
    Forward declarations.
----------------------------------------------------------------------------*/</span>

<span class="uscript-comment">// All engine classes.</span>
<span class="uscript-keyword">class</span>       UBitmap<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>           UTexture<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>               UFont<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>       UPalette<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>       USound<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>       UMusic<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>       UPrimitive<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>           UMesh<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>           UModel<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>       UPolys<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>       ULevelBase<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>           ULevel<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>           UPendingLevel<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>       UPlayer<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>           UViewport<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>           UNetConnection<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>       UConsole<span class="uscript-operator">;</span>

<span class="uscript-comment">// Other classes.</span>
<span class="uscript-keyword">struct</span> FTextureInfo<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>  AActor<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>  ABrush<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>  FDecal<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>  ADecal<span class="uscript-operator">;</span>
<span class="uscript-keyword">class</span>  FScan<span class="uscript-operator">;</span>

<span class="uscript-comment">/*-----------------------------------------------------------------------------
    UBspNode.
-----------------------------------------------------------------------------*/</span>

<span class="uscript-comment">// Flags associated with a Bsp node.</span>
<span class="uscript-keyword">enum</span> EBspNodeFlags
<span class="uscript-operator">{</span>
    <span class="uscript-comment">// Flags.</span>
    NF_NotCsg           <span class="uscript-operator">=</span> <span class="uscript-number">0x01</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Node is not a Csg splitter, i.e. is a transparent poly.</span>
    NF_ShootThrough     <span class="uscript-operator">=</span> <span class="uscript-number">0x02</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Can shoot through (for projectile solid ops).</span>
    NF_NotVisBlocking   <span class="uscript-operator">=</span> <span class="uscript-number">0x04</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Node does not block visibility, i.e. is an invisible collision hull.</span>
    NF_PolyOccluded     <span class="uscript-operator">=</span> <span class="uscript-number">0x08</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Node's poly was occluded on the previously-drawn frame.</span>
    NF_BoxOccluded      <span class="uscript-operator">=</span> <span class="uscript-number">0x10</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Node's bounding box was occluded.</span>
    NF_BrightCorners    <span class="uscript-operator">=</span> <span class="uscript-number">0x10</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Temporary.</span>
    NF_IsNew            <span class="uscript-operator">=</span> <span class="uscript-number">0x20</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Editor: Node was newly-added.</span>
    NF_IsFront          <span class="uscript-operator">=</span> <span class="uscript-number">0x40</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Filter operation bounding-sphere precomputed and guaranteed to be front.</span>
    NF_IsBack           <span class="uscript-operator">=</span> <span class="uscript-number">0x80</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Guaranteed back.</span>

    <span class="uscript-comment">// Combinations of flags.</span>
    NF_NeverMove        <span class="uscript-operator">=</span> <span class="uscript-number">0</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Bsp cleanup must not move nodes with these tags.</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">//</span>
<span class="uscript-comment">// Identifies a unique convex volume in the world.</span>
<span class="uscript-comment">//</span>
<span class="uscript-keyword">struct</span> ENGINE_API FPointRegion
<span class="uscript-operator">{</span>
    <span class="uscript-comment">// Variables.</span>
    <span class="uscript-keyword">class</span> AZoneInfo<span class="uscript-operator">*</span> Zone<span class="uscript-operator">;</span>          <span class="uscript-comment">// Zone actor.</span>
    <span class="uscript-type">INT</span>              iLeaf<span class="uscript-operator">;</span>         <span class="uscript-comment">// Bsp leaf.</span>
    <span class="uscript-type">BYTE</span>             ZoneNumber<span class="uscript-operator">;</span>    <span class="uscript-comment">// Zone number.</span>

    <span class="uscript-comment">// Constructors.</span>
    FPointRegion<span class="uscript-operator">(</span><span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span><span class="uscript-operator">}</span>
    FPointRegion<span class="uscript-operator">(</span> <span class="uscript-keyword">class</span> AZoneInfo<span class="uscript-operator">*</span> InLevel <span class="uscript-operator">)</span>
    :   Zone<span class="uscript-operator">(</span>InLevel<span class="uscript-operator">)</span><span class="uscript-operator">,</span> iLeaf<span class="uscript-operator">(</span>INDEX_NONE<span class="uscript-operator">)</span><span class="uscript-operator">,</span> ZoneNumber<span class="uscript-operator">(</span><span class="uscript-number">0</span><span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span><span class="uscript-operator">}</span>
    FPointRegion<span class="uscript-operator">(</span> <span class="uscript-keyword">class</span> AZoneInfo<span class="uscript-operator">*</span> InZone<span class="uscript-operator">,</span> <span class="uscript-type">INT</span> InLeaf<span class="uscript-operator">,</span> <span class="uscript-type">BYTE</span> InZoneNumber <span class="uscript-operator">)</span>
    :   Zone<span class="uscript-operator">(</span>InZone<span class="uscript-operator">)</span><span class="uscript-operator">,</span> iLeaf<span class="uscript-operator">(</span>InLeaf<span class="uscript-operator">)</span><span class="uscript-operator">,</span> ZoneNumber<span class="uscript-operator">(</span>InZoneNumber<span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span><span class="uscript-operator">}</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">//</span>
<span class="uscript-comment">// FBspNode defines one node in the Bsp, including the front and back</span>
<span class="uscript-comment">// pointers and the polygon data itself.  A node may have 0 or 3 to (MAX_NODE_VERTICES-1)</span>
<span class="uscript-comment">// vertices. If the node has zero vertices, it's only used for splitting and</span>
<span class="uscript-comment">// doesn't contain a polygon (this happens in the editor).</span>
<span class="uscript-comment">//</span>
<span class="uscript-comment">// vNormal, vTextureU, vTextureV, and others are indices into the level's</span>
<span class="uscript-comment">// vector table.  iFront,iBack should be INDEX_NONE to indicate no children.</span>
<span class="uscript-comment">//</span>
<span class="uscript-comment">// If iPlane==INDEX_NONE, a node has no coplanars.  Otherwise iPlane</span>
<span class="uscript-comment">// is an index to a coplanar polygon in the Bsp.  All polygons that are iPlane</span>
<span class="uscript-comment">// children can only have iPlane children themselves, not fronts or backs.</span>
<span class="uscript-comment">//</span>
<span class="uscript-keyword">class</span> FBspNode <span class="uscript-comment">// 64 bytes</span>
<span class="uscript-operator">{</span>
public:
    <span class="uscript-keyword">enum</span> <span class="uscript-operator">{</span>MAX_NODE_VERTICES<span class="uscript-operator">=</span><span class="uscript-number">16</span><span class="uscript-operator">}</span><span class="uscript-operator">;</span>    <span class="uscript-comment">// Max vertices in a Bsp node, pre clipping.</span>
    <span class="uscript-keyword">enum</span> <span class="uscript-operator">{</span>MAX_FINAL_VERTICES<span class="uscript-operator">=</span><span class="uscript-number">24</span><span class="uscript-operator">}</span><span class="uscript-operator">;</span>   <span class="uscript-comment">// Max vertices in a Bsp node, post clipping.</span>
    <span class="uscript-keyword">enum</span> <span class="uscript-operator">{</span>MAX_ZONES<span class="uscript-operator">=</span><span class="uscript-number">64</span><span class="uscript-operator">}</span><span class="uscript-operator">;</span>            <span class="uscript-comment">// Max zones per level.</span>

    <span class="uscript-comment">// Persistent information.</span>
    FPlane          Plane<span class="uscript-operator">;</span>          <span class="uscript-comment">// 16 Plane the node falls into (X, Y, Z, W).</span>
    QWORD           ZoneMask<span class="uscript-operator">;</span>       <span class="uscript-comment">// 8  Bit mask for all zones at or below this node (up to 64).</span>
    <span class="uscript-type">INT</span>             iVertPool<span class="uscript-operator">;</span>      <span class="uscript-comment">// 4  Index of first vertex in vertex pool, =iTerrain if NumVertices==0 and NF_TerrainFront.</span>
    <span class="uscript-type">INT</span>             iSurf<span class="uscript-operator">;</span>          <span class="uscript-comment">// 4  Index to surface information.</span>

    <span class="uscript-comment">// iBack:  4  Index to node in front (in direction of Normal).</span>
    <span class="uscript-comment">// iFront: 4  Index to node in back  (opposite direction as Normal).</span>
    <span class="uscript-comment">// iPlane: 4  Index to next coplanar poly in coplanar list.</span>
    union <span class="uscript-operator">{</span> <span class="uscript-type">INT</span> iBack<span class="uscript-operator">;</span> <span class="uscript-type">INT</span> iChild<span class="uscript-operator">[</span><span class="uscript-number">1</span><span class="uscript-operator">]</span><span class="uscript-operator">;</span> <span class="uscript-operator">}</span><span class="uscript-operator">;</span>
            <span class="uscript-type">INT</span> iFront<span class="uscript-operator">;</span>
            <span class="uscript-type">INT</span> iPlane<span class="uscript-operator">;</span>

    <span class="uscript-type">INT</span>             iCollisionBound<span class="uscript-operator">;</span><span class="uscript-comment">// 4  Collision bound.</span>
    <span class="uscript-type">INT</span>             iRenderBound<span class="uscript-operator">;</span>   <span class="uscript-comment">// 4  Rendering bound.</span>
    <span class="uscript-type">BYTE</span>            iZone<span class="uscript-operator">[</span><span class="uscript-number">2</span><span class="uscript-operator">]</span><span class="uscript-operator">;</span>       <span class="uscript-comment">// 2  Visibility zone in 1=front, 0=back.</span>
    <span class="uscript-type">BYTE</span>            NumVertices<span class="uscript-operator">;</span>    <span class="uscript-comment">// 1  Number of vertices in node.</span>
    <span class="uscript-type">BYTE</span>            NodeFlags<span class="uscript-operator">;</span>      <span class="uscript-comment">// 1  Node flags.</span>
    <span class="uscript-type">INT</span>             iLeaf<span class="uscript-operator">[</span><span class="uscript-number">2</span><span class="uscript-operator">]</span><span class="uscript-operator">;</span>       <span class="uscript-comment">// 8  Leaf in back and front, INDEX_NONE=not a leaf.</span>

    <span class="uscript-comment">// Functions.</span>
    UBOOL IsCsg<span class="uscript-operator">(</span> DWORD ExtraFlags<span class="uscript-operator">=</span><span class="uscript-number">0</span> <span class="uscript-operator">)</span> <span class="uscript-keyword">const</span>
    <span class="uscript-operator">{</span>
        <span class="uscript-keyword">return</span> <span class="uscript-operator">(</span>NumVertices<span class="uscript-operator">&gt;</span><span class="uscript-number">0</span><span class="uscript-operator">)</span> <span class="uscript-operator">&amp;&amp;</span> <span class="uscript-operator">!</span><span class="uscript-operator">(</span>NodeFlags <span class="uscript-operator">&amp;</span> <span class="uscript-operator">(</span>NF_IsNew <span class="uscript-operator">|</span> NF_NotCsg <span class="uscript-operator">|</span> ExtraFlags<span class="uscript-operator">)</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span>
    <span class="uscript-operator">}</span>
    UBOOL ChildOutside<span class="uscript-operator">(</span> <span class="uscript-type">INT</span> iChild<span class="uscript-operator">,</span> UBOOL Outside<span class="uscript-operator">,</span> DWORD ExtraFlags<span class="uscript-operator">=</span><span class="uscript-number">0</span> <span class="uscript-operator">)</span> <span class="uscript-keyword">const</span>
    <span class="uscript-operator">{</span>
        <span class="uscript-keyword">return</span> iChild ? <span class="uscript-operator">(</span>Outside <span class="uscript-operator">||</span> IsCsg<span class="uscript-operator">(</span>ExtraFlags<span class="uscript-operator">)</span><span class="uscript-operator">)</span> : <span class="uscript-operator">(</span>Outside <span class="uscript-operator">&amp;&amp;</span> <span class="uscript-operator">!</span>IsCsg<span class="uscript-operator">(</span>ExtraFlags<span class="uscript-operator">)</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span>
    <span class="uscript-operator">}</span>
    ENGINE_API friend FArchive<span class="uscript-operator">&amp;</span> <span class="uscript-keyword">operator</span><span class="uscript-operator">&lt;&lt;</span><span class="uscript-operator">(</span> FArchive<span class="uscript-operator">&amp;</span> Ar<span class="uscript-operator">,</span> FBspNode<span class="uscript-operator">&amp;</span> N <span class="uscript-operator">)</span><span class="uscript-operator">;</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">//</span>
<span class="uscript-comment">// Properties of a zone.</span>
<span class="uscript-comment">//</span>
<span class="uscript-keyword">class</span> ENGINE_API FZoneProperties
<span class="uscript-operator">{</span>
public:
    <span class="uscript-comment">// Variables.</span>
    AZoneInfo<span class="uscript-operator">*</span>  ZoneActor<span class="uscript-operator">;</span>      <span class="uscript-comment">// Optional actor defining the zone's property.</span>
    <span class="uscript-type">FLOAT</span>       LastRenderTime<span class="uscript-operator">;</span> <span class="uscript-comment">// Most recent level TimeSeconds when rendered.</span>
    QWORD       Connectivity<span class="uscript-operator">;</span>   <span class="uscript-comment">// (Connect[i]&amp;(1&lt;&lt;j))==1 if zone i is adjacent to zone j.</span>
    QWORD       Visibility<span class="uscript-operator">;</span>     <span class="uscript-comment">// (Connect[i]&amp;(1&lt;&lt;j))==1 if zone i can see zone j.</span>

    <span class="uscript-comment">// Serializer.</span>
    friend FArchive<span class="uscript-operator">&amp;</span> <span class="uscript-keyword">operator</span><span class="uscript-operator">&lt;&lt;</span><span class="uscript-operator">(</span> FArchive<span class="uscript-operator">&amp;</span> Ar<span class="uscript-operator">,</span> FZoneProperties<span class="uscript-operator">&amp;</span> P <span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span>
        guard<span class="uscript-operator">(</span>FZoneProperties<span class="uscript-operator">&lt;&lt;</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span>
        <span class="uscript-keyword">return</span> Ar <span class="uscript-operator">&lt;&lt;</span> <span class="uscript-operator">*</span><span class="uscript-operator">(</span>UObject<span class="uscript-operator">*</span><span class="uscript-operator">*</span><span class="uscript-operator">)</span><span class="uscript-operator">&amp;</span>P<span class="uscript-operator">.</span>ZoneActor <span class="uscript-operator">&lt;&lt;</span> P<span class="uscript-operator">.</span>Connectivity <span class="uscript-operator">&lt;&lt;</span> P<span class="uscript-operator">.</span>Visibility<span class="uscript-operator">;</span>
        Ar <span class="uscript-operator">&lt;&lt;</span> P<span class="uscript-operator">.</span>LastRenderTime<span class="uscript-operator">;</span>
        unguard<span class="uscript-operator">;</span>
    <span class="uscript-operator">}</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">/*-----------------------------------------------------------------------------
    UBspLeaves.
-----------------------------------------------------------------------------*/</span>

<span class="uscript-comment">//</span>
<span class="uscript-comment">// Information about a convex volume.</span>
<span class="uscript-comment">//</span>
<span class="uscript-keyword">class</span> FLeaf
<span class="uscript-operator">{</span>
public:
    <span class="uscript-comment">// Variables.</span>
    <span class="uscript-type">INT</span> iZone<span class="uscript-operator">;</span>          <span class="uscript-comment">// The zone this convex volume is in.</span>
    <span class="uscript-type">INT</span> iPermeating<span class="uscript-operator">;</span>    <span class="uscript-comment">// Lights permeating this volume considering shadowing.</span>
    <span class="uscript-type">INT</span> iVolumetric<span class="uscript-operator">;</span>    <span class="uscript-comment">// Volumetric lights hitting this region, no shadowing.</span>
    QWORD VisibleZones<span class="uscript-operator">;</span> <span class="uscript-comment">// Bit mask of visible zones from this convex volume.</span>

    <span class="uscript-comment">// Functions.</span>
    FLeaf<span class="uscript-operator">(</span><span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span><span class="uscript-operator">}</span>
    FLeaf<span class="uscript-operator">(</span> <span class="uscript-type">INT</span> iInZone<span class="uscript-operator">,</span> <span class="uscript-type">INT</span> InPermeating<span class="uscript-operator">,</span> <span class="uscript-type">INT</span> InVolumetric<span class="uscript-operator">,</span> QWORD InVisibleZones <span class="uscript-operator">)</span>
    :   iZone<span class="uscript-operator">(</span>iInZone<span class="uscript-operator">)</span><span class="uscript-operator">,</span> iPermeating<span class="uscript-operator">(</span>InPermeating<span class="uscript-operator">)</span><span class="uscript-operator">,</span> iVolumetric<span class="uscript-operator">(</span>InVolumetric<span class="uscript-operator">)</span><span class="uscript-operator">,</span> VisibleZones<span class="uscript-operator">(</span>InVisibleZones<span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span><span class="uscript-operator">}</span>
    friend FArchive<span class="uscript-operator">&amp;</span> <span class="uscript-keyword">operator</span><span class="uscript-operator">&lt;&lt;</span><span class="uscript-operator">(</span> FArchive<span class="uscript-operator">&amp;</span> Ar<span class="uscript-operator">,</span> FLeaf<span class="uscript-operator">&amp;</span> L <span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span>
        guard<span class="uscript-operator">(</span>FLeaf<span class="uscript-operator">&lt;&lt;</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span>
        <span class="uscript-keyword">return</span> Ar <span class="uscript-operator">&lt;&lt;</span> AR_INDEX<span class="uscript-operator">(</span>L<span class="uscript-operator">.</span>iZone<span class="uscript-operator">)</span> <span class="uscript-operator">&lt;&lt;</span> AR_INDEX<span class="uscript-operator">(</span>L<span class="uscript-operator">.</span>iPermeating<span class="uscript-operator">)</span> <span class="uscript-operator">&lt;&lt;</span> AR_INDEX<span class="uscript-operator">(</span>L<span class="uscript-operator">.</span>iVolumetric<span class="uscript-operator">)</span> <span class="uscript-operator">&lt;&lt;</span> L<span class="uscript-operator">.</span>VisibleZones<span class="uscript-operator">;</span>
        unguard<span class="uscript-operator">;</span>
    <span class="uscript-operator">}</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">/*-----------------------------------------------------------------------------
    UBspSurf.
-----------------------------------------------------------------------------*/</span>

<span class="uscript-comment">//</span>
<span class="uscript-comment">// One Bsp polygon.  Lists all of the properties associated with the</span>
<span class="uscript-comment">// polygon's plane.  Does not include a point list; the actual points</span>
<span class="uscript-comment">// are stored along with Bsp nodes, since several nodes which lie in the</span>
<span class="uscript-comment">// same plane may reference the same poly.</span>
<span class="uscript-comment">//</span>
<span class="uscript-keyword">class</span> FBspSurf
<span class="uscript-operator">{</span>
public:

    <span class="uscript-comment">// Persistent info.</span>
    UTexture<span class="uscript-operator">*</span>   Texture<span class="uscript-operator">;</span>        <span class="uscript-comment">// 4 Texture map.</span>
    DWORD       PolyFlags<span class="uscript-operator">;</span>      <span class="uscript-comment">// 4 Polygon flags.</span>
    <span class="uscript-type">INT</span>         pBase<span class="uscript-operator">;</span>          <span class="uscript-comment">// 4 Polygon &amp; texture base point index (where U,V==0,0).</span>
    <span class="uscript-type">INT</span>         vNormal<span class="uscript-operator">;</span>        <span class="uscript-comment">// 4 Index to polygon normal.</span>
    <span class="uscript-type">INT</span>         vTextureU<span class="uscript-operator">;</span>      <span class="uscript-comment">// 4 Texture U-vector index.</span>
    <span class="uscript-type">INT</span>         vTextureV<span class="uscript-operator">;</span>      <span class="uscript-comment">// 4 Texture V-vector index.</span>
    <span class="uscript-type">INT</span>         iLightMap<span class="uscript-operator">;</span>      <span class="uscript-comment">// 4 Light mesh.</span>
    <span class="uscript-type">INT</span>         iBrushPoly<span class="uscript-operator">;</span>     <span class="uscript-comment">// 4 Editor brush polygon index.</span>
    SWORD       PanU<span class="uscript-operator">;</span>           <span class="uscript-comment">// 2 U-Panning value.</span>
    SWORD       PanV<span class="uscript-operator">;</span>           <span class="uscript-comment">// 2 V-Panning value.</span>
    ABrush<span class="uscript-operator">*</span>     Actor<span class="uscript-operator">;</span>          <span class="uscript-comment">// 4 Brush actor owning this Bsp surface.</span>
    TArray<span class="uscript-operator">&lt;</span>FDecal<span class="uscript-operator">&gt;</span>  Decals<span class="uscript-operator">;</span>     <span class="uscript-comment">// 12 Array decals on this surface</span>
    TArray<span class="uscript-operator">&lt;</span><span class="uscript-type">INT</span><span class="uscript-operator">&gt;</span> Nodes<span class="uscript-operator">;</span>          <span class="uscript-comment">// 12 Nodes which make up this surface</span>

    <span class="uscript-comment">// Functions.</span>
    ENGINE_API friend FArchive<span class="uscript-operator">&amp;</span> <span class="uscript-keyword">operator</span><span class="uscript-operator">&lt;&lt;</span><span class="uscript-operator">(</span> FArchive<span class="uscript-operator">&amp;</span> Ar<span class="uscript-operator">,</span> FBspSurf<span class="uscript-operator">&amp;</span> Surf <span class="uscript-operator">)</span><span class="uscript-operator">;</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">// Flags describing effects and properties of a Bsp polygon.</span>
<span class="uscript-keyword">enum</span> EPolyFlags
<span class="uscript-operator">{</span>
    <span class="uscript-comment">// Regular in-game flags.</span>
    PF_Invisible        <span class="uscript-operator">=</span> <span class="uscript-number">0x00000001</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Poly is invisible.</span>
    PF_Masked           <span class="uscript-operator">=</span> <span class="uscript-number">0x00000002</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Poly should be drawn masked.</span>
    PF_Translucent      <span class="uscript-operator">=</span> <span class="uscript-number">0x00000004</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Poly is transparent.</span>
    PF_NotSolid         <span class="uscript-operator">=</span> <span class="uscript-number">0x00000008</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Poly is not solid, doesn't block.</span>
    PF_Environment      <span class="uscript-operator">=</span> <span class="uscript-number">0x00000010</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Poly should be drawn environment mapped.</span>
    PF_ForceViewZone    <span class="uscript-operator">=</span> <span class="uscript-number">0x00000010</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Force current iViewZone in OccludeBSP (reuse Environment flag)</span>
    PF_Semisolid        <span class="uscript-operator">=</span> <span class="uscript-number">0x00000020</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Poly is semi-solid = collision solid, Csg nonsolid.</span>
    PF_Modulated        <span class="uscript-operator">=</span> <span class="uscript-number">0x00000040</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Modulation transparency.</span>
    PF_FakeBackdrop     <span class="uscript-operator">=</span> <span class="uscript-number">0x00000080</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Poly looks exactly like backdrop.</span>
    PF_TwoSided         <span class="uscript-operator">=</span> <span class="uscript-number">0x00000100</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Poly is visible from both sides.</span>
    PF_AutoUPan         <span class="uscript-operator">=</span> <span class="uscript-number">0x00000200</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Automatically pans in U direction.</span>
    PF_AutoVPan         <span class="uscript-operator">=</span> <span class="uscript-number">0x00000400</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Automatically pans in V direction.</span>
    PF_NoSmooth         <span class="uscript-operator">=</span> <span class="uscript-number">0x00000800</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Don't smooth textures.</span>
    PF_BigWavy          <span class="uscript-operator">=</span> <span class="uscript-number">0x00001000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Poly has a big wavy pattern in it.</span>
    PF_SpecialPoly      <span class="uscript-operator">=</span> <span class="uscript-number">0x00001000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Game-specific poly-level render control (reuse BigWavy flag)</span>
    PF_SmallWavy        <span class="uscript-operator">=</span> <span class="uscript-number">0x00002000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Small wavy pattern (for water/enviro reflection).</span>
    PF_Flat             <span class="uscript-operator">=</span> <span class="uscript-number">0x00004000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Flat surface.</span>
    PF_LowShadowDetail  <span class="uscript-operator">=</span> <span class="uscript-number">0x00008000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Low detaul shadows.</span>
    PF_NoMerge          <span class="uscript-operator">=</span> <span class="uscript-number">0x00010000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Don't merge poly's nodes before lighting when rendering.</span>
    PF_CloudWavy        <span class="uscript-operator">=</span> <span class="uscript-number">0x00020000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Polygon appears wavy like clouds.</span>
    PF_DirtyShadows     <span class="uscript-operator">=</span> <span class="uscript-number">0x00040000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Dirty shadows.</span>
    PF_BrightCorners    <span class="uscript-operator">=</span> <span class="uscript-number">0x00080000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Brighten convex corners.</span>
    PF_SpecialLit       <span class="uscript-operator">=</span> <span class="uscript-number">0x00100000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Only speciallit lights apply to this poly.</span>
    PF_Gouraud          <span class="uscript-operator">=</span> <span class="uscript-number">0x00200000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Gouraud shaded.</span>
    PF_NoBoundRejection <span class="uscript-operator">=</span> <span class="uscript-number">0x00200000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Disable bound rejection in OccludeBSP (reuse Gourard flag)</span>
    PF_Unlit            <span class="uscript-operator">=</span> <span class="uscript-number">0x00400000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Unlit.</span>
    PF_HighShadowDetail <span class="uscript-operator">=</span> <span class="uscript-number">0x00800000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// High detail shadows.</span>
    PF_Portal           <span class="uscript-operator">=</span> <span class="uscript-number">0x04000000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Portal between iZones.</span>
    PF_Mirrored         <span class="uscript-operator">=</span> <span class="uscript-number">0x08000000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Reflective surface.</span>

    <span class="uscript-comment">// Editor flags.</span>
    PF_Memorized        <span class="uscript-operator">=</span> <span class="uscript-number">0x01000000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Editor: Poly is remembered.</span>
    PF_Selected         <span class="uscript-operator">=</span> <span class="uscript-number">0x02000000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Editor: Poly is selected.</span>
    PF_Highlighted      <span class="uscript-operator">=</span> <span class="uscript-number">0x10000000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Editor: Poly is highlighted.   </span>
    PF_FlatShaded       <span class="uscript-operator">=</span> <span class="uscript-number">0x40000000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// FPoly has been split by SplitPolyWithPlane.   </span>

    <span class="uscript-comment">// Internal.</span>
    PF_EdProcessed      <span class="uscript-operator">=</span> <span class="uscript-number">0x40000000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// FPoly was already processed in editorBuildFPolys.</span>
    PF_EdCut            <span class="uscript-operator">=</span> <span class="uscript-number">0x80000000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// FPoly has been split by SplitPolyWithPlane.  </span>
    PF_RenderFog        <span class="uscript-operator">=</span> <span class="uscript-number">0x40000000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Render with fogmapping.</span>
    PF_Occlude          <span class="uscript-operator">=</span> <span class="uscript-number">0x80000000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Occludes even if PF_NoOcclude.</span>
    PF_RenderHint       <span class="uscript-operator">=</span> <span class="uscript-number">0x01000000</span><span class="uscript-operator">,</span>   <span class="uscript-comment">// Rendering optimization hint.</span>

    <span class="uscript-comment">// Combinations of flags.</span>
    PF_NoOcclude        <span class="uscript-operator">=</span> PF_Masked <span class="uscript-operator">|</span> PF_Translucent <span class="uscript-operator">|</span> PF_Invisible <span class="uscript-operator">|</span> PF_Modulated<span class="uscript-operator">,</span>
    PF_NoEdit           <span class="uscript-operator">=</span> PF_Memorized <span class="uscript-operator">|</span> PF_Selected <span class="uscript-operator">|</span> PF_EdProcessed <span class="uscript-operator">|</span> PF_NoMerge <span class="uscript-operator">|</span> PF_EdCut<span class="uscript-operator">,</span>
    PF_NoImport         <span class="uscript-operator">=</span> PF_NoEdit <span class="uscript-operator">|</span> PF_NoMerge <span class="uscript-operator">|</span> PF_Memorized <span class="uscript-operator">|</span> PF_Selected <span class="uscript-operator">|</span> PF_EdProcessed <span class="uscript-operator">|</span> PF_EdCut<span class="uscript-operator">,</span>
    PF_AddLast          <span class="uscript-operator">=</span> PF_Semisolid <span class="uscript-operator">|</span> PF_NotSolid<span class="uscript-operator">,</span>
    PF_NoAddToBSP       <span class="uscript-operator">=</span> PF_EdCut <span class="uscript-operator">|</span> PF_EdProcessed <span class="uscript-operator">|</span> PF_Selected <span class="uscript-operator">|</span> PF_Memorized<span class="uscript-operator">,</span>
    PF_NoShadows        <span class="uscript-operator">=</span> PF_Unlit <span class="uscript-operator">|</span> PF_Invisible <span class="uscript-operator">|</span> PF_Environment <span class="uscript-operator">|</span> PF_FakeBackdrop<span class="uscript-operator">,</span>
    PF_Transient        <span class="uscript-operator">=</span> PF_Highlighted<span class="uscript-operator">,</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">/*-----------------------------------------------------------------------------
    FLightMapIndex.
-----------------------------------------------------------------------------*/</span>

<span class="uscript-comment">//</span>
<span class="uscript-comment">// A shadow occlusion mask.</span>
<span class="uscript-comment">//</span>
<span class="uscript-keyword">class</span> ENGINE_API FShadowMask
<span class="uscript-operator">{</span>
public:
    AActor<span class="uscript-operator">*</span> Owner<span class="uscript-operator">;</span>
    TArray<span class="uscript-operator">&lt;</span><span class="uscript-type">BYTE</span><span class="uscript-operator">&gt;</span> ShadowData<span class="uscript-operator">;</span>
    friend FArchive<span class="uscript-operator">&amp;</span> <span class="uscript-keyword">operator</span><span class="uscript-operator">&lt;&lt;</span><span class="uscript-operator">(</span> FArchive<span class="uscript-operator">&amp;</span> Ar<span class="uscript-operator">,</span> FShadowMask<span class="uscript-operator">&amp;</span> M <span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span>
        <span class="uscript-keyword">return</span> Ar <span class="uscript-operator">&lt;&lt;</span> <span class="uscript-operator">*</span><span class="uscript-operator">(</span>UObject<span class="uscript-operator">*</span><span class="uscript-operator">*</span><span class="uscript-operator">)</span><span class="uscript-operator">&amp;</span>M<span class="uscript-operator">.</span>Owner <span class="uscript-operator">&lt;&lt;</span> M<span class="uscript-operator">.</span>ShadowData<span class="uscript-operator">;</span>
    <span class="uscript-operator">}</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">//</span>
<span class="uscript-comment">// Describes the mesh-based lighting applied to a Bsp poly.</span>
<span class="uscript-comment">//</span>
<span class="uscript-keyword">class</span> ENGINE_API FLightMapIndex
<span class="uscript-operator">{</span>
public:
    <span class="uscript-type">INT</span>     DataOffset<span class="uscript-operator">;</span>
    <span class="uscript-type">INT</span>     iLightActors<span class="uscript-operator">;</span>
    FVector Pan<span class="uscript-operator">;</span>
    <span class="uscript-type">FLOAT</span>   UScale<span class="uscript-operator">,</span> VScale<span class="uscript-operator">;</span>
    <span class="uscript-type">INT</span>     UClamp<span class="uscript-operator">,</span> VClamp<span class="uscript-operator">;</span>
    <span class="uscript-type">BYTE</span>    UBits<span class="uscript-operator">,</span> VBits<span class="uscript-operator">;</span>
    friend FArchive<span class="uscript-operator">&amp;</span> <span class="uscript-keyword">operator</span><span class="uscript-operator">&lt;&lt;</span><span class="uscript-operator">(</span> FArchive<span class="uscript-operator">&amp;</span> Ar<span class="uscript-operator">,</span> FLightMapIndex<span class="uscript-operator">&amp;</span> I <span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span>
        guard<span class="uscript-operator">(</span>FLightMapIndex<span class="uscript-operator">&lt;&lt;</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span>
        Ar <span class="uscript-operator">&lt;&lt;</span> I<span class="uscript-operator">.</span>DataOffset<span class="uscript-operator">;</span>
        Ar <span class="uscript-operator">&lt;&lt;</span> I<span class="uscript-operator">.</span>Pan<span class="uscript-operator">;</span>
        Ar <span class="uscript-operator">&lt;&lt;</span> AR_INDEX<span class="uscript-operator">(</span>I<span class="uscript-operator">.</span>UClamp<span class="uscript-operator">)</span> <span class="uscript-operator">&lt;&lt;</span> AR_INDEX<span class="uscript-operator">(</span>I<span class="uscript-operator">.</span>VClamp<span class="uscript-operator">)</span><span class="uscript-operator">;</span>
        Ar <span class="uscript-operator">&lt;&lt;</span> I<span class="uscript-operator">.</span>UScale <span class="uscript-operator">&lt;&lt;</span> I<span class="uscript-operator">.</span>VScale<span class="uscript-operator">;</span>
        Ar <span class="uscript-operator">&lt;&lt;</span> I<span class="uscript-operator">.</span>iLightActors<span class="uscript-operator">;</span>
        <span class="uscript-keyword">return</span> Ar<span class="uscript-operator">;</span>
        unguard<span class="uscript-operator">;</span>
    <span class="uscript-operator">}</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">/*-----------------------------------------------------------------------------
    UPolys.
-----------------------------------------------------------------------------*/</span>

<span class="uscript-comment">// Results from FPoly.SplitWithPlane, describing the result of splitting</span>
<span class="uscript-comment">// an arbitrary FPoly with an arbitrary plane.</span>
<span class="uscript-keyword">enum</span> ESplitType
<span class="uscript-operator">{</span>
    SP_Coplanar     <span class="uscript-operator">=</span> <span class="uscript-number">0</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Poly wasn't split, but is coplanar with plane</span>
    SP_Front        <span class="uscript-operator">=</span> <span class="uscript-number">1</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Poly wasn't split, but is entirely in front of plane</span>
    SP_Back         <span class="uscript-operator">=</span> <span class="uscript-number">2</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Poly wasn't split, but is entirely in back of plane</span>
    SP_Split        <span class="uscript-operator">=</span> <span class="uscript-number">3</span><span class="uscript-operator">,</span> <span class="uscript-comment">// Poly was split into two new editor polygons</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">//</span>
<span class="uscript-comment">// A general-purpose polygon used by the editor.  An FPoly is a free-standing</span>
<span class="uscript-comment">// class which exists independently of any particular level, unlike the polys</span>
<span class="uscript-comment">// associated with Bsp nodes which rely on scads of other objects.  FPolys are</span>
<span class="uscript-comment">// used in UnrealEd for internal work, such as building the Bsp and performing</span>
<span class="uscript-comment">// boolean operations.</span>
<span class="uscript-comment">//</span>
<span class="uscript-keyword">class</span> ENGINE_API FPoly
<span class="uscript-operator">{</span>
public:
#<span class="uscript-keyword">if</span> <span class="uscript-number">0</span> <span class="uscript-comment">//WDM -- remove this...?</span>
    <span class="uscript-comment">// The changes to these values allow things like the 2D shape editor and brush clipping</span>
    <span class="uscript-comment">// to create large polys with many sides if they need to.</span>
    <span class="uscript-comment">//</span>
    <span class="uscript-keyword">enum</span> <span class="uscript-operator">{</span>MAX_VERTICES<span class="uscript-operator">=</span><span class="uscript-number">32</span><span class="uscript-operator">}</span><span class="uscript-operator">;</span> <span class="uscript-comment">// Maximum vertices an FPoly may have.</span>
#<span class="uscript-keyword">else</span>
    <span class="uscript-keyword">enum</span> <span class="uscript-operator">{</span>MAX_VERTICES<span class="uscript-operator">=</span><span class="uscript-number">16</span><span class="uscript-operator">}</span><span class="uscript-operator">;</span> <span class="uscript-comment">// Maximum vertices an FPoly may have.</span>
#endif
    <span class="uscript-keyword">enum</span> <span class="uscript-operator">{</span>VERTEX_THRESHOLD<span class="uscript-operator">=</span>MAX_VERTICES<span class="uscript-number">-2</span><span class="uscript-operator">}</span><span class="uscript-operator">;</span> <span class="uscript-comment">// Threshold for splitting into two.</span>

    FVector     Base<span class="uscript-operator">;</span>           <span class="uscript-comment">// Base point of polygon.</span>
    FVector     Normal<span class="uscript-operator">;</span>         <span class="uscript-comment">// Normal of polygon.</span>
    FVector     TextureU<span class="uscript-operator">;</span>       <span class="uscript-comment">// Texture U vector.</span>
    FVector     TextureV<span class="uscript-operator">;</span>       <span class="uscript-comment">// Texture V vector.</span>
    FVector     Vertex<span class="uscript-operator">[</span>MAX_VERTICES<span class="uscript-operator">]</span><span class="uscript-operator">;</span> <span class="uscript-comment">// Actual vertices.</span>
    DWORD       PolyFlags<span class="uscript-operator">;</span>      <span class="uscript-comment">// FPoly &amp; Bsp poly bit flags (PF_).</span>
    ABrush<span class="uscript-operator">*</span>     Actor<span class="uscript-operator">;</span>          <span class="uscript-comment">// Brush where this originated, or NULL.</span>
    UTexture<span class="uscript-operator">*</span>   Texture<span class="uscript-operator">;</span>        <span class="uscript-comment">// Texture map.</span>
    FName       ItemName<span class="uscript-operator">;</span>       <span class="uscript-comment">// Item name.</span>
    <span class="uscript-type">INT</span>         NumVertices<span class="uscript-operator">;</span>    <span class="uscript-comment">// Number of vertices.</span>
    <span class="uscript-type">INT</span>         iLink<span class="uscript-operator">;</span>          <span class="uscript-comment">// iBspSurf, or brush fpoly index of first identical polygon, or MAXWORD.</span>
    <span class="uscript-type">INT</span>         iBrushPoly<span class="uscript-operator">;</span>     <span class="uscript-comment">// Index of editor solid's polygon this originated from.</span>
    SWORD       PanU<span class="uscript-operator">,</span>PanV<span class="uscript-operator">;</span>      <span class="uscript-comment">// Texture panning values.</span>
    <span class="uscript-type">INT</span>         SavePolyIndex<span class="uscript-operator">;</span>  <span class="uscript-comment">// Used by multiple vertex editing to keep track of original PolyIndex into owner brush</span>
    UBOOL       bFaceDragSel<span class="uscript-operator">;</span>

    <span class="uscript-comment">// Custom functions.</span>
    void  Init              <span class="uscript-operator">(</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span>
    void  Reverse           <span class="uscript-operator">(</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span>
    void  SplitInHalf       <span class="uscript-operator">(</span>FPoly <span class="uscript-operator">*</span>OtherHalf<span class="uscript-operator">)</span><span class="uscript-operator">;</span>
    void  Transform         <span class="uscript-operator">(</span><span class="uscript-keyword">const</span> FModelCoords <span class="uscript-operator">&amp;</span>Coords<span class="uscript-operator">,</span> <span class="uscript-keyword">const</span> FVector <span class="uscript-operator">&amp;</span>PreSubtract<span class="uscript-operator">,</span><span class="uscript-keyword">const</span> FVector <span class="uscript-operator">&amp;</span>PostAdd<span class="uscript-operator">,</span> <span class="uscript-type">FLOAT</span> Orientation<span class="uscript-operator">)</span><span class="uscript-operator">;</span>
    <span class="uscript-type">int</span>   Fix               <span class="uscript-operator">(</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span>
    <span class="uscript-type">int</span>   CalcNormal        <span class="uscript-operator">(</span> UBOOL bSilent <span class="uscript-operator">=</span> <span class="uscript-number">0</span> <span class="uscript-operator">)</span><span class="uscript-operator">;</span>
    <span class="uscript-type">int</span>   SplitWithPlane    <span class="uscript-operator">(</span><span class="uscript-keyword">const</span> FVector <span class="uscript-operator">&amp;</span>Base<span class="uscript-operator">,</span><span class="uscript-keyword">const</span> FVector <span class="uscript-operator">&amp;</span>Normal<span class="uscript-operator">,</span>FPoly <span class="uscript-operator">*</span>FrontPoly<span class="uscript-operator">,</span>FPoly <span class="uscript-operator">*</span>BackPoly<span class="uscript-operator">,</span><span class="uscript-type">int</span> VeryPrecise<span class="uscript-operator">)</span> <span class="uscript-keyword">const</span><span class="uscript-operator">;</span>
    <span class="uscript-type">int</span>   SplitWithNode     <span class="uscript-operator">(</span><span class="uscript-keyword">const</span> UModel <span class="uscript-operator">*</span>Model<span class="uscript-operator">,</span><span class="uscript-type">INT</span> iNode<span class="uscript-operator">,</span>FPoly <span class="uscript-operator">*</span>FrontPoly<span class="uscript-operator">,</span>FPoly <span class="uscript-operator">*</span>BackPoly<span class="uscript-operator">,</span><span class="uscript-type">int</span> VeryPrecise<span class="uscript-operator">)</span> <span class="uscript-keyword">const</span><span class="uscript-operator">;</span>
    <span class="uscript-type">int</span>   SplitWithPlaneFast<span class="uscript-operator">(</span><span class="uscript-keyword">const</span> FPlane Plane<span class="uscript-operator">,</span>FPoly <span class="uscript-operator">*</span>FrontPoly<span class="uscript-operator">,</span>FPoly <span class="uscript-operator">*</span>BackPoly<span class="uscript-operator">)</span> <span class="uscript-keyword">const</span><span class="uscript-operator">;</span>
    <span class="uscript-type">int</span>   Split             <span class="uscript-operator">(</span><span class="uscript-keyword">const</span> FVector <span class="uscript-operator">&amp;</span>Normal<span class="uscript-operator">,</span> <span class="uscript-keyword">const</span> FVector <span class="uscript-operator">&amp;</span>Base<span class="uscript-operator">,</span> <span class="uscript-type">int</span> NoOverflow<span class="uscript-operator">=</span><span class="uscript-number">0</span> <span class="uscript-operator">)</span><span class="uscript-operator">;</span>
    <span class="uscript-type">int</span>   RemoveColinears   <span class="uscript-operator">(</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span>
    <span class="uscript-type">int</span>   Finalize          <span class="uscript-operator">(</span><span class="uscript-type">int</span> NoError<span class="uscript-operator">)</span><span class="uscript-operator">;</span>
    <span class="uscript-type">int</span>   Faces             <span class="uscript-operator">(</span><span class="uscript-keyword">const</span> FPoly <span class="uscript-operator">&amp;</span>Test<span class="uscript-operator">)</span> <span class="uscript-keyword">const</span><span class="uscript-operator">;</span>
    <span class="uscript-type">FLOAT</span> Area              <span class="uscript-operator">(</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span>

    <span class="uscript-comment">// Serializer.</span>
    ENGINE_API friend FArchive<span class="uscript-operator">&amp;</span> <span class="uscript-keyword">operator</span><span class="uscript-operator">&lt;&lt;</span><span class="uscript-operator">(</span> FArchive<span class="uscript-operator">&amp;</span> Ar<span class="uscript-operator">,</span> FPoly<span class="uscript-operator">&amp;</span> Poly <span class="uscript-operator">)</span><span class="uscript-operator">;</span>

    <span class="uscript-comment">// Inlines.</span>
    <span class="uscript-type">int</span> IsBackfaced<span class="uscript-operator">(</span> <span class="uscript-keyword">const</span> FVector <span class="uscript-operator">&amp;</span>Point <span class="uscript-operator">)</span> <span class="uscript-keyword">const</span>
        <span class="uscript-operator">{</span><span class="uscript-keyword">return</span> <span class="uscript-operator">(</span><span class="uscript-operator">(</span>Point<span class="uscript-operator">-</span>Base<span class="uscript-operator">)</span> <span class="uscript-operator">|</span> Normal<span class="uscript-operator">)</span> <span class="uscript-operator">&lt;</span> <span class="uscript-number">0</span><span class="uscript-operator">.</span>f<span class="uscript-operator">;</span><span class="uscript-operator">}</span>
    <span class="uscript-type">int</span> IsCoplanar<span class="uscript-operator">(</span> <span class="uscript-keyword">const</span> FPoly <span class="uscript-operator">&amp;</span>Test <span class="uscript-operator">)</span> <span class="uscript-keyword">const</span>
        <span class="uscript-operator">{</span><span class="uscript-keyword">return</span> Abs<span class="uscript-operator">(</span><span class="uscript-operator">(</span>Base <span class="uscript-operator">-</span> Test<span class="uscript-operator">.</span>Base<span class="uscript-operator">)</span><span class="uscript-operator">|</span>Normal<span class="uscript-operator">)</span><span class="uscript-operator">&lt;</span><span class="uscript-number">0</span><span class="uscript-operator">.</span>01f <span class="uscript-operator">&amp;&amp;</span> Abs<span class="uscript-operator">(</span>Normal<span class="uscript-operator">|</span>Test<span class="uscript-operator">.</span>Normal<span class="uscript-operator">)</span><span class="uscript-operator">&gt;</span><span class="uscript-number">0</span><span class="uscript-operator">.</span>9999f<span class="uscript-operator">;</span><span class="uscript-operator">}</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">//</span>
<span class="uscript-comment">// List of FPolys.</span>
<span class="uscript-comment">//</span>
<span class="uscript-keyword">class</span> ENGINE_API UPolys : public UObject
<span class="uscript-operator">{</span>
    DECLARE_CLASS<span class="uscript-operator">(</span>UPolys<span class="uscript-operator">,</span>UObject<span class="uscript-operator">,</span>CLASS_RuntimeStatic<span class="uscript-operator">,</span>Engine<span class="uscript-operator">)</span>

    <span class="uscript-comment">// Elements.</span>
    TTransArray<span class="uscript-operator">&lt;</span>FPoly<span class="uscript-operator">&gt;</span> Element<span class="uscript-operator">;</span>

    <span class="uscript-comment">// Constructors.</span>
    UPolys<span class="uscript-operator">(</span><span class="uscript-operator">)</span>
    : Element<span class="uscript-operator">(</span> this <span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span><span class="uscript-operator">}</span>

    <span class="uscript-comment">// UObject interface.</span>
    void Serialize<span class="uscript-operator">(</span> FArchive<span class="uscript-operator">&amp;</span> Ar <span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span>
        guard<span class="uscript-operator">(</span>UPolys::Serialize<span class="uscript-operator">)</span><span class="uscript-operator">;</span>
        <span class="uscript-keyword">Super</span>::Serialize<span class="uscript-operator">(</span> Ar <span class="uscript-operator">)</span><span class="uscript-operator">;</span>
        <span class="uscript-keyword">if</span><span class="uscript-operator">(</span> Ar<span class="uscript-operator">.</span>IsTrans<span class="uscript-operator">(</span><span class="uscript-operator">)</span> <span class="uscript-operator">)</span>
        <span class="uscript-operator">{</span>
            Ar <span class="uscript-operator">&lt;&lt;</span> Element<span class="uscript-operator">;</span>
        <span class="uscript-operator">}</span>
        <span class="uscript-keyword">else</span>
        <span class="uscript-operator">{</span>
            Element<span class="uscript-operator">.</span>CountBytes<span class="uscript-operator">(</span> Ar <span class="uscript-operator">)</span><span class="uscript-operator">;</span>
            <span class="uscript-type">INT</span> DbNum<span class="uscript-operator">=</span>Element<span class="uscript-operator">.</span>Num<span class="uscript-operator">(</span><span class="uscript-operator">)</span><span class="uscript-operator">,</span> DbMax<span class="uscript-operator">=</span>DbNum<span class="uscript-operator">;</span>
            Ar <span class="uscript-operator">&lt;&lt;</span> DbNum <span class="uscript-operator">&lt;&lt;</span> DbMax<span class="uscript-operator">;</span>
            <span class="uscript-keyword">if</span><span class="uscript-operator">(</span> Ar<span class="uscript-operator">.</span>IsLoading<span class="uscript-operator">(</span><span class="uscript-operator">)</span> <span class="uscript-operator">)</span>
            <span class="uscript-operator">{</span>
                Element<span class="uscript-operator">.</span>Empty<span class="uscript-operator">(</span> DbNum <span class="uscript-operator">)</span><span class="uscript-operator">;</span>
                Element<span class="uscript-operator">.</span>AddZeroed<span class="uscript-operator">(</span> DbNum <span class="uscript-operator">)</span><span class="uscript-operator">;</span>
            <span class="uscript-operator">}</span>
            <span class="uscript-keyword">for</span><span class="uscript-operator">(</span> <span class="uscript-type">INT</span> i<span class="uscript-operator">=</span><span class="uscript-number">0</span><span class="uscript-operator">;</span> i<span class="uscript-operator">&lt;</span>Element<span class="uscript-operator">.</span>Num<span class="uscript-operator">(</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span> i<span class="uscript-operator">++</span> <span class="uscript-operator">)</span>
                Ar <span class="uscript-operator">&lt;&lt;</span> Element<span class="uscript-operator">(</span>i<span class="uscript-operator">)</span><span class="uscript-operator">;</span>
        <span class="uscript-operator">}</span>
        unguard<span class="uscript-operator">;</span>
    <span class="uscript-operator">}</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">/*-----------------------------------------------------------------------------
    FVerts.
-----------------------------------------------------------------------------*/</span>

<span class="uscript-comment">//</span>
<span class="uscript-comment">// One vertex associated with a Bsp node's polygon.  Contains a vertex index</span>
<span class="uscript-comment">// into the level's FPoints table, and a unique number which is common to all</span>
<span class="uscript-comment">// other sides in the level which are cospatial with this side.</span>
<span class="uscript-comment">//</span>
<span class="uscript-keyword">class</span> FVert
<span class="uscript-operator">{</span>
public:
    <span class="uscript-comment">// Variables.</span>
    <span class="uscript-type">INT</span>     pVertex<span class="uscript-operator">;</span>    <span class="uscript-comment">// Index of vertex.</span>
    <span class="uscript-type">INT</span>     iSide<span class="uscript-operator">;</span>      <span class="uscript-comment">// If shared, index of unique side. Otherwise INDEX_NONE.</span>

    <span class="uscript-comment">// Functions.</span>
    friend FArchive<span class="uscript-operator">&amp;</span> <span class="uscript-keyword">operator</span><span class="uscript-operator">&lt;&lt;</span> <span class="uscript-operator">(</span>FArchive <span class="uscript-operator">&amp;</span>Ar<span class="uscript-operator">,</span> FVert <span class="uscript-operator">&amp;</span>Vert<span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span>
        guard<span class="uscript-operator">(</span>FVert<span class="uscript-operator">&lt;&lt;</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span>
        <span class="uscript-keyword">return</span> Ar <span class="uscript-operator">&lt;&lt;</span> AR_INDEX<span class="uscript-operator">(</span>Vert<span class="uscript-operator">.</span>pVertex<span class="uscript-operator">)</span> <span class="uscript-operator">&lt;&lt;</span> AR_INDEX<span class="uscript-operator">(</span>Vert<span class="uscript-operator">.</span>iSide<span class="uscript-operator">)</span><span class="uscript-operator">;</span>
        unguard<span class="uscript-operator">;</span>
    <span class="uscript-operator">}</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">/*-----------------------------------------------------------------------------
    FDecals.
-----------------------------------------------------------------------------*/</span>

<span class="uscript-comment">//</span>
<span class="uscript-comment">// Decal associated with a surface</span>
<span class="uscript-comment">//</span>
<span class="uscript-keyword">class</span> FDecal
<span class="uscript-operator">{</span>
public:
    <span class="uscript-comment">// Variables.</span>
    FVector Vertices<span class="uscript-operator">[</span><span class="uscript-number">4</span><span class="uscript-operator">]</span><span class="uscript-operator">;</span>    <span class="uscript-comment">// Vertices of decal on surface (offset from the surface base).</span>
    ADecal<span class="uscript-operator">*</span> Actor<span class="uscript-operator">;</span>          <span class="uscript-comment">// ADecal actor associated with this decal.</span>
    TArray<span class="uscript-operator">&lt;</span><span class="uscript-type">INT</span><span class="uscript-operator">&gt;</span> Nodes<span class="uscript-operator">;</span>      <span class="uscript-comment">// The FBspNode indices on which this decal lies.</span>

    <span class="uscript-comment">// Functions.</span>
    friend FArchive<span class="uscript-operator">&amp;</span> <span class="uscript-keyword">operator</span><span class="uscript-operator">&lt;&lt;</span> <span class="uscript-operator">(</span>FArchive <span class="uscript-operator">&amp;</span>Ar<span class="uscript-operator">,</span> FDecal <span class="uscript-operator">&amp;</span>Decal<span class="uscript-operator">)</span>
    <span class="uscript-operator">{</span>
        guard<span class="uscript-operator">(</span>FDecal<span class="uscript-operator">&lt;&lt;</span><span class="uscript-operator">)</span><span class="uscript-operator">;</span>
        <span class="uscript-keyword">if</span><span class="uscript-operator">(</span> <span class="uscript-operator">!</span>Ar<span class="uscript-operator">.</span>IsLoading<span class="uscript-operator">(</span><span class="uscript-operator">)</span> <span class="uscript-operator">&amp;&amp;</span> <span class="uscript-operator">!</span>Ar<span class="uscript-operator">.</span>IsSaving<span class="uscript-operator">(</span><span class="uscript-operator">)</span> <span class="uscript-operator">)</span>
            Ar <span class="uscript-operator">&lt;&lt;</span> <span class="uscript-operator">*</span><span class="uscript-operator">(</span>UObject<span class="uscript-operator">*</span><span class="uscript-operator">*</span><span class="uscript-operator">)</span><span class="uscript-operator">&amp;</span>Decal<span class="uscript-operator">.</span>Actor<span class="uscript-operator">;</span>
        <span class="uscript-keyword">return</span> Ar<span class="uscript-operator">;</span>
        unguard<span class="uscript-operator">;</span>
    <span class="uscript-operator">}</span>
<span class="uscript-operator">}</span><span class="uscript-operator">;</span>

<span class="uscript-comment">/*----------------------------------------------------------------------------
    The End.
----------------------------------------------------------------------------*/</span></pre><script type="text/javascript"><!--
 menuItemAdd("Tim Sweeney, UnObject Header File<br>Standard Unreal Object Definitions, Engine", "#0.1");
 menuWrite() //--></script></div>
</div>

<div id="footer" class="bar">
	<p><form method="post" action="http://wiki.beyondunreal.com/wiki" enctype="application/x-www-form-urlencoded">
<a href="(start).html">Home Page</a> | <a href="recent-changes.html">Recent Changes</a> | <a href="http://wiki.beyondunreal.com/wiki?action=editprefs">Preferences</a><br>
<a href="http://wiki.beyondunreal.com/wiki?action=edit&id=Standard_Unreal_Object_Definition">Edit text of this page</a> | <a href="http://wiki.beyondunreal.com/wiki?action=history&id=Standard_Unreal_Object_Definition">View other revisions</a><br>Last edited May 27, 2003 4:34 <a href="http://wiki.beyondunreal.com/wiki?action=browse&diff=1&id=Standard_Unreal_Object_Definition">(diff)</a><br>Search: <input type="text" name="search"  size="20" /><input type="hidden" name="dosearch" value="1"  /><br><br><small><a href="http://wiki.beyondunreal.com/wiki/Standard_Unreal_Object_Definition">Original page</a> &#150; copy created Sat, Jun 23, 2007</small><div></div>
</form>
	</p>
	<p>I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. (RegularX)
</p>
</div>
</div><!-- close of "scrolling" div -->

<div id="quickbar">
	<div id="logo"><a href="http://wiki.beyondunreal.com/"><img src="shared/wikilogo.jpg" width="143" height="100" border="0"></a>
		</div>
	<div class="qbsitename">
		<p>The Unreal Engine Documentation Site</p>
	</div>
	<div class="qbsection">
<p><a href="metatopics.html">Wiki Community</a>
</p>
<p><a href="category-category.html">Topic Categories</a>
</p>
<p><a href="/cgi-bin/imageupload.cgi/wiki-ext/imageupload.htt" target="_blank ">Image Uploads</a>
</p>
<p><a href="http://wiki.beyondunreal.com/wiki?action=random">Random Page</a>
</p>
<p><a href="recent-changes.html">Recent Changes</a>
</p>
<p><a href="offline-wiki.html">Offline Wiki</a>
</p>
</div><div class="qbsection">
<p><a href="unreal-engine.html">Unreal Engine</a>
</p>
<p><a href="console-commands.html">Console Commands</a>
</p>
<p><a href="terminology.html">Terminology</a>
</p>
<p><a href="category-faq.html">FAQs</a>
</p>
<p><a href="help-desk.html">Help Desk</a>
</p>
</div><div class="qbsection">
<p><a href="topics-on-mapping.html">Mapping Topics</a>
</p>
<p><a href="mapping-lessons.html">Mapping Lessons</a>
</p>
<p><a href="unrealed-3.html">UnrealEd Interface</a>
</p>
</div><div class="qbsection">
<p><a href="unrealscript.html">UnrealScript Topics</a>
</p>
<p><a href="unrealscript-lessons.html">UnrealScript Lessons</a>
</p>
<p><a href="making-mods.html">Making Mods</a>
</p>
<p><a href="class-tree.html">Class Tree</a>
</p>
</div><div class="qbsection">
<p><a href="topics-on-modeling.html">Modeling Topics</a>
</p>
</div><div class="qbsection">
<p><a href="chongqing-page.html">Chongqing Page</a>
</p>
<p><a href="log-in.html">Log In</a></p></div>
</div>

</body></html>