File: CastlePlayer.TPlayer.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 (933 lines) | stat: -rw-r--r-- 59,593 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
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
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
<!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: CastlePlayer: Class TPlayer</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="TPlayer"></a><h1 class="cio">Class TPlayer</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="CastlePlayer.html">CastlePlayer</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type TPlayer = class(<a class="normal" href="CastleItems.T3DAliveWithInventory.html">T3DAliveWithInventory</a>)</code></p>
<h2 class="description">Description</h2>
<p>
Player, 3D object controlling the camera, main enemy of hostile creatures, carries a backpack, may cause <a class="normal" href="CastlePlayer.TPlayer.html#FadeOut">fadeout</a> effects on screen and such.

<p>Note that you can operate on player even before level is loaded, before <a class="normal" href="CastleSceneManager.TCastleSceneManager.html">TCastleSceneManager</a> and such are initialized. This allows to create player before level is started (create it from scratch, or by loading from save game), and &quot;carry&quot; the same player instance across various loaded levels.

<p><a class="normal" href="Castle3D.T3DAlive.html#Dead">Dead</a> or <a class="normal" href="CastlePlayer.TPlayer.html#Blocked">Blocked</a> player behaves much like alive and normal player. For example, it still has an associated Camera that can animate by code (e.g. to apply physics to the dead player body, because player was killed when he was flying, or it's corpse lays on some moving object of the level &mdash; like elevator). However, Camera input shortcuts will be cleared, to prevent user from directly moving the camera and player.

<p>Do not do some stuff when player is dead: </p>

<ul class="paragraph_spacing">
  <li><p>No calling <a class="normal" href="CastleItems.T3DAliveWithInventory.html#PickItem">PickItem</a>, <a class="normal" href="CastlePlayer.TPlayer.html#DropItem">DropItem</a>, <a class="normal" href="CastlePlayer.TPlayer.html#UseItem">UseItem</a>.</p></li>
  <li><p>No increasing Life (further decreasing Life is OK). This implies that once Player is Dead, (s)he cannot be alive again.</p></li>
  <li><p>No changing <a class="normal" href="CastlePlayer.TPlayer.html#EquippedWeapon">EquippedWeapon</a>, no calling Attack.</p></li>
</ul>

<p>

<p>Note that every player, just like every <a class="normal" href="Castle3D.T3DOrient.html">T3DOrient</a> actually, has an associated and magically synchronized <a class="normal" href="Castle3D.T3DOrient.html#Camera">T3DOrient.Camera</a> instance. Ancestor <a class="normal" href="Castle3D.T3DOrient.html">T3DOrient</a> only takes care about synchronizing the view vectors (position, direciton, up) and doesn't care about camera otherwise. We synchronize more in <code>TPlayer</code> class:

<p></p>

<ul class="paragraph_spacing">
  <li><p><a class="normal" href="CastlePlayer.TPlayer.html#Flying">Flying</a> is synchronized with <a class="normal" href="CastleCameras.TWalkCamera.html#Gravity">TWalkCamera.Gravity</a>.</p></li>
  <li><p>Various camera inputs are automatically adjusted based on current player state (<a class="normal" href="Castle3D.T3DAlive.html#Dead">Dead</a>, <a class="normal" href="CastlePlayer.TPlayer.html#Blocked">Blocked</a>) and global PlayerInput_Xxx values, like <a class="normal" href="CastlePlayer.html#PlayerInput_Forward">PlayerInput_Forward</a>.</p></li>
</ul>

<p>

<p>The outside code may still directly access and change many camera properties. Camera view vectors (position, direciton, up), <a class="normal" href="CastleCameras.TWalkCamera.html#PreferredHeight">TWalkCamera.PreferredHeight</a>, <a class="normal" href="CastleCameras.TWalkCamera.html#RotationHorizontalSpeed">TWalkCamera.RotationHorizontalSpeed</a> <a class="normal" href="CastleCameras.TWalkCamera.html#RotationVerticalSpeed">TWalkCamera.RotationVerticalSpeed</a>. In fact, it's Ok to call <a class="normal" href="CastleCameras.TWalkCamera.html#Init">TWalkCamera.Init</a>, and it's Ok to assign this Camera to TCastleSceneManager.Camera, and <a class="normal" href="CastleLevels.TGameSceneManager.html#LoadLevel">TGameSceneManager.LoadLevel</a> does this automatically. So scene manager will update Camera.ProjectionMatrix, call camera events like <a class="normal" href="CastleCameras.TCamera.html#Press">TCamera.Press</a>, <a class="normal" href="CastleCameras.TCamera.html#Update">TCamera.Update</a> and such.)</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="ancestor"><a class="normal" href="Castle3D.T3DCustomTransform.html">T3DCustomTransform</a></li>
<li class="ancestor"><a class="normal" href="Castle3D.T3DOrient.html">T3DOrient</a></li>
<li class="ancestor"><a class="normal" href="Castle3D.T3DAlive.html">T3DAlive</a></li>
<li class="ancestor"><a class="normal" href="CastleItems.T3DAliveWithInventory.html">T3DAliveWithInventory</a></li>
<li class="thisitem">TPlayer</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><b><a  href="CastlePlayer.TPlayer.html#DefaultMoveHorizontalSpeed">DefaultMoveHorizontalSpeed</a></b>: Single;</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><b><a  href="CastlePlayer.TPlayer.html#DefaultMoveVerticalSpeed">DefaultMoveVerticalSpeed</a></b>: Single;</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><b><a  href="CastlePlayer.TPlayer.html#DefaultPreferredHeight">DefaultPreferredHeight</a></b>: Single;</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="CastlePlayer.TPlayer.html#DefaultLife">DefaultLife</a></b> = 100;</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="CastlePlayer.TPlayer.html#DefaultSickProjectionSpeed">DefaultSickProjectionSpeed</a></b> = 2.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="CastlePlayer.TPlayer.html#DefaultRenderOnTop">DefaultRenderOnTop</a></b> = true;</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="CastlePlayer.TPlayer.html#DefaultPlayerKnockBackSpeed">DefaultPlayerKnockBackSpeed</a></b> = 20.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="CastlePlayer.TPlayer.html#DefaultSwimBreath">DefaultSwimBreath</a></b> = 30.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="CastlePlayer.TPlayer.html#DefaultDrownPause">DefaultDrownPause</a></b> = 5.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="CastlePlayer.TPlayer.html#DefaultDrownDamageConst">DefaultDrownDamageConst</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="CastlePlayer.TPlayer.html#DefaultDrownDamageRandom">DefaultDrownDamageRandom</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="CastlePlayer.TPlayer.html#DefaultSwimSoundPause">DefaultSwimSoundPause</a></b> = 3.11111111;</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="CastlePlayer.TPlayer.html#SetLife">SetLife</a></b>(const Value: Single); 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="CastlePlayer.TPlayer.html#GetChild">GetChild</a></b>: <a  href="Castle3D.T3D.html">T3D</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="CastlePlayer.TPlayer.html#Notification">Notification</a></b>(AComponent: TComponent; Operation: TOperation); 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="CastlePlayer.TPlayer.html#HeightCollision">HeightCollision</a></b>(const APosition, 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>procedure <b><a  href="CastlePlayer.TPlayer.html#Fall">Fall</a></b>(const FallHeight: Single); 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>constructor <b><a  href="CastlePlayer.TPlayer.html#Create">Create</a></b>(AOwner: TComponent); 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>destructor <b><a  href="CastlePlayer.TPlayer.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>function <b><a  href="CastlePlayer.TPlayer.html#PickItemUpdate">PickItemUpdate</a></b>(var Item: <a  href="CastleItems.TInventoryItem.html">TInventoryItem</a>): Integer; 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="CastlePlayer.TPlayer.html#DropItem">DropItem</a></b>(const Index: Integer): <a  href="CastleItems.TItemOnWorld.html">TItemOnWorld</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>function <b><a  href="CastlePlayer.TPlayer.html#DropCurrentItem">DropCurrentItem</a></b>: <a  href="CastleItems.TItemOnWorld.html">TItemOnWorld</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="CastlePlayer.TPlayer.html#UseItem">UseItem</a></b>(const Index: Integer); 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="CastlePlayer.TPlayer.html#UseCurrentItem">UseCurrentItem</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="CastlePlayer.TPlayer.html#ChangeInventoryCurrentItem">ChangeInventoryCurrentItem</a></b>(Change: Integer);</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="CastlePlayer.TPlayer.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="CastlePlayer.TPlayer.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="CastlePlayer.TPlayer.html#FadeOut">FadeOut</a></b>(const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</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="CastlePlayer.TPlayer.html#Attack">Attack</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>procedure <b><a  href="CastlePlayer.TPlayer.html#LoadFromFile">LoadFromFile</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="CastlePlayer.TPlayer.html#LoadFromFile">LoadFromFile</a></b>(const URL: string);</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="CastlePlayer.TPlayer.html#Ground">Ground</a></b>: <a  href="X3DTriangles.html#PTriangle">PTriangle</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="CastlePlayer.TPlayer.html#LevelChanged">LevelChanged</a></b>;</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="CastlePlayer.TPlayer.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="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="CastlePlayer.TPlayer.html#Sphere">Sphere</a></b>(out Radius: Single): boolean; 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="CastlePlayer.TPlayer.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>
</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="CastlePlayer.TPlayer.html#Flying">Flying</a></b>: boolean read FFlying write SetFlying;</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="CastlePlayer.TPlayer.html#FlyingTimeOut">FlyingTimeOut</a></b>: <a  href="CastleTimeUtils.html#TFloatTime">TFloatTime</a> read FFlyingTimeOut write SetFlyingTimeOut;</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="CastlePlayer.TPlayer.html#EquippedWeapon">EquippedWeapon</a></b>: <a  href="CastleItems.TItemWeapon.html">TItemWeapon</a> read FEquippedWeapon write SetEquippedWeapon;</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="CastlePlayer.TPlayer.html#FadeOutColor">FadeOutColor</a></b>: <a  href="CastleColors.html#TCastleColor">TCastleColor</a> read FFadeOutColor;</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="CastlePlayer.TPlayer.html#FadeOutIntensity">FadeOutIntensity</a></b>: Single read FFadeOutIntensity;</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="CastlePlayer.TPlayer.html#Swimming">Swimming</a></b>: <a  href="CastlePlayer.html#TPlayerSwimming">TPlayerSwimming</a> read FSwimming write SetSwimming;</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="CastlePlayer.TPlayer.html#InventoryCurrentItem">InventoryCurrentItem</a></b>: Integer
      read FInventoryCurrentItem write FInventoryCurrentItem
      default -1;</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="CastlePlayer.TPlayer.html#InventoryVisible">InventoryVisible</a></b>: boolean
      read FInventoryVisible write FInventoryVisible default false;</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="CastlePlayer.TPlayer.html#SickProjectionSpeed">SickProjectionSpeed</a></b>: Single
      read FSickProjectionSpeed write FSickProjectionSpeed
      default <a  href="CastlePlayer.TPlayer.html#DefaultSickProjectionSpeed">DefaultSickProjectionSpeed</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="CastlePlayer.TPlayer.html#CollidesWithMoving">CollidesWithMoving</a></b> default true;</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="CastlePlayer.TPlayer.html#Blocked">Blocked</a></b>: boolean read FBlocked write FBlocked;</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="CastlePlayer.TPlayer.html#RenderOnTop">RenderOnTop</a></b>: boolean read FRenderOnTop write FRenderOnTop
      default <a  href="CastlePlayer.TPlayer.html#DefaultRenderOnTop">DefaultRenderOnTop</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="CastlePlayer.TPlayer.html#FallMinHeightToSound">FallMinHeightToSound</a></b>: Single
      read FFallMinHeightToSound write FFallMinHeightToSound default <a  href="Castle3D.html#DefaultPlayerFallMinHeightToSound">DefaultPlayerFallMinHeightToSound</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="CastlePlayer.TPlayer.html#FallMinHeightToDamage">FallMinHeightToDamage</a></b>: Single
      read FFallMinHeightToDamage write FFallMinHeightToDamage default <a  href="Castle3D.html#DefaultFallMinHeightToDamage">DefaultFallMinHeightToDamage</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="CastlePlayer.TPlayer.html#FallDamageScaleMin">FallDamageScaleMin</a></b>: Single
      read FFallDamageScaleMin write FFallDamageScaleMin default <a  href="Castle3D.html#DefaultFallDamageScaleMin">DefaultFallDamageScaleMin</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="CastlePlayer.TPlayer.html#FallDamageScaleMax">FallDamageScaleMax</a></b>: Single
      read FFallDamageScaleMax write FFallDamageScaleMax default <a  href="Castle3D.html#DefaultFallDamageScaleMax">DefaultFallDamageScaleMax</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="CastlePlayer.TPlayer.html#FallSound">FallSound</a></b>: <a  href="CastleSoundEngine.html#TSoundType">TSoundType</a>
      read FFallSound write FFallSound;</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="CastlePlayer.TPlayer.html#HeadBobbing">HeadBobbing</a></b>: Single
      read FHeadBobbing write FHeadBobbing default <a  href="CastleCameras.TWalkCamera.html#DefaultHeadBobbing">TWalkCamera.DefaultHeadBobbing</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="CastlePlayer.TPlayer.html#SwimBreath">SwimBreath</a></b>: Single read FSwimBreath write FSwimBreath default <a  href="CastlePlayer.TPlayer.html#DefaultSwimBreath">DefaultSwimBreath</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="CastlePlayer.TPlayer.html#DrownPause">DrownPause</a></b>: Single read FDrownPause write FDrownPause default <a  href="CastlePlayer.TPlayer.html#DefaultDrownPause">DefaultDrownPause</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="CastlePlayer.TPlayer.html#DrownDamageConst">DrownDamageConst</a></b>: Single read FDrownDamageConst write FDrownDamageConst default <a  href="CastlePlayer.TPlayer.html#DefaultDrownDamageConst">DefaultDrownDamageConst</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="CastlePlayer.TPlayer.html#DrownDamageRandom">DrownDamageRandom</a></b>: Single read FDrownDamageRandom write FDrownDamageRandom default <a  href="CastlePlayer.TPlayer.html#DefaultDrownDamageRandom">DefaultDrownDamageRandom</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="CastlePlayer.TPlayer.html#SwimSoundPause">SwimSoundPause</a></b>: Single read FSwimSoundPause write FSwimSoundPause default <a  href="CastlePlayer.TPlayer.html#DefaultSwimSoundPause">DefaultSwimSoundPause</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><code>property <b><a  href="CastlePlayer.TPlayer.html#KnockBackSpeed">KnockBackSpeed</a></b> default DefaultPlayerKnockBackSpeed;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><code>property <b><a  href="CastlePlayer.TPlayer.html#EnableCameraDragging">EnableCameraDragging</a></b>: boolean
      read FEnableCameraDragging write SetEnableCameraDragging default false;</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="DefaultMoveHorizontalSpeed"></a><code><b>DefaultMoveHorizontalSpeed</b>: Single;</code></td>
</tr>
<tr><td colspan="2">
<p>
Various navigation properties that may depend on loaded 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="DefaultMoveVerticalSpeed"></a><code><b>DefaultMoveVerticalSpeed</b>: Single;</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="DefaultPreferredHeight"></a><code><b>DefaultPreferredHeight</b>: Single;</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="DefaultLife"></a><code>internal const <b>DefaultLife</b> = 100;</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="DefaultSickProjectionSpeed"></a><code>internal const <b>DefaultSickProjectionSpeed</b> = 2.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="DefaultRenderOnTop"></a><code>internal const <b>DefaultRenderOnTop</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="DefaultPlayerKnockBackSpeed"></a><code>internal const <b>DefaultPlayerKnockBackSpeed</b> = 20.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="DefaultSwimBreath"></a><code>internal const <b>DefaultSwimBreath</b> = 30.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="DefaultDrownPause"></a><code>internal const <b>DefaultDrownPause</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="DefaultDrownDamageConst"></a><code>internal const <b>DefaultDrownDamageConst</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="DefaultDrownDamageRandom"></a><code>internal const <b>DefaultDrownDamageRandom</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="DefaultSwimSoundPause"></a><code>internal const <b>DefaultSwimSoundPause</b> = 3.11111111;</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="SetLife"></a><code>procedure <b>SetLife</b>(const Value: Single); 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="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="GetChild"></a><code>function <b>GetChild</b>: <a  href="Castle3D.T3D.html">T3D</a>; 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="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="Notification"></a><code>procedure <b>Notification</b>(AComponent: TComponent; Operation: TOperation); 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="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><a name="HeightCollision"></a><code>function <b>HeightCollision</b>(const APosition, 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">
&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="Fall"></a><code>procedure <b>Fall</b>(const FallHeight: Single); 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="Create"></a><code>constructor <b>Create</b>(AOwner: TComponent); 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="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="PickItemUpdate"></a><code>function <b>PickItemUpdate</b>(var Item: <a  href="CastleItems.TInventoryItem.html">TInventoryItem</a>): Integer; override;</code></td>
</tr>
<tr><td colspan="2">
<p>
Add Item to inventory, updating player <a class="normal" href="CastlePlayer.TPlayer.html#InventoryCurrentItem">InventoryCurrentItem</a>, making suitable <a class="normal" href="CastlePlayer.TPlayer.html#Notification">notification</a> and sound.</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="DropItem"></a><code>function <b>DropItem</b>(const Index: Integer): <a  href="CastleItems.TItemOnWorld.html">TItemOnWorld</a>; override;</code></td>
</tr>
<tr><td colspan="2">
<p>
Drop item from inventory, updating player <a class="normal" href="CastlePlayer.TPlayer.html#InventoryCurrentItem">InventoryCurrentItem</a>, making suitable <a class="normal" href="CastlePlayer.TPlayer.html#Notification">notification</a> and sound. </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="DropCurrentItem"></a><code>function <b>DropCurrentItem</b>: <a  href="CastleItems.TItemOnWorld.html">TItemOnWorld</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="UseItem"></a><code>procedure <b>UseItem</b>(const Index: Integer); override;</code></td>
</tr>
<tr><td colspan="2">
<p>
Use an item from inventory. You can pass Index that is out of range (or call <a class="normal" href="CastlePlayer.TPlayer.html#UseCurrentItem">UseCurrentItem</a> when <a class="normal" href="CastlePlayer.TPlayer.html#InventoryCurrentItem">InventoryCurrentItem</a> = -1), it will then show a <a class="normal" href="CastlePlayer.TPlayer.html#Notification">notification</a> (by <a class="normal" href="CastleGameNotifications.html">CastleGameNotifications</a> unit) that nothing is selected. </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="UseCurrentItem"></a><code>procedure <b>UseCurrentItem</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="ChangeInventoryCurrentItem"></a><code>procedure <b>ChangeInventoryCurrentItem</b>(Change: Integer);</code></td>
</tr>
<tr><td colspan="2">
<p>
Change <a class="normal" href="CastlePlayer.TPlayer.html#InventoryCurrentItem">InventoryCurrentItem</a>, cycling, and automatically showing the inventory afterwards (if it's not empty). Note that you can also always directly change <a class="normal" href="CastlePlayer.TPlayer.html#InventoryCurrentItem">InventoryCurrentItem</a> property.</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="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">
&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="Middle"></a><code>function <b>Middle</b>: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; 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="FadeOut"></a><code>procedure <b>FadeOut</b>(const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>);</code></td>
</tr>
<tr><td colspan="2">
<p>
Cause a fade-out effect on the screen, tinting the screen to the given Color. The <a class="normal" href="CastlePlayer.TPlayer.html">TPlayer</a> class doesn't do the actual drawing of the fade-out effect on the screen, we merely store and animate the <a class="normal" href="CastlePlayer.TPlayer.html#FadeOutColor">FadeOutColor</a> and <a class="normal" href="CastlePlayer.TPlayer.html#FadeOutIntensity">FadeOutIntensity</a> properties. To draw the effect, use a procedure like <a class="normal" href="CastleGLUtils.html#GLFadeRectangle">GLFadeRectangle</a> inside your 2D controls drawing code, see engine tutorial for example.</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="Attack"></a><code>procedure <b>Attack</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="LoadFromFile"></a><code>procedure <b>LoadFromFile</b>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Load various player properties from an XML file. Properties not specified in the indicated file will be reset to their default values. This is handy to use in a game to allow to configure player behavior by simply editing an XML file (instead of hacking code).

<p>Overloaded parameterless version reads from file <code><a class="normal" href="CastleFilesUtils.html#ApplicationData">ApplicationData</a>('player.xml')</code>.

<p>Note that the indicated file may not exist, and it will not cause errors. Not existing file is equivalent to a file with everything set at default values.

<p>It is Ok to call this multiple times, at any moment. This way you can make some debug command to reload player.xml file, very useful to test various player properties without restarting the game.

<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="LoadFromFile"></a><code>procedure <b>LoadFromFile</b>(const URL: string);</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="Ground"></a><code>function <b>Ground</b>: <a  href="X3DTriangles.html#PTriangle">PTriangle</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="LevelChanged"></a><code>procedure <b>LevelChanged</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="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">
&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="Sphere"></a><code>function <b>Sphere</b>(out Radius: Single): boolean; 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="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">
&nbsp;</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="Flying"></a><code>property <b>Flying</b>: boolean read FFlying write SetFlying;</code></td>
</tr>
<tr><td colspan="2">
<p>
Flying. How it interacts with <a class="normal" href="CastlePlayer.TPlayer.html#FlyingTimeOut">FlyingTimeout</a>: Setting this property to any value removes any timeout set by <a class="normal" href="CastlePlayer.TPlayer.html#FlyingTimeOut">FlyingTimeout</a>. That is, setting this to <code>True</code> makes player fly indefinitely, and setting this to <code>False</code> makes player stop flying (regardless if flying was initialized by <code>Flying := true</code> or <code><a class="normal" href="CastlePlayer.TPlayer.html#FlyingTimeOut">FlyingTimeout</a></code>).</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="FlyingTimeOut"></a><code>property <b>FlyingTimeOut</b>: <a  href="CastleTimeUtils.html#TFloatTime">TFloatTime</a> read FFlyingTimeOut write SetFlyingTimeOut;</code></td>
</tr>
<tr><td colspan="2">
<p>
Set this to something &gt; 0 to start flying for a given number of seconds. The <a class="normal" href="CastlePlayer.TPlayer.html#Flying">Flying</a> property will also change to <code>True</code> for this time. It will automatically change back to <code>False</code> after given number of seconds (you can also always just manually switch <a class="normal" href="CastlePlayer.TPlayer.html#Flying">Flying</a> back to <code>False</code>).

<p>Set this only with value &gt; 0.

<p>When this is &gt; 0 it means flying with a timeout (always <a class="normal" href="CastlePlayer.TPlayer.html#Flying">Flying</a> = <code>True</code> then), otherwise it's = 0 (which means were not flying, or flying indefinitely long, depending on <a class="normal" href="CastlePlayer.TPlayer.html#Flying">Flying</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="EquippedWeapon"></a><code>property <b>EquippedWeapon</b>: <a  href="CastleItems.TItemWeapon.html">TItemWeapon</a> read FEquippedWeapon write SetEquippedWeapon;</code></td>
</tr>
<tr><td colspan="2">
<p>
Weapon the player is using right now, or nil if none.

<p>You can set this property only to some item existing on Inventory. When you drop the current weapon, DeleteItem will automatically set this to <code>Nil</code>.

<p>When setting this property (to nil or non-nil) player may get GameMessage about using/not using a weapon.</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="FadeOutColor"></a><code>property <b>FadeOutColor</b>: <a  href="CastleColors.html#TCastleColor">TCastleColor</a> read FFadeOutColor;</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="FadeOutIntensity"></a><code>property <b>FadeOutIntensity</b>: Single read FFadeOutIntensity;</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="Swimming"></a><code>property <b>Swimming</b>: <a  href="CastlePlayer.html#TPlayerSwimming">TPlayerSwimming</a> read FSwimming write SetSwimming;</code></td>
</tr>
<tr><td colspan="2">
<p>
You should set this property as appropriate. This object will just use this property (changing it's Camera properties etc.).</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="InventoryCurrentItem"></a><code>property <b>InventoryCurrentItem</b>: Integer
      read FInventoryCurrentItem write FInventoryCurrentItem
      default -1;</code></td>
</tr>
<tr><td colspan="2">
<p>
Currently selected inventory item.

<p>Note: while we try to always sensibly update <code>InventoryCurrentItem</code>, to keep the assumptions that </p>

<ol class="paragraph_spacing">
  <li value="1"><p>Inventory.Count = 0 =&gt; <code>InventoryCurrentItem</code> = -1</p></li>
  <li value="2"><p>Inventory.Count &gt; 0 =&gt; <code>InventoryCurrentItem</code> between 0 and Inventory.Count - 1</p></li>
</ol>

<p>

<p>but you should <i>nowhere</i> depend on these assuptions. That's because I want to allow myself freedom to modify Inventory in various situations, so <code>InventoryCurrentItem</code> can become invalid in many situations.

<p>So every code should check that </p>

<ul class="paragraph_spacing">
  <li><p>If <code>InventoryCurrentItem</code> between 0 and Inventory.Count - 1 then <code>InventoryCurrentItem</code> is selected</p></li>
  <li><p>Else no item is selected (possibly Inventory.Count = 0, possibly not)</p></li>
</ul>

<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="InventoryVisible"></a><code>property <b>InventoryVisible</b>: boolean
      read FInventoryVisible write FInventoryVisible default false;</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="SickProjectionSpeed"></a><code>property <b>SickProjectionSpeed</b>: Single
      read FSickProjectionSpeed write FSickProjectionSpeed
      default <a  href="CastlePlayer.TPlayer.html#DefaultSickProjectionSpeed">DefaultSickProjectionSpeed</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="CollidesWithMoving"></a><code>property <b>CollidesWithMoving</b> default 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="Blocked"></a><code>property <b>Blocked</b>: boolean read FBlocked write FBlocked;</code></td>
</tr>
<tr><td colspan="2">
<p>
Disables changing the camera by user. It's useful when you want to temporarily force camera to some specific setting (you can even use handy Player.Camera.AnimateTo method to do this easily, see TWalkCamera.AnimateTo).</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="RenderOnTop"></a><code>property <b>RenderOnTop</b>: boolean read FRenderOnTop write FRenderOnTop
      default <a  href="CastlePlayer.TPlayer.html#DefaultRenderOnTop">DefaultRenderOnTop</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Render 3D children (like <a class="normal" href="CastlePlayer.TPlayer.html#EquippedWeapon">EquippedWeapon</a>) on top of everything else.</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="FallMinHeightToSound"></a><code>property <b>FallMinHeightToSound</b>: Single
      read FFallMinHeightToSound write FFallMinHeightToSound default <a  href="Castle3D.html#DefaultPlayerFallMinHeightToSound">DefaultPlayerFallMinHeightToSound</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="FallMinHeightToDamage"></a><code>property <b>FallMinHeightToDamage</b>: Single
      read FFallMinHeightToDamage write FFallMinHeightToDamage default <a  href="Castle3D.html#DefaultFallMinHeightToDamage">DefaultFallMinHeightToDamage</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="FallDamageScaleMin"></a><code>property <b>FallDamageScaleMin</b>: Single
      read FFallDamageScaleMin write FFallDamageScaleMin default <a  href="Castle3D.html#DefaultFallDamageScaleMin">DefaultFallDamageScaleMin</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="FallDamageScaleMax"></a><code>property <b>FallDamageScaleMax</b>: Single
      read FFallDamageScaleMax write FFallDamageScaleMax default <a  href="Castle3D.html#DefaultFallDamageScaleMax">DefaultFallDamageScaleMax</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="FallSound"></a><code>property <b>FallSound</b>: <a  href="CastleSoundEngine.html#TSoundType">TSoundType</a>
      read FFallSound write FFallSound;</code></td>
</tr>
<tr><td colspan="2">
<p>
Sound when falling. The default is the sound named 'player_fall'.</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="HeadBobbing"></a><code>property <b>HeadBobbing</b>: Single
      read FHeadBobbing write FHeadBobbing default <a  href="CastleCameras.TWalkCamera.html#DefaultHeadBobbing">TWalkCamera.DefaultHeadBobbing</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Controls head bobbing, but only when player is walking. See <a class="normal" href="CastleCameras.TWalkCamera.html#HeadBobbing">TWalkCamera.HeadBobbing</a> for exact meaning of this. TPlayer.Camera.HeadBobbing is automatically updated as necessary.

<p>Note that when using <a class="normal" href="CastleLevels.html">CastleLevels</a>, then the <code>headBobbing</code> defined inside VRML/X3D file (see <a  href="http://castle-engine.sourceforge.net/x3d_extensions.php#section_ext_head_bobbing">http://castle-engine.sourceforge.net/x3d_extensions.php#section_ext_head_bobbing</a> ) is ignored. Instead, Player properties control <a class="normal" href="CastleCameras.TWalkCamera.html#HeadBobbing">TWalkCamera.HeadBobbing</a> and <a class="normal" href="CastleCameras.TWalkCamera.html#HeadBobbingTime">TWalkCamera.HeadBobbingTime</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="SwimBreath"></a><code>property <b>SwimBreath</b>: Single read FSwimBreath write FSwimBreath default <a  href="CastlePlayer.TPlayer.html#DefaultSwimBreath">DefaultSwimBreath</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
How many seconds you can swin before you start to drown.</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="DrownPause"></a><code>property <b>DrownPause</b>: Single read FDrownPause write FDrownPause default <a  href="CastlePlayer.TPlayer.html#DefaultDrownPause">DefaultDrownPause</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
How many seconds between each drown event. Drown event makes <a class="normal" href="CastleSoundEngine.html#stPlayerDrowning">stPlayerDrowning</a> sound and causes damage <a class="normal" href="CastlePlayer.TPlayer.html#DrownDamageConst">DrownDamageConst</a> + Random * <a class="normal" href="CastlePlayer.TPlayer.html#DrownDamageRandom">DrownDamageRandom</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="DrownDamageConst"></a><code>property <b>DrownDamageConst</b>: Single read FDrownDamageConst write FDrownDamageConst default <a  href="CastlePlayer.TPlayer.html#DefaultDrownDamageConst">DefaultDrownDamageConst</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="DrownDamageRandom"></a><code>property <b>DrownDamageRandom</b>: Single read FDrownDamageRandom write FDrownDamageRandom default <a  href="CastlePlayer.TPlayer.html#DefaultDrownDamageRandom">DefaultDrownDamageRandom</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="SwimSoundPause"></a><code>property <b>SwimSoundPause</b>: Single read FSwimSoundPause write FSwimSoundPause default <a  href="CastlePlayer.TPlayer.html#DefaultSwimSoundPause">DefaultSwimSoundPause</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Pause, in seconds, between playing <a class="normal" href="CastleSoundEngine.html#stPlayerSwimming">stPlayerSwimming</a> sound. This should be something that is not easily synchronized with SwimDrownPause.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><a name="KnockBackSpeed"></a><code>property <b>KnockBackSpeed</b> default DefaultPlayerKnockBackSpeed;</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="published.gif" alt="Published" title="Published"></a></td>
<td class="itemcode"><a name="EnableCameraDragging"></a><code>property <b>EnableCameraDragging</b>: boolean
      read FEnableCameraDragging write SetEnableCameraDragging default false;</code></td>
</tr>
<tr><td colspan="2">
<p>
Enable camera navigation by dragging. This results in including ciMouseDragging in <a class="normal" href="CastleCameras.TCamera.html#Input">TCamera.Input</a> (when player is not <a class="normal" href="Castle3D.T3DAlive.html#Dead">Dead</a> or <a class="normal" href="CastlePlayer.TPlayer.html#Blocked">Blocked</a>).</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:10</em>
</span>
</td></tr></table></body></html>