Class TCastleVector3Persistent

Unit

Declaration

type TCastleVector3Persistent = class(TCastleComponent)

Description

TVector3 record represented as a TPersistent descendant, to be able to visually edit it (in Lazarus and Delphi visual designer, and Castle Game Engine visual designer) and to serialize it.

Normal user code does not need to deal with this class or it's instances. Instead directly operate on TVector3 values, which is faster and more natural. TVector3 are simple records, so they are naturally copied on assignment, and various operators like additions work in a natural way too.

Source: src/base/castlevectors_persistent.inc (line 92).

Hierarchy

Overview

Fields

Public InternalGetValue: TGetVector3Event;
Public InternalSetValue: TSetVector3Event;
Public InternalDefaultValue: TVector3;

Methods

Protected procedure Loaded; override;
Public constructor Create(const AOwner: TComponent = nil); reintroduce;
Public function ValueIsStreamed: Boolean; override;
Public function PropertySections(const PropertyName: String): TPropertySections; override;
Public function ToString: String; override;

Properties

Public property Value: TVector3 read GetValue write SetValue;
Published property X: Single read GetX write SetX stored XIsStored nodefault;
Published property Y: Single read GetY write SetY stored YIsStored nodefault;
Published property Z: Single read GetZ write SetZ stored ZIsStored nodefault;

Description

Fields

Public InternalGetValue: TGetVector3Event;

This item has no description.

Source: src/base/castlevectors_persistent.inc (line 118).

Public InternalSetValue: TSetVector3Event;

This item has no description.

Source: src/base/castlevectors_persistent.inc (line 119).

Public InternalDefaultValue: TVector3;

This item has no description.

Source: src/base/castlevectors_persistent.inc (line 120).

Methods

Protected procedure Loaded; override;

This item has no description.

Source: src/base/castlevectors_persistent.inc (line 116).

Public constructor Create(const AOwner: TComponent = nil); reintroduce;

This item has no description.

Source: src/base/castlevectors_persistent.inc (line 121).

Public function ValueIsStreamed: Boolean; override;

This item has no description. Showing description inherited from TCastleComponent.ValueIsStreamed.

Whether the current value of this object should be written to the stream. This should be True if anything inside this object should be serialized (which means it has non-default value or "stored" specifier indicates that it should be serialized).

This is used by CastleComponentSerialize, which is used in Castle Game Engine for all serialization.

In simple cases, this just says whether the current value of this object equals to some default value.

The default implementation of this class returns True (so always write).

Descendants that override this to sometimes return False (so no need to write) must be very careful: any addition of a new field requires extending this method, otherwise new field may not be saved sometimes (when all other fields are default). Descentants of such classes must also be aware of it. This check must include everything that is inside this object in JSON, including subcomponents and children objects (as done e.g. by TSerializationProcess.ReadWriteList). In practice, overriding this method is only reasonable for simple classes that will not change much in the future, like TCastleVector3Persistent.

The name of this method is consistent with TPropertyEditor.ValueIsStreamed in LCL.

Source: src/base/castlevectors_persistent.inc (line 123).

Public function PropertySections(const PropertyName: String): TPropertySections; override;

This item has no description. Showing description inherited from TCastleComponent.PropertySections.

Section where to show property in the editor.

Source: src/base/castlevectors_persistent.inc (line 124).

Public function ToString: String; override;

This item has no description.

Source: src/base/castlevectors_persistent.inc (line 125).

Properties

Public property Value: TVector3 read GetValue write SetValue;

This item has no description.

Source: src/base/castlevectors_persistent.inc (line 122).

Published property X: Single read GetX write SetX stored XIsStored nodefault;

This item has no description.

Source: src/base/castlevectors_persistent.inc (line 127).

Published property Y: Single read GetY write SetY stored YIsStored nodefault;

This item has no description.

Source: src/base/castlevectors_persistent.inc (line 128).

Published property Z: Single read GetZ write SetZ stored ZIsStored nodefault;

This item has no description.

Source: src/base/castlevectors_persistent.inc (line 129).


Generated by PasDoc 0.17.0.snapshot.