Class TCastleLinearMoving

Unit

Declaration

type TCastleLinearMoving = class(TCastleMoving)

Description

Transform moving with constant speed between 2 points. Moves with a constant speed from (0, 0, 0) to TranslationEnd. They are called begin position and end position.

This is a simplified, more comfortable descendant of TCastleMoving. You get easy to use GoBeginPosition, GoEndPosition properties, you can easily set sounds by SoundGoBeginPosition and SoundGoEndPosition and such.

Hierarchy

Overview

Fields

Public MoveTime: Single;
Public TranslationEnd: TVector3;

Methods

Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public function CompletelyEndPosition: boolean;
Public function CompletelyBeginPosition: boolean;
Public procedure GoBeginPosition;
Public procedure GoEndPosition;
Public procedure RevertGoEndPosition;
Public procedure RevertGoBeginPosition;
Public procedure GoOtherPosition;
Public function GetTranslationFromTime(const AnAnimationTime: TFloatTime): TVector3; override;
Public procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override;

Properties

Public property EndPosition: boolean read FEndPosition;
Public property EndPositionStateChangeTime: Single read FEndPositionStateChangeTime;
Public property SoundGoBeginPosition: TSoundType read FSoundGoBeginPosition write FSoundGoBeginPosition;
Public property SoundGoEndPosition: TSoundType read FSoundGoEndPosition write FSoundGoEndPosition;
Public property SoundGoBeginPositionLooping: boolean read FSoundGoBeginPositionLooping write FSoundGoBeginPositionLooping default false;
Public property SoundGoEndPositionLooping: boolean read FSoundGoEndPositionLooping write FSoundGoEndPositionLooping default false;
Public property SoundTracksCurrentPosition: boolean read FSoundTracksCurrentPosition write FSoundTracksCurrentPosition default false;

Description

Fields

Public MoveTime: Single;
 
Public TranslationEnd: TVector3;
 

Methods

Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; override;
 
Public function CompletelyEndPosition: boolean;
 
Public function CompletelyBeginPosition: boolean;
 
Public procedure GoBeginPosition;

Start going to begin position, assuming that currently we're in end position (i.e. CompletelyEndPosion).

Public procedure GoEndPosition;

Start going to end position, assuming that currently we're in begin position (i.e. CompletelyBeginPosion).

Public procedure RevertGoEndPosition;

Stop going from end position to begin position and go back to end position. Call this only when currently EndPosition is False and we were in the middle of going to begin position.

As an example, this is what happens when door on DOOM level gets blocked. In the middle of closing (which is going to begin position) it will realize that something blocks it, and open back (go back to end position).

Public procedure RevertGoBeginPosition;

Just like RevertGoEndPosition, but this should be used in the middle of the move from begin position to end position, to go back to begin position.

Public procedure GoOtherPosition;

This goes to the other position. Which means that if we're completely in end position or in the middle of move to end position, this goes back to begin position. And if we're in begin position, this goes back to end position.

Public function GetTranslationFromTime(const AnAnimationTime: TFloatTime): TVector3; override;
 
Public procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override;
 

Properties

Public property EndPosition: boolean read FEndPosition;

Is this object in end position, or going to it. If False, then this object is in begin position or going to it. See also CompletelyEndPosion and CompletelyBeginPosition.

Initially this is False, and EndPositionStateChangeTime is set such that we're sure that we're in CompletelyBeginPosion,

Public property EndPositionStateChangeTime: Single read FEndPositionStateChangeTime;

Last time EndPosition changed.

Public property SoundGoBeginPosition: TSoundType read FSoundGoBeginPosition write FSoundGoBeginPosition;
 
Public property SoundGoEndPosition: TSoundType read FSoundGoEndPosition write FSoundGoEndPosition;
 
Public property SoundGoBeginPositionLooping: boolean read FSoundGoBeginPositionLooping write FSoundGoBeginPositionLooping default false;
 
Public property SoundGoEndPositionLooping: boolean read FSoundGoEndPositionLooping write FSoundGoEndPositionLooping default false;
 
Public property SoundTracksCurrentPosition: boolean read FSoundTracksCurrentPosition write FSoundTracksCurrentPosition default false;

If True then the sound (set by SoundGoBeginPosition or SoundGoEndPosition) 3D position changes as the 3D position of the object changes.

Otherwise (default) sound is initially made at initial 3D position of this object, and then the sound position doesn't change (even if the position of the object changes).


Generated by PasDoc 0.15.0.