1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Castle Game Engine: CastleShapes</title>
<meta name="generator" content="PasDoc 0.13.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<table class="container"><tr><td class="navigation">
<h2>Castle Game Engine</h2><p><a href="introduction.html" class="navigation">Introduction</a></p><p><a href="AllUnits.html" class="navigation">Units</a></p><p><a href="ClassHierarchy.html" class="navigation">Class Hierarchy</a></p><p><a href="AllClasses.html" class="navigation">Classes, Interfaces, Objects and Records</a></p><p><a href="AllTypes.html" class="navigation">Types</a></p><p><a href="AllVariables.html" class="navigation">Variables</a></p><p><a href="AllConstants.html" class="navigation">Constants</a></p><p><a href="AllFunctions.html" class="navigation">Functions and Procedures</a></p><p><a href="AllIdentifiers.html" class="navigation">Identifiers</a></p></td><td class="content">
<h1 class="unit">Unit CastleShapes</h1>
<table class="sections wide_list">
<tr>
<td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Uses">Uses</a></td><td><a class="section" href="#PasDoc-Classes">Classes, Interfaces, Objects and Records</a></td><td>Functions and Procedures</td><td><a class="section" href="#PasDoc-Types">Types</a></td><td><a class="section" href="#PasDoc-Constants">Constants</a></td><td><a class="section" href="#PasDoc-Variables">Variables</a></td></tr></table>
<a name="PasDoc-Description"></a><h2 class="description">Description</h2>
<p>
Shape (<a class="normal" href="CastleShapes.TShape.html">TShape</a> class) and a simple tree of shapes (<a class="normal" href="CastleShapes.TShapeTree.html">TShapeTree</a> class).</p>
<a name="PasDoc-Uses"></a><h2 class="uses">Uses</h2>
<ul class="useslist"><li>SysUtils</li><li>Classes</li><li><a href="CastleVectors.html">CastleVectors</a></li><li><a href="Castle3D.html">Castle3D</a></li><li><a href="CastleBoxes.html">CastleBoxes</a></li><li><a href="X3DNodes.html">X3DNodes</a></li><li><a href="CastleClassUtils.html">CastleClassUtils</a></li><li><a href="CastleUtils.html">CastleUtils</a></li><li><a href="CastleTriangleOctree.html">CastleTriangleOctree</a></li><li><a href="CastleFrustum.html">CastleFrustum</a></li><li><a href="CastleOctree.html">CastleOctree</a></li><li><a href="X3DTriangles.html">X3DTriangles</a></li><li><a href="X3DFields.html">X3DFields</a></li><li><a href="CastleGeometryArrays.html">CastleGeometryArrays</a></li><li>FGL</li><li><a href="CastleTriangles.html">CastleTriangles</a></li><li><a href="CastleMaterialProperties.html">CastleMaterialProperties</a></li></ul><h2 class="overview">Overview</h2>
<a name="PasDoc-Classes"></a><h3 class="cio">Classes, Interfaces, Objects and Records</h3>
<table class="classestable wide_list">
<tr class="listheader">
<th class="itemname">Name</th>
<th class="itemdesc">Description</th>
</tr>
<tr class="list">
<td class="itemname">Class <a class="bold" href="CastleShapes.TShapeTree.html"><code>TShapeTree</code></a></td>
<td class="itemdesc">Tree of shapes.</td>
</tr>
<tr class="list2">
<td class="itemname">Class <a class="bold" href="CastleShapes.TShape.html"><code>TShape</code></a></td>
<td class="itemdesc">Shape is a geometry node <a class="normal" href="CastleShapes.TShape.html#Geometry">Geometry</a> instance and it's <a class="normal" href="CastleShapes.TShape.html#State">State</a>.</td>
</tr>
<tr class="list">
<td class="itemname">Class <a class="bold" href="CastleShapes.TShapeTreeGroup.html"><code>TShapeTreeGroup</code></a></td>
<td class="itemdesc">Internal (non-leaf) node of the <a class="normal" href="CastleShapes.TShapeTree.html">TShapeTree</a>.</td>
</tr>
<tr class="list2">
<td class="itemname">Class <a class="bold" href="CastleShapes.TShapeTreeSwitch.html"><code>TShapeTreeSwitch</code></a></td>
<td class="itemdesc">Node of the <a class="normal" href="CastleShapes.TShapeTree.html">TShapeTree</a> representing an alternative, choosing one (or none) child from it's children list as active.</td>
</tr>
<tr class="list">
<td class="itemname">Class <a class="bold" href="CastleShapes.TShapeTreeTransform.html"><code>TShapeTreeTransform</code></a></td>
<td class="itemdesc">Node of the <a class="normal" href="CastleShapes.TShapeTree.html">TShapeTree</a> transforming it's children.</td>
</tr>
<tr class="list2">
<td class="itemname">Class <a class="bold" href="CastleShapes.TShapeTreeLOD.html"><code>TShapeTreeLOD</code></a></td>
<td class="itemdesc">Node of the <a class="normal" href="CastleShapes.TShapeTree.html">TShapeTree</a> representing the LOD (level of detail) alternative.</td>
</tr>
<tr class="list">
<td class="itemname">Class <a class="bold" href="CastleShapes.TProximitySensorInstance.html"><code>TProximitySensorInstance</code></a></td>
<td class="itemdesc"> </td>
</tr>
<tr class="list2">
<td class="itemname">Class <a class="bold" href="CastleShapes.TVisibilitySensorInstance.html"><code>TVisibilitySensorInstance</code></a></td>
<td class="itemdesc"> </td>
</tr>
<tr class="list">
<td class="itemname">Class <a class="bold" href="CastleShapes.TShapeTreeIterator.html"><code>TShapeTreeIterator</code></a></td>
<td class="itemdesc">Iterates over all <a class="normal" href="CastleShapes.TShape.html">TShape</a> items that would be enumerated by Tree.Traverse.</td>
</tr>
<tr class="list2">
<td class="itemname">Class <a class="bold" href="CastleShapes.TShapeList.html"><code>TShapeList</code></a></td>
<td class="itemdesc"> </td>
</tr>
</table>
<a name="PasDoc-Types"></a><h3 class="summary">Types</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><b><a href="CastleShapes.html#TShapeSpatialStructure">TShapeSpatialStructure</a></b> = (...);</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a href="CastleShapes.html#TShapeSpatialStructures">TShapeSpatialStructures</a></b> = set of <a href="CastleShapes.html#TShapeSpatialStructure">TShapeSpatialStructure</a>;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a href="CastleShapes.html#TShapeTraverseFunc">TShapeTraverseFunc</a></b> = procedure (Shape: <a href="CastleShapes.TShape.html">TShape</a>) is nested;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a href="CastleShapes.html#TEnumerateShapeTexturesFunction">TEnumerateShapeTexturesFunction</a></b> = procedure (Shape: <a href="CastleShapes.TShape.html">TShape</a>; Texture: <a href="X3DNodes.TAbstractTextureNode.html">TAbstractTextureNode</a>) of object;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a href="CastleShapes.html#TTestShapeVisibility">TTestShapeVisibility</a></b> = function (Shape: <a href="CastleShapes.TShape.html">TShape</a>): boolean of object;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a href="CastleShapes.html#TTriangleEvent">TTriangleEvent</a></b> = procedure (Shape: TObject; const Position: <a href="CastleTriangles.html#TTriangle3Single">TTriangle3Single</a>; const Normal: <a href="CastleTriangles.html#TTriangle3Single">TTriangle3Single</a>; const TexCoord: <a href="CastleTriangles.html#TTriangle4Single">TTriangle4Single</a>; const Face: <a href="CastleTriangles.TFaceIndex.html">TFaceIndex</a>) of object;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a href="CastleShapes.html#TShapeTreeList">TShapeTreeList</a></b> = specialize TFPGObjectList<<a href="CastleShapes.TShapeTree.html">TShapeTree</a>>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a href="CastleShapes.html#TPlaceholderName">TPlaceholderName</a></b> = function (const Shape: <a href="CastleShapes.TShape.html">TShape</a>): string;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a href="CastleShapes.html#TPlaceholderNames">TPlaceholderNames</a></b> = specialize TFPGMap<string, <a href="CastleShapes.html#TPlaceholderName">TPlaceholderName</a>>;</code></td>
</tr>
</table>
<a name="PasDoc-Constants"></a><h3 class="summary">Constants</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><b><a href="CastleShapes.html#DefLocalTriangleOctreeMaxDepth">DefLocalTriangleOctreeMaxDepth</a></b> = 10;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a href="CastleShapes.html#DefLocalTriangleOctreeLeafCapacity">DefLocalTriangleOctreeLeafCapacity</a></b> = 32;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a href="CastleShapes.html#DefLocalTriangleOctreeLimits">DefLocalTriangleOctreeLimits</a></b>: <a href="CastleOctree.TOctreeLimits.html">TOctreeLimits</a> = (
MaxDepth: <a href="CastleShapes.html#DefLocalTriangleOctreeMaxDepth">DefLocalTriangleOctreeMaxDepth</a>;
LeafCapacity: <a href="CastleShapes.html#DefLocalTriangleOctreeLeafCapacity">DefLocalTriangleOctreeLeafCapacity</a>
);</code></td>
</tr>
</table>
<a name="PasDoc-Variables"></a><h3 class="summary">Variables</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code><b><a href="CastleShapes.html#DisableAutoDynamicGeometry">DisableAutoDynamicGeometry</a></b>: Cardinal;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code><b><a href="CastleShapes.html#LogShapes">LogShapes</a></b>: boolean = false;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code><b><a href="CastleShapes.html#PlaceholderNames">PlaceholderNames</a></b>: <a href="CastleShapes.html#TPlaceholderNames">TPlaceholderNames</a>;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Types</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TShapeSpatialStructure"></a><code><b>TShapeSpatialStructure</b> = (...);</code></td>
</tr>
<tr><td colspan="1">
<p>
Possible spatial structure types that may be managed by <a class="normal" href="CastleShapes.TShape.html">TShape</a>, see <a class="normal" href="CastleShapes.TShape.html#Spatial">TShape.Spatial</a>.</p>
<h6 class="description_section">Values</h6>
<ul>
<li>
ssTriangles: Create the <a class="normal" href="CastleShapes.TShape.html#OctreeTriangles">TShape.OctreeTriangles</a>. This is an octree containing all triangles.</li>
</ul>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TShapeSpatialStructures"></a><code><b>TShapeSpatialStructures</b> = set of <a href="CastleShapes.html#TShapeSpatialStructure">TShapeSpatialStructure</a>;</code></td>
</tr>
<tr><td colspan="1">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TShapeTraverseFunc"></a><code><b>TShapeTraverseFunc</b> = procedure (Shape: <a href="CastleShapes.TShape.html">TShape</a>) is nested;</code></td>
</tr>
<tr><td colspan="1">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TEnumerateShapeTexturesFunction"></a><code><b>TEnumerateShapeTexturesFunction</b> = procedure (Shape: <a href="CastleShapes.TShape.html">TShape</a>; Texture: <a href="X3DNodes.TAbstractTextureNode.html">TAbstractTextureNode</a>) of object;</code></td>
</tr>
<tr><td colspan="1">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TTestShapeVisibility"></a><code><b>TTestShapeVisibility</b> = function (Shape: <a href="CastleShapes.TShape.html">TShape</a>): boolean of object;</code></td>
</tr>
<tr><td colspan="1">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TTriangleEvent"></a><code><b>TTriangleEvent</b> = procedure (Shape: TObject; const Position: <a href="CastleTriangles.html#TTriangle3Single">TTriangle3Single</a>; const Normal: <a href="CastleTriangles.html#TTriangle3Single">TTriangle3Single</a>; const TexCoord: <a href="CastleTriangles.html#TTriangle4Single">TTriangle4Single</a>; const Face: <a href="CastleTriangles.TFaceIndex.html">TFaceIndex</a>) of object;</code></td>
</tr>
<tr><td colspan="1">
<p>
Triangle information, called by <a class="normal" href="CastleShapes.TShape.html#LocalTriangulate">TShape.LocalTriangulate</a> and such.
<p>
<p>
<p>
<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>Shape</dt>
<dd>A shape containing this triangle. This is always an instance of <a class="normal" href="CastleShapes.TShape.html">TShape</a> class, but due to unit dependencies it cannot be declared as such.</dd>
<dt>Normal</dt>
<dd>Normal vectors, for each triangle point.</dd>
<dt>TexCoord</dt>
<dd>Texture coordinates, for each triangle point.
<p>Each texture coordinate is a 4D vector, since we may have 3D textures referenced by 4D (homogeneous) coordinates. For normal 2D textures, you can simply take the first 2 components of the vector, and ignore the remaining 2 components. The 3th component is always 0 if was not specified (if model had only 2D texture coords). The 4th component is always 1 if was not specified (if model had only 2D or 3D texture coords).
<p>In case of multi-texturing, this describes coordinates of the first texture unit. In case no texture is defined, this is undefined.</dd>
<dt>Face</dt>
<dd>Describes the indexes of this face, for editing / removing it. See <a class="normal" href="CastleTriangles.TFaceIndex.html">TFaceIndex</a>.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TShapeTreeList"></a><code><b>TShapeTreeList</b> = specialize TFPGObjectList<<a href="CastleShapes.TShapeTree.html">TShapeTree</a>>;</code></td>
</tr>
<tr><td colspan="1">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TPlaceholderName"></a><code><b>TPlaceholderName</b> = function (const Shape: <a href="CastleShapes.TShape.html">TShape</a>): string;</code></td>
</tr>
<tr><td colspan="1">
<p>
Detect the 3D placeholder name set in the external modeler, like 3D object name set in Blender or 3DS Max. Assumes that a specific modeler was used to create and export this 3D model. Each <code>TPlaceholderName</code> function is made to follow the logic of a single modeler, and they are gathered in <a class="normal" href="CastleShapes.html#PlaceholderNames">PlaceholderNames</a>.
<p>Returns empty string if none.
<p>When implementing this, you may find useful the following properties of the shape: TShape.OriginalGeometry.NodeName, TShape.Node.NodeName, <a class="normal" href="CastleShapes.TShape.html#GeometryParentNodeName">TShape.GeometryParentNodeName</a>, <a class="normal" href="CastleShapes.TShape.html#GeometryGrandParentNodeName">TShape.GeometryGrandParentNodeName</a>, <a class="normal" href="CastleShapes.TShape.html#GeometryGrandGrandParentNodeName">TShape.GeometryGrandGrandParentNodeName</a>.
<p>Preferably, the result should be unique, only for this VRML/X3D shape. But in practice it's the responsibility of the modeler and model author to make it true. For example, modelers that allow multiple materials on object (like Blender) <i>must</i> split a single 3D object into many VRML/X3D shapes sometimes. So just don't use shapes with multiple materials if this shape may be meaningful for a placeholder.
<p>This is used only by <a class="normal" href="CastleLevels.TGameSceneManager.html#LoadLevel">TGameSceneManager.LoadLevel</a> placeholders. Ultimately, this should be something that is easy to set when creating a 3D model in given external modeler. <i>Nothing else in our engine depends on a particular modeler strategy for exporting VRML/X3D models.</i>
<p>This should be object name (to allow sharing a single mesh underneath). Except when it's not possible (like for old Blender VRML 1.0 exporter, when only mesh names are stored in VRML/X3D exported files), in which case it can be a mesh name.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="TPlaceholderNames"></a><code><b>TPlaceholderNames</b> = specialize TFPGMap<string, <a href="CastleShapes.html#TPlaceholderName">TPlaceholderName</a>>;</code></td>
</tr>
<tr><td colspan="1">
</td></tr>
</table>
<h3 class="detail">Constants</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="DefLocalTriangleOctreeMaxDepth"></a><code><b>DefLocalTriangleOctreeMaxDepth</b> = 10;</code></td>
</tr>
<tr><td colspan="1">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="DefLocalTriangleOctreeLeafCapacity"></a><code><b>DefLocalTriangleOctreeLeafCapacity</b> = 32;</code></td>
</tr>
<tr><td colspan="1">
<p>
Default octree leaf capacity for <a class="normal" href="CastleShapes.TShape.html#OctreeTriangles">TShape.OctreeTriangles</a>.
<p>This is slightly larger than <a class="normal" href="CastleTriangleOctree.html#DefTriangleOctreeLeafCapacity">DefTriangleOctreeLeafCapacity</a>, as this octree will usually be used interactively for collision detection, not by ray-tracer. So octree construction speed is somewhat important, and cannot be too large...</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="DefLocalTriangleOctreeLimits"></a><code><b>DefLocalTriangleOctreeLimits</b>: <a href="CastleOctree.TOctreeLimits.html">TOctreeLimits</a> = (
MaxDepth: <a href="CastleShapes.html#DefLocalTriangleOctreeMaxDepth">DefLocalTriangleOctreeMaxDepth</a>;
LeafCapacity: <a href="CastleShapes.html#DefLocalTriangleOctreeLeafCapacity">DefLocalTriangleOctreeLeafCapacity</a>
);</code></td>
</tr>
<tr><td colspan="1">
</td></tr>
</table>
<h3 class="detail">Variables</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="DisableAutoDynamicGeometry"></a><code><b>DisableAutoDynamicGeometry</b>: Cardinal;</code></td>
</tr>
<tr><td colspan="1">
<p>
If nonzero, disables automatic <a class="normal" href="CastleShapes.TShape.html#DynamicGeometry">TShape.DynamicGeometry</a> detection on every node modification. This is useful if you do some interactive editing of the shape, but you don't want the shape octree to be replaced by it's approximation.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="LogShapes"></a><code><b>LogShapes</b>: boolean = false;</code></td>
</tr>
<tr><td colspan="1">
<p>
Log various information about shapes. This displays quite a lot of non-critical information when opening non-trivial models.
<p>Meaningful only if you initialized log (see <a class="normal" href="CastleLog.html">CastleLog</a> unit) by <a class="normal" href="CastleLog.html#InitializeLog">InitializeLog</a> first.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="PlaceholderNames"></a><code><b>PlaceholderNames</b>: <a href="CastleShapes.html#TPlaceholderNames">TPlaceholderNames</a>;</code></td>
</tr>
<tr><td colspan="1">
</td></tr>
</table>
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://michalis.ii.uni.wroc.pl/piwik-castle-engine/";
_paq.push(["setTrackerUrl", u+"piwik.php"]);
_paq.push(["setSiteId", "1"]);
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Code -->
<noscript>
<!-- Piwik Image Tracker -->
<img src="http://michalis.ii.uni.wroc.pl/piwik-castle-engine/piwik.php?idsite=1&rec=1" style="border:0" alt="" />
<!-- End Piwik -->
</noscript>
<hr noshade size="1"><span class="appinfo"><em>Generated by <a href="http://pasdoc.sourceforge.net/">PasDoc 0.13.0</a> on 2015-06-15 04:43:11</em>
</span>
</td></tr></table></body></html>
|