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 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547
|
<!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: Castle3D: Class T3DCustomTransform</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">
<a name="T3DCustomTransform"></a><h1 class="cio">Class T3DCustomTransform</h1>
<table class="sections wide_list">
<tr>
<td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></td><td><a class="section" href="#PasDoc-Fields">Fields</a></td><td><a class="section" href="#PasDoc-Methods">Methods</a></td><td><a class="section" href="#PasDoc-Properties">Properties</a></td></tr></table>
<a name="PasDoc-Description"></a><h2 class="unit">Unit</h2>
<p class="unitlink">
<a href="Castle3D.html">Castle3D</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type T3DCustomTransform = class(<a class="normal" href="Castle3D.T3DList.html">T3DList</a>)</code></p>
<h2 class="description">Description</h2>
<p>
Transform (move, rotate, scale) other <a class="normal" href="Castle3D.T3D.html">T3D</a> objects. Descends from <a class="normal" href="Castle3D.T3DList.html">T3DList</a>, transforming all it's children. Also adds gravity and related features.
<p><code>T3DCustomTransform</code> is an abstract class, that doesn't define how the transformation is stored and accessed. Descendants define it by overriding protected virtual methods like <a class="normal" href="Castle3D.T3DCustomTransform.html#GetTranslation">GetTranslation</a> and <a class="normal" href="Castle3D.T3DCustomTransform.html#GetRotation">GetRotation</a> (in this class they return zeros). Use <a class="normal" href="Castle3D.T3DTransform.html">T3DTransform</a> to have simple <a class="normal" href="Castle3D.T3DTransform.html#Translation">T3DTransform.Translation</a> and such properties. Use <a class="normal" href="Castle3D.T3DOrient.html">T3DOrient</a> to have camera-like transformation vectors.</p>
<a name="PasDoc-Hierarchy"></a><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">TComponent</li>
<li class="ancestor"><a class="normal" href="Castle3D.T3D.html">T3D</a></li>
<li class="ancestor"><a class="normal" href="Castle3D.T3DList.html">T3DList</a></li>
<li class="thisitem">T3DCustomTransform</li></ul><h2 class="overview">Overview</h2>
<a name="PasDoc-Fields"></a><h3 class="summary">Fields</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>internal const <b><a href="Castle3D.T3DCustomTransform.html#DefaultMiddleHeight">DefaultMiddleHeight</a></b> = 0.5;</code></td>
</tr>
</table>
<a name="PasDoc-Methods"></a><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#GetTranslation">GetTranslation</a></b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#GetCenter">GetCenter</a></b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#GetRotation">GetRotation</a></b>: <a href="CastleVectors.html#TVector4Single">TVector4Single</a>; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#GetScale">GetScale</a></b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#GetScaleOrientation">GetScaleOrientation</a></b>: <a href="CastleVectors.html#TVector4Single">TVector4Single</a>; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#OnlyTranslation">OnlyTranslation</a></b>: boolean; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#Transform">Transform</a></b>: <a href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#TransformInverse">TransformInverse</a></b>: <a href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3DCustomTransform.html#TransformMatricesMult">TransformMatricesMult</a></b>(var M, MInverse: <a href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>); virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3DCustomTransform.html#TransformMatrices">TransformMatrices</a></b>(out M, MInverse: <a href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#AverageScale">AverageScale</a></b>: Single;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#HeightCollision">HeightCollision</a></b>(const Position, GravityUp: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>; out AboveHeight: Single; out AboveGround: <a href="CastleTriangles.html#P3DTriangle">P3DTriangle</a>): boolean; override;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#MoveCollision">MoveCollision</a></b>( const OldPos, ProposedNewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; out NewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; override;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#MoveCollision">MoveCollision</a></b>( const OldPos, NewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; override;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#SegmentCollision">SegmentCollision</a></b>(const Pos1, Pos2: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>; const ALineOfSight: boolean): boolean; override;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#SphereCollision">SphereCollision</a></b>(const Pos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const Radius: Single; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; override;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#BoxCollision">BoxCollision</a></b>(const Box: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; override;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#RayCollision">RayCollision</a></b>(const RayOrigin, RayDirection: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a href="Castle3D.TRayCollision.html">TRayCollision</a>; override;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3DCustomTransform.html#Fall">Fall</a></b>(const FallHeight: Single); virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#LocalBoundingBox">LocalBoundingBox</a></b>: <a href="CastleBoxes.TBox3D.html">TBox3D</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>constructor <b><a href="Castle3D.T3DCustomTransform.html#Create">Create</a></b>(AOwner: TComponent); override;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#BoundingBox">BoundingBox</a></b>: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; override;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3DCustomTransform.html#Render">Render</a></b>(const Frustum: <a href="CastleFrustum.TFrustum.html">TFrustum</a>; const Params: <a href="Castle3D.TRenderParams.html">TRenderParams</a>); override;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3DCustomTransform.html#RenderShadowVolume">RenderShadowVolume</a></b>( ShadowVolumeRenderer: <a href="Castle3D.TBaseShadowVolumeRenderer.html">TBaseShadowVolumeRenderer</a>; const ParentTransformIsIdentity: boolean; const ParentTransform: <a href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>); override;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#Middle">Middle</a></b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; override;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a href="Castle3D.T3DCustomTransform.html#Update">Update</a></b>(const SecondsPassed: Single; var RemoveMe: <a href="Castle3D.html#TRemoveType">TRemoveType</a>); override;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#OutsideToLocal">OutsideToLocal</a></b>(const Pos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a href="CastleVectors.html#TVector3Single">TVector3Single</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#LocalToOutside">LocalToOutside</a></b>(const Pos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a href="CastleVectors.html#TVector3Single">TVector3Single</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a href="Castle3D.T3DCustomTransform.html#PreferredHeight">PreferredHeight</a></b>: Single; virtual;</code></td>
</tr>
</table>
<a name="PasDoc-Properties"></a><h3 class="summary">Properties</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a href="Castle3D.T3DCustomTransform.html#Gravity">Gravity</a></b>: boolean read FGravity write FGravity default false;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a href="Castle3D.T3DCustomTransform.html#FallSpeed">FallSpeed</a></b>: Single read FFallSpeed write FFallSpeed default 0;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a href="Castle3D.T3DCustomTransform.html#GrowSpeed">GrowSpeed</a></b>: Single read FGrowSpeed write FGrowSpeed default 0;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a href="Castle3D.T3DCustomTransform.html#MiddleHeight">MiddleHeight</a></b>: Single read FMiddleHeight write FMiddleHeight
default <a href="Castle3D.T3DCustomTransform.html#DefaultMiddleHeight">DefaultMiddleHeight</a>;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Fields</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="DefaultMiddleHeight"></a><code>internal const <b>DefaultMiddleHeight</b> = 0.5;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="GetTranslation"></a><code>function <b>GetTranslation</b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
The GetXxx methods below determine the transformation returned by default <a class="normal" href="Castle3D.T3DCustomTransform.html#TransformMatricesMult">TransformMatricesMult</a> implementation in this class. Simple descendants need only to override these, and <a class="normal" href="Castle3D.T3DCustomTransform.html#OnlyTranslation">OnlyTranslation</a>, and the <a class="normal" href="Castle3D.T3DCustomTransform.html#TransformMatricesMult">TransformMatricesMult</a> will automatically work correctly already.
<p>More complicated descendants may override <a class="normal" href="Castle3D.T3DCustomTransform.html#TransformMatricesMult">TransformMatricesMult</a>, and then <a class="normal" href="Castle3D.T3DCustomTransform.html#GetCenter">GetCenter</a>, <a class="normal" href="Castle3D.T3DCustomTransform.html#GetRotation">GetRotation</a> etc. methods can be ignored (if your <a class="normal" href="Castle3D.T3DCustomTransform.html#TransformMatricesMult">TransformMatricesMult</a> will not use it, then <a class="normal" href="Castle3D.T3DCustomTransform.html#GetCenter">GetCenter</a>, <a class="normal" href="Castle3D.T3DCustomTransform.html#GetRotation">GetRotation</a> will not be used at all and there's no point in overriding them). You still need to override
<p></p>
<ul class="paragraph_spacing">
<li><p><a class="normal" href="Castle3D.T3DCustomTransform.html#OnlyTranslation">OnlyTranslation</a></p></li>
<li><p><code>GetTranslation</code> (it's used by default Middle implementation, and it's also used in case <a class="normal" href="Castle3D.T3DCustomTransform.html#OnlyTranslation">OnlyTranslation</a> returns <code>True</code>),</p></li>
<li><p>And make sure <a class="normal" href="Castle3D.T3DCustomTransform.html#AverageScale">AverageScale</a> is correct (if you want it to be <> 1, that is: if your transformation may make some scale, then you need to override <a class="normal" href="Castle3D.T3DCustomTransform.html#GetScale">GetScale</a>).</p></li>
</ul>
<p>
<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="GetCenter"></a><code>function <b>GetCenter</b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; virtual;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="GetRotation"></a><code>function <b>GetRotation</b>: <a href="CastleVectors.html#TVector4Single">TVector4Single</a>; virtual;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="GetScale"></a><code>function <b>GetScale</b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; virtual;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="GetScaleOrientation"></a><code>function <b>GetScaleOrientation</b>: <a href="CastleVectors.html#TVector4Single">TVector4Single</a>; virtual;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="OnlyTranslation"></a><code>function <b>OnlyTranslation</b>: boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Can we use simple <a class="normal" href="Castle3D.T3DCustomTransform.html#GetTranslation">GetTranslation</a> instead of full <a class="normal" href="Castle3D.T3DCustomTransform.html#TransformMatricesMult">TransformMatricesMult</a>. Returning <code>True</code> allows optimization in some cases.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="Transform"></a><code>function <b>Transform</b>: <a href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="TransformInverse"></a><code>function <b>TransformInverse</b>: <a href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="TransformMatricesMult"></a><code>procedure <b>TransformMatricesMult</b>(var M, MInverse: <a href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>); virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Transformation matrix. You can override this to derive transformation using anything, not necessarily <a class="normal" href="Castle3D.T3DCustomTransform.html#GetTranslation">GetTranslation</a> / <a class="normal" href="Castle3D.T3DCustomTransform.html#GetCenter">GetCenter</a> etc. methods.
<p>This method must produce matrices that preserve points as points and directions as directions in homegeneous space. In other words, using <a class="normal" href="CastleVectors.html#MatrixMultPoint">MatrixMultPoint</a> or <a class="normal" href="CastleVectors.html#MatrixMultDirection">MatrixMultDirection</a> with these matrices must never raise <a class="normal" href="CastleVectors.ETransformedResultInvalid.html">ETransformedResultInvalid</a>. For example, a combination of translations, rotations, scaling is Ok.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="TransformMatrices"></a><code>procedure <b>TransformMatrices</b>(out M, MInverse: <a href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>);</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="AverageScale"></a><code>function <b>AverageScale</b>: Single;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="HeightCollision"></a><code>function <b>HeightCollision</b>(const Position, GravityUp: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>; out AboveHeight: Single; out AboveGround: <a href="CastleTriangles.html#P3DTriangle">P3DTriangle</a>): boolean; override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="MoveCollision"></a><code>function <b>MoveCollision</b>( const OldPos, ProposedNewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; out NewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="MoveCollision"></a><code>function <b>MoveCollision</b>( const OldPos, NewPos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="SegmentCollision"></a><code>function <b>SegmentCollision</b>(const Pos1, Pos2: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>; const ALineOfSight: boolean): boolean; override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="SphereCollision"></a><code>function <b>SphereCollision</b>(const Pos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const Radius: Single; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="BoxCollision"></a><code>function <b>BoxCollision</b>(const Box: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): boolean; override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="RayCollision"></a><code>function <b>RayCollision</b>(const RayOrigin, RayDirection: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; const TrianglesToIgnoreFunc: <a href="CastleTriangles.html#T3DTriangleIgnoreFunc">T3DTriangleIgnoreFunc</a>): <a href="Castle3D.TRayCollision.html">TRayCollision</a>; override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="Fall"></a><code>procedure <b>Fall</b>(const FallHeight: Single); virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Called when <code>fall</code> ended. You can use FallHeight to decrease creature life or such.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="LocalBoundingBox"></a><code>function <b>LocalBoundingBox</b>: <a href="CastleBoxes.TBox3D.html">TBox3D</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Untransformed bounding box value.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Create"></a><code>constructor <b>Create</b>(AOwner: TComponent); override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="BoundingBox"></a><code>function <b>BoundingBox</b>: <a href="CastleBoxes.TBox3D.html">TBox3D</a>; override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Render"></a><code>procedure <b>Render</b>(const Frustum: <a href="CastleFrustum.TFrustum.html">TFrustum</a>; const Params: <a href="Castle3D.TRenderParams.html">TRenderParams</a>); override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="RenderShadowVolume"></a><code>procedure <b>RenderShadowVolume</b>( ShadowVolumeRenderer: <a href="Castle3D.TBaseShadowVolumeRenderer.html">TBaseShadowVolumeRenderer</a>; const ParentTransformIsIdentity: boolean; const ParentTransform: <a href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>); override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Middle"></a><code>function <b>Middle</b>: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>; override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Update"></a><code>procedure <b>Update</b>(const SecondsPassed: Single; var RemoveMe: <a href="Castle3D.html#TRemoveType">TRemoveType</a>); override;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="OutsideToLocal"></a><code>function <b>OutsideToLocal</b>(const Pos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a href="CastleVectors.html#TVector3Single">TVector3Single</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Convert position between local and outside coordinate system. This is called <code>OutsideToLocal</code>, not WorldToLocal, because it only handles transformation defined in this item — it does not recursively apply all transform on the way to root .</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="LocalToOutside"></a><code>function <b>LocalToOutside</b>(const Pos: <a href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a href="CastleVectors.html#TVector3Single">TVector3Single</a>;</code></td>
</tr>
<tr><td colspan="2">
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PreferredHeight"></a><code>function <b>PreferredHeight</b>: Single; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
The preferred height of the object <a class="normal" href="Castle3D.T3DCustomTransform.html#Middle">Middle</a> above the ground, when the object is standing on the ground firmly. This is used by objects affected by gravity (like non-flying creatures and items) to know how far they should <a class="normal" href="Castle3D.T3DCustomTransform.html#Fall">fall</a> down or grow up.
<p>The default implementation in this class looks at <a class="normal" href="Castle3D.T3DCustomTransform.html#MiddleHeight">MiddleHeight</a> property, see the algorithm described there. This may be dynamic (may change during creature lifetime, so you can make the creature duck or grow if you want).</p>
</td></tr>
</table>
<h3 class="detail">Properties</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Gravity"></a><code>property <b>Gravity</b>: boolean read FGravity write FGravity default false;</code></td>
</tr>
<tr><td colspan="2">
<p>
Gravity may make this object <a class="normal" href="Castle3D.T3DCustomTransform.html#Fall">fall</a> down (see <a class="normal" href="Castle3D.T3DCustomTransform.html#FallSpeed">FallSpeed</a>) or grow up (see <a class="normal" href="Castle3D.T3DCustomTransform.html#GrowSpeed">GrowSpeed</a>). See also <a class="normal" href="Castle3D.T3DCustomTransform.html#PreferredHeight">PreferredHeight</a>.
<p>Special notes for <a class="normal" href="CastlePlayer.TPlayer.html">TPlayer</a>: player doesn't use this (TPlayer.Gravity should remain <code>False</code>), instead player relies on TPlayer.Camera.Gravity = <code>True</code>, that does a similar thing (with some extras, to make camera effects). This will change in the future, to merge these two gravity implementations. Although the <a class="normal" href="CastlePlayer.TPlayer.html#Fall">TPlayer.Fall</a> method still works as expected (it's linked to <a class="normal" href="CastleCameras.TWalkCamera.html#OnFall">TWalkCamera.OnFall</a> in this case).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="FallSpeed"></a><code>property <b>FallSpeed</b>: Single read FFallSpeed write FFallSpeed default 0;</code></td>
</tr>
<tr><td colspan="2">
<p>
Falling speed, in units per second, for <a class="normal" href="Castle3D.T3DCustomTransform.html#Gravity">Gravity</a>. TODO: this will be replaced with more physically-based approach.
<p>This is relevant only if <a class="normal" href="Castle3D.T3DCustomTransform.html#Gravity">Gravity</a> and <a class="normal" href="Castle3D.T3DCustomTransform.html#PreferredHeight">PreferredHeight</a> <> 0. 0 means no falling.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="GrowSpeed"></a><code>property <b>GrowSpeed</b>: Single read FGrowSpeed write FGrowSpeed default 0;</code></td>
</tr>
<tr><td colspan="2">
<p>
Growing (raising from crouching to normal standing position) speed, in units per second. This is used by non-flying creatures when climbing up stairs, in which case <a class="normal" href="Castle3D.T3DCustomTransform.html#GetTranslation">GetTranslation</a> ("legs positon") may be sometimes under the ground while Middle ("eyes position") will be always above the ground and will try to grow to be at <a class="normal" href="Castle3D.T3DCustomTransform.html#PreferredHeight">PreferredHeight</a> above the ground.
<p>This is relevant only if <a class="normal" href="Castle3D.T3DCustomTransform.html#Gravity">Gravity</a> and <a class="normal" href="Castle3D.T3DCustomTransform.html#PreferredHeight">PreferredHeight</a> <> 0. 0 means no growing.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MiddleHeight"></a><code>property <b>MiddleHeight</b>: Single read FMiddleHeight write FMiddleHeight
default <a href="Castle3D.T3DCustomTransform.html#DefaultMiddleHeight">DefaultMiddleHeight</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
How high are creature eyes in the model. Value 0 means that eyes are at the bottom of the model, 0.5 means the middle, 1 means top.
<p>The <i>top</i> is always considered to be at the top of the bounding box.
<p>Definition of <i>bottom</i> depends on <a class="normal" href="Castle3D.T3DCustomTransform.html#Gravity">Gravity</a>:
<p></p>
<ul class="paragraph_spacing">
<li><p> When Gravity is <code>True</code>, then the <i>bottom</i> is considered to be the plane where World.GravityCoordinate (like Z or Y axis) is zero. The actual bottom (lowest point) of the bounding box doesn't matter. This means that things placed below zero plane (like a creature tentacle or leg) will sink into the ground, instead of causing whole creature to move up. It also means that the creature can easily float above the ground, just model it a little above the zero plane.
<p>In other words, this allows you to model the creature with respect to the ground (zero plane), which is comfortable.
<p>Note that setting <code>MiddleHeight</code> to exact 0 means that gravity will not work, as it means that the <a class="normal" href="Castle3D.T3DCustomTransform.html#PreferredHeight">PreferredHeight</a> above the ground is to be stuck right at the ground level.
<p>For gravity to work right, the <code>MiddleHeight</code> should be large enough to cause <a class="normal" href="Castle3D.T3DCustomTransform.html#PreferredHeight">PreferredHeight</a> to be > <a class="normal" href="Castle3D.T3D.html#Sphere">Sphere</a> radius, for all possible animation states (for all possible bounding box values). </p></li>
<li><p> When Gravity is <code>False</code>, then the <i>bottom</i> is considered at the bottom of the bounding box.
<p>This way it works regardless of where (0,0,0) is in your model (regardless if (0,0,0) represents legs, or middle of your creature), since we adjust to the <a class="normal" href="Castle3D.T3DCustomTransform.html#BoundingBox">BoundingBox</a> position. </p></li>
</ul>
<p>
<p>This property determines how the <a class="normal" href="Castle3D.T3DCustomTransform.html">T3DCustomTransform</a> handles the <a class="normal" href="Castle3D.T3DCustomTransform.html#Middle">Middle</a> implementation (this is the point used for various collision detection routines) and <a class="normal" href="Castle3D.T3DCustomTransform.html#PreferredHeight">PreferredHeight</a> (this is the preferred height of <a class="normal" href="Castle3D.T3DCustomTransform.html#Middle">Middle</a> above the ground). You can override these two methods to use a different approach, and then ignore <code>MiddleHeight</code> completely.</p>
</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:08</em>
</span>
</td></tr></table></body></html>
|