File: CastleResources.T3DResource.html

package info (click to toggle)
castle-game-engine 5.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 185,428 kB
  • sloc: pascal: 260,781; cpp: 1,363; objc: 713; makefile: 537; xml: 496; sh: 480; php: 4
file content (450 lines) | stat: -rw-r--r-- 30,808 bytes parent folder | download
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
<!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: CastleResources: Class T3DResource</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="T3DResource"></a><h1 class="cio">Class T3DResource</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="CastleResources.html">CastleResources</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type T3DResource = class(TObject)</code></p>
<h2 class="description">Description</h2>
<p>
Resource used for rendering and processing of 3D objects. By itself this doesn't render or do anything. But some 3D objects may need to have such resource prepared to work.

<p>It can also load it's configuration from XML config file. For this purpose, it has a unique identifier in <a class="normal" href="CastleResources.T3DResource.html#Name">Name</a> property.</p>
<a name="PasDoc-Hierarchy"></a><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">TObject</li>
<li class="thisitem">T3DResource</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="CastleResources.T3DResource.html#DefaultFallSpeed">DefaultFallSpeed</a></b> = 10.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>internal const <b><a  href="CastleResources.T3DResource.html#DefaultGrowSpeed">DefaultGrowSpeed</a></b> = 5.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>internal const <b><a  href="CastleResources.T3DResource.html#DefaultReceiveShadowVolumes">DefaultReceiveShadowVolumes</a></b> = true;</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>internal const <b><a  href="CastleResources.T3DResource.html#DefaultCastShadowVolumes">DefaultCastShadowVolumes</a></b> = true;</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>procedure <b><a  href="CastleResources.T3DResource.html#PrepareCore">PrepareCore</a></b>(const BaseLights: <a  href="Castle3D.html#TAbstractLightInstancesList">TAbstractLightInstancesList</a>; const GravityUp: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const DoProgress: boolean); 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="CastleResources.T3DResource.html#PrepareCoreSteps">PrepareCoreSteps</a></b>: Cardinal; 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>procedure <b><a  href="CastleResources.T3DResource.html#ReleaseCore">ReleaseCore</a></b>; virtual;</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>constructor <b><a  href="CastleResources.T3DResource.html#Create">Create</a></b>(const AName: string); virtual;</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>destructor <b><a  href="CastleResources.T3DResource.html#Destroy">Destroy</a></b>; 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="CastleResources.T3DResource.html#GLContextClose">GLContextClose</a></b>; virtual;</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="CastleResources.T3DResource.html#LoadFromFile">LoadFromFile</a></b>(ResourceConfig: <a  href="CastleXMLConfig.TCastleConfig.html">TCastleConfig</a>); virtual;</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="CastleResources.T3DResource.html#RedoPrepare">RedoPrepare</a></b>(const BaseLights: <a  href="Castle3D.html#TAbstractLightInstancesList">TAbstractLightInstancesList</a>; const GravityUp: <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>procedure <b><a  href="CastleResources.T3DResource.html#Prepare">Prepare</a></b>(const BaseLights: <a  href="Castle3D.html#TAbstractLightInstancesList">TAbstractLightInstancesList</a>; const GravityUp: <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>procedure <b><a  href="CastleResources.T3DResource.html#Release">Release</a></b>;</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="CastleResources.T3DResource.html#InstantiatePlaceholder">InstantiatePlaceholder</a></b>(World: <a  href="Castle3D.T3DWorld.html">T3DWorld</a>; const APosition, ADirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const NumberPresent: boolean; const Number: Int64); virtual; abstract;</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="CastleResources.T3DResource.html#AlwaysPrepared">AlwaysPrepared</a></b>: boolean; 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="CastleResources.T3DResource.html#Prepared">Prepared</a></b>: boolean read FPrepared;</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="CastleResources.T3DResource.html#Name">Name</a></b>: string read FName;</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="CastleResources.T3DResource.html#UsageCount">UsageCount</a></b>: Cardinal
      read FUsageCount write FUsageCount 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="CastleResources.T3DResource.html#Animations">Animations</a></b>: <a  href="CastleResources.T3DResourceAnimationList.html">T3DResourceAnimationList</a> read FAnimations;</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="CastleResources.T3DResource.html#ConfigAlwaysPrepared">ConfigAlwaysPrepared</a></b>: boolean
      read FConfigAlwaysPrepared write FConfigAlwaysPrepared;</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="CastleResources.T3DResource.html#FallSpeed">FallSpeed</a></b>: Single
      read FFallSpeed write FFallSpeed default <a  href="CastleResources.T3DResource.html#DefaultFallSpeed">DefaultFallSpeed</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>property <b><a  href="CastleResources.T3DResource.html#GrowSpeed">GrowSpeed</a></b>: Single
      read FGrowSpeed write FGrowSpeed default <a  href="CastleResources.T3DResource.html#DefaultGrowSpeed">DefaultGrowSpeed</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>property <b><a  href="CastleResources.T3DResource.html#ReceiveShadowVolumes">ReceiveShadowVolumes</a></b>: boolean
      read FReceiveShadowVolumes write FReceiveShadowVolumes
      default <a  href="CastleResources.T3DResource.html#DefaultReceiveShadowVolumes">DefaultReceiveShadowVolumes</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>property <b><a  href="CastleResources.T3DResource.html#CastShadowVolumes">CastShadowVolumes</a></b>: boolean
      read FCastShadowVolumes write FCastShadowVolumes
      default <a  href="CastleResources.T3DResource.html#DefaultCastShadowVolumes">DefaultCastShadowVolumes</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>property <b><a  href="CastleResources.T3DResource.html#ModelURL">ModelURL</a></b>: string read FModelURL write FModelURL;</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="DefaultFallSpeed"></a><code>internal const <b>DefaultFallSpeed</b> = 10.0;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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="DefaultGrowSpeed"></a><code>internal const <b>DefaultGrowSpeed</b> = 5.0;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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="DefaultReceiveShadowVolumes"></a><code>internal const <b>DefaultReceiveShadowVolumes</b> = true;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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="DefaultCastShadowVolumes"></a><code>internal const <b>DefaultCastShadowVolumes</b> = true;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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="PrepareCore"></a><code>procedure <b>PrepareCore</b>(const BaseLights: <a  href="Castle3D.html#TAbstractLightInstancesList">TAbstractLightInstancesList</a>; const GravityUp: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const DoProgress: boolean); virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Prepare or release everything needed to use this resource. <code>PrepareCore</code> and <a class="normal" href="CastleResources.T3DResource.html#ReleaseCore">ReleaseCore</a> should never be called directly, they are only to be overridden in descendants. These are used by actual <a class="normal" href="CastleResources.T3DResource.html#Prepare">Prepare</a> and <a class="normal" href="CastleResources.T3DResource.html#Release">Release</a> when the actual allocation / deallocation should take place (when <a class="normal" href="CastleResources.T3DResource.html#UsageCount">UsageCount</a> raises from zero or drops back to zero).

<p><a class="normal" href="CastleResources.T3DResource.html#ReleaseCore">ReleaseCore</a> is also called in destructor, regardless of <a class="normal" href="CastleResources.T3DResource.html#UsageCount">UsageCount</a>. This is done to free resources even if user forgot to call Release before destroying this resource instance.

<p><code>PrepareCore</code> must call Progress.Step exactly <a class="normal" href="CastleResources.T3DResource.html#PrepareCoreSteps">PrepareCoreSteps</a> times, only if DoProgress. This allows to make nice progress bar in <a class="normal" href="CastleResources.T3DResource.html#Prepare">Prepare</a>. In this class, <a class="normal" href="CastleResources.T3DResource.html#PrepareCoreSteps">PrepareCoreSteps</a> returns 0. </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="PrepareCoreSteps"></a><code>function <b>PrepareCoreSteps</b>: Cardinal; virtual;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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="ReleaseCore"></a><code>procedure <b>ReleaseCore</b>; virtual;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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>(const AName: string); virtual;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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="Destroy"></a><code>destructor <b>Destroy</b>; override;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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="GLContextClose"></a><code>procedure <b>GLContextClose</b>; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Free any association with current OpenGL context.</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="LoadFromFile"></a><code>procedure <b>LoadFromFile</b>(ResourceConfig: <a  href="CastleXMLConfig.TCastleConfig.html">TCastleConfig</a>); virtual;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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="RedoPrepare"></a><code>procedure <b>RedoPrepare</b>(const BaseLights: <a  href="Castle3D.html#TAbstractLightInstancesList">TAbstractLightInstancesList</a>; const GravityUp: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>);</code></td>
</tr>
<tr><td colspan="2">
<p>
Release and then immediately prepare again this resource. Call only when <a class="normal" href="CastleResources.T3DResource.html#UsageCount">UsageCount</a> &lt;&gt; 0, that is when resource is prepared. Shows nice progress bar, using <a class="normal" href="CastleProgress.html#Progress">Progress</a>.</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="Prepare"></a><code>procedure <b>Prepare</b>(const BaseLights: <a  href="Castle3D.html#TAbstractLightInstancesList">TAbstractLightInstancesList</a>; const GravityUp: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>);</code></td>
</tr>
<tr><td colspan="2">
<p>
Prepare or release everything needed to use this resource.

<p>There is an internal counter tracking how many times given resource was prepared and released. Which means that preparing and releasing resource multiple times is correct &mdash; but make sure that every single call to prepare is paired with exactly one call to release. Actual allocation / deallocation (when protected methods <a class="normal" href="CastleResources.T3DResource.html#PrepareCore">PrepareCore</a>, <a class="normal" href="CastleResources.T3DResource.html#ReleaseCore">ReleaseCore</a> are called) happens only when <a class="normal" href="CastleResources.T3DResource.html#UsageCount">UsageCount</a> raises from zero or drops back to zero.

<p>Show nice progress bar, using <a class="normal" href="CastleProgress.html#Progress">Progress</a>.

<p></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="Release"></a><code>procedure <b>Release</b>;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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="InstantiatePlaceholder"></a><code>procedure <b>InstantiatePlaceholder</b>(World: <a  href="Castle3D.T3DWorld.html">T3DWorld</a>; const APosition, ADirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const NumberPresent: boolean; const Number: Int64); virtual; abstract;</code></td>
</tr>
<tr><td colspan="2">
<p>
Place an instance of this resource on World, using information from the placeholder on the level.</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="AlwaysPrepared"></a><code>function <b>AlwaysPrepared</b>: boolean; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
Mechanics of given game may suggest that some 3D resources should always be prepared. For example, in typical 3D game when player has inventory and can drop items from inventory on the ground, then all items should be prepared for all levels, since you can in theory drop everything anywhere.

<p>Return <code>True</code> if this is such resource.

<p>Default implementation in <a class="normal" href="CastleResources.T3DResource.html">T3DResource</a> returns here the <a class="normal" href="CastleResources.T3DResource.html#ConfigAlwaysPrepared">ConfigAlwaysPrepared</a> value, which may be set in resource.xml and by default is false. This allows to configure this using resource.xml files. Descendants may choose to override this, to override value from resource.xml file.</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="Prepared"></a><code>property <b>Prepared</b>: boolean read FPrepared;</code></td>
</tr>
<tr><td colspan="2">
<p>
Are we in a (fully) prepared state. That is after a (fully successfull) <a class="normal" href="CastleResources.T3DResource.html#Prepare">Prepare</a> call and before <a class="normal" href="CastleResources.T3DResource.html#Release">Release</a>. Note that this is slightly different than checking <code><a class="normal" href="CastleResources.T3DResource.html#UsageCount">UsageCount</a> &lt;&gt; 0</code>: in some situations, <a class="normal" href="CastleResources.T3DResource.html#UsageCount">UsageCount</a> may be non-zero while the preparation is not finished yet. This property is guaranteed to be <code>True</code> only if preparation was fully successfully (no exceptions) finished.</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="Name"></a><code>property <b>Name</b>: string read FName;</code></td>
</tr>
<tr><td colspan="2">
<p>
Unique identifier of this resource. Used to refer to this resource from level placeholders (see <a class="normal" href="CastleLevels.TGameSceneManager.html#LoadLevel">TGameSceneManager.LoadLevel</a> about placeholders), from other XML files (for example one creature may shoot another creature as a missile using <a class="normal" href="CastleCreatures.TWalkAttackCreatureResource.html#FireMissileName">TWalkAttackCreatureResource.FireMissileName</a>), and in other places.

<p>This can use only letters, use CamelCase. Reason: This must be a valid identifier in both VRML/X3D and ObjectPascal. Also digits and underscores are reserved, as we may use them to get other information from placeholder names.</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="UsageCount"></a><code>property <b>UsageCount</b>: Cardinal
      read FUsageCount write FUsageCount default 0;</code></td>
</tr>
<tr><td colspan="2">
<p>
How many times this resource is used. Used by Prepare and Release: actual allocation / deallocation happens when this raises from zero or drops back to zero.</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="Animations"></a><code>property <b>Animations</b>: <a  href="CastleResources.T3DResourceAnimationList.html">T3DResourceAnimationList</a> read FAnimations;</code></td>
</tr>
<tr><td colspan="2">
<p>
Animations of this resource.

<p>The first animation, if exists, right now determines the default radius calculation. So the first animation should have the bounding box representative for all animations. Other than that, the order on this list doesn't matter.

<p>The properties of these animations are automatically loaded from resource.xml file in <a class="normal" href="CastleResources.T3DResource.html#LoadFromFile">LoadFromFile</a>. The animations are automatically prepared / released by our <a class="normal" href="CastleResources.T3DResource.html#Prepare">Prepare</a> / <a class="normal" href="CastleResources.T3DResource.html#Release">Release</a> methods.</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="ConfigAlwaysPrepared"></a><code>property <b>ConfigAlwaysPrepared</b>: boolean
      read FConfigAlwaysPrepared write FConfigAlwaysPrepared;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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 <a  href="CastleResources.T3DResource.html#DefaultFallSpeed">DefaultFallSpeed</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
The speed (in units per second) of falling down because of gravity. Note that the gravity direction is controlled by your level 3D model, see &quot;Which way is up&quot; section in the engine tutorial [<a  href="http://castle-engine.sourceforge.net/tutorial_up.php">http://castle-engine.sourceforge.net/tutorial_up.php</a>].

<p>Currently, falling down of creatures and items just uses this constant speed. In the future, we plan to add properties to control mass and air friction and perform more physically-correct simulation of falling down.

<p>This has no effect for creatures with <a class="normal" href="CastleCreatures.TCreatureResource.html#Flying">TCreatureResource.Flying</a> = <code>True</code>. This also has no effect for missile creatures (their <a class="normal" href="CastleCreatures.TCreatureResource.html#Flying">TCreatureResource.Flying</a> is ignored, they have special approach to gravity).

<p>See T3D.FallSpeed for precise definition, this works the same, except our default value is non-zero, and by default T3D.Gravity and T3D.PreferredHeight are already sensible for creatures/items.</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 <a  href="CastleResources.T3DResource.html#DefaultGrowSpeed">DefaultGrowSpeed</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
The speed (in units per second) of growing.

<p>&quot;Growing&quot; is used to allow non-flying creatures to climb stairs. The creature can move whenever a sphere (see <a class="normal" href="CastleCreatures.TCreatureResource.html#MiddleHeight">TCreatureResource.MiddleHeight</a> and <a class="normal" href="CastleCreatures.TCreatureResource.html#Radius">TCreatureResource.Radius</a>) can move. This means that part of the bounding box (part of the <a class="normal" href="Castle3D.T3DCustomTransform.html#PreferredHeight">T3DCustomTransform.PreferredHeight</a>) may temporarily &quot;sink&quot; into the ground. Then growing, controlled by this property, pushes the creature up.

<p>See T3D.GrowSpeed, this works the same, except the default value is non-zero, and by default T3D.Gravity and T3D.PreferredHeight are already sensible for creatures/items.</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="ReceiveShadowVolumes"></a><code>property <b>ReceiveShadowVolumes</b>: boolean
      read FReceiveShadowVolumes write FReceiveShadowVolumes
      default <a  href="CastleResources.T3DResource.html#DefaultReceiveShadowVolumes">DefaultReceiveShadowVolumes</a>;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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="CastShadowVolumes"></a><code>property <b>CastShadowVolumes</b>: boolean
      read FCastShadowVolumes write FCastShadowVolumes
      default <a  href="CastleResources.T3DResource.html#DefaultCastShadowVolumes">DefaultCastShadowVolumes</a>;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</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="ModelURL"></a><code>property <b>ModelURL</b>: string read FModelURL write FModelURL;</code></td>
</tr>
<tr><td colspan="2">
<p>
Model URL, only when you define multiple animations inside a single 3D file. See [<a  href="http://castle-engine.sourceforge.net/creating_data_resources.php">http://castle-engine.sourceforge.net/creating_data_resources.php</a>] for notes about &lt;model&gt; element in resource.xml files.</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&amp;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>