Class TCreature
Unit
CastleCreatures
Declaration
type TCreature = class(TAlive)
Description
Base creature, using any TCreatureResource.
Hierarchy
Overview
Fields
Methods
Properties
Description
Fields
 |
class var RenderDebug: boolean; |
Render debug bounding boxes and captions at every creature.
|
Methods
 |
procedure SetLife(const Value: Single); override; |
|
 |
procedure Fall(const FallHeight: Single); override; |
|
 |
function LerpLegsMiddle(const A: Single): TVector3; |
LerpLegsMiddle interpolates between Position and Middle (intuitively, legs and eye positions).
|
 |
procedure AttackHurt(const HurtEnemy: TAlive); |
Hurt given enemy. HurtEnemy may be Nil , in this case we do nothing.
|
 |
constructor Create(AOwner: TComponent; const AMaxLife: Single); virtual; reintroduce; |
|
 |
destructor Destroy; override; |
|
 |
function GetExists: boolean; override; |
|
 |
function GetCollides: boolean; override; |
|
 |
procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override; |
|
 |
procedure Sound3d(const SoundType: TSoundType; const SoundHeight: Single; TiedToCreature: boolean = true); |
Play SoundType where the creature's position is.
Exactly, the position is between Position and Middle — SoundHeight = 0 means Position, SoundHeight = 1 means Middle, SoundHeight between means ... well, between Position and Middle. This can also be higher than 1 or lower than 0, should be treated like lerp between Position and Middle.
If TiedToCreature then the sounds position will be updated as the creature will move, and when the creature object will be destroyed, sound will stop. If not TiedToCreature, then the sound will simply be done at creature's position, but then it will continue to be played independent of this creature.
|
 |
function Sphere(out ARadius: Single): boolean; override; |
Can the approximate sphere be used for some collision-detection tasks.
Set to False in descendants if Resource.Radius is not appropriate for this creature state.
In this class, this is implemented to return not Dead . This is usually sensible, since only alive creatures need bounding sphere advantages (stairs climbing), and using sphere with dead creatures would unnecessarily force the sphere radius to be small and Middle to be high.
|
 |
function Radius: Single; |
Sphere radius for collision detection for alive creatures. Must be something <> 0 for collision detection to work.
See also
- TCreatureResource.Radius
- Sphere radius for collision detection for alive creatures.
|
Properties
 |
property SoundDieEnabled: boolean read FSoundDieEnabled
write FSoundDieEnabled default true; |
You can set this to False to force the creature to die without making any sound. This is really seldom needed, usefull only to avoid a loud shriek noise when you kill many creatures at once. Primarily for use by debug menu "kill all creatures" and similar things.
|
 |
property CollidesWithMoving default true; |
|
Generated by PasDoc 0.15.0.
|