Русский | English

Class TCastleLine2D

Unit

Declaration

type TCastleLine2D = class(TCastleLine2DBase)

Description

A polyline consists of rectangles. Has different connection methods for rectangles, various options for the beginning and end of the line.
To enter edit mode, use "verb" (Edit mode ON) - right-click on the object in the object hierarchy window.

Hierarchy

Overview

Fields

Protected FTexY:single;
Protected FTexX:single;

Methods

Protected procedure ChangedTransform; override;
Protected procedure AddGeometryBeginEnd(const BeginOrEnd:PBeginEndMode; var GList:TVector2List; const A,B,Opposite:TVector2); virtual;
Protected procedure SetTexCoordMode(cm:TLineTexCoordMode);
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure ReLoad; override;
Public function PropertySections(const PropertyName: String): TPropertySections; override;

Properties

Published property JoinMode: TJoinMode read FJoinMode write SetJoinMode default jmBevel;
Published property JoinRoundPrecision: integer read FJoinRoundPrecision write SetJoinRoundPrecision default 4;
Published property JoinSharpLimitRad: single read FJoinSharpLimitRad write SetJoinSharpLimitRad default 0;
Published property JoinBeginMode: TBeginEndMode read FBeginMode write SetBeginMode default bmNone;
Published property JoinEndMode: TBeginEndMode read FEndMode write SetEndMode default bmNone;
Published property LineWidth: Single read FLineWidth write SetLineWidth default 10;
Published property TexCoordMode: TLineTexCoordMode read FTexCoordMode write SetTexCoordMode default cmDefault;
Published property JoinTexCoordMode: TJoinTexCoordMode read FJoinTexCoordMode write FJoinTexCoordMode default jcmCrop;

Description

Fields

Protected FTexY:single;

Coefficient for correct texture mapping. Determines which part of the texture along the Y axis should be used. When TexCoordMode=cmLine is 1. When TexCoordMode=cmBeginEndLine is 0.5

Protected FTexX:single;

X-axis coefficient for correct texture mapping. Usually equal to (Texture height)/(Line width*Texture width)

Methods

Protected procedure ChangedTransform; override;
 
Protected procedure AddGeometryBeginEnd(const BeginOrEnd:PBeginEndMode; var GList:TVector2List; const A,B,Opposite:TVector2); virtual;

Add the geometry of the beginning and end of the line. A,B - the segment where the geometry is attached.
Opposite - the geometry will be built in the opposite direction from this point.
GList - you need to add geometry here.
BeginOrEnd - pointer to TCastleLine2D.JoinBeginMode or to TCastleLine2D.JoinEndMode.
Inherited classes should override the method if a new geometry needs to be added.

Protected procedure SetTexCoordMode(cm:TLineTexCoordMode);

Sets the TCastleLine2D.TexCoordMode and TCastleLine2D.FTexY and TCastleLine2D.FTexX.

Public constructor Create(AOwner: TComponent); override;

When created in the CGE editor, creates a line of two points. When creating directly in the code (RunTime), points are not added.

Public destructor Destroy; override;
 
Public procedure ReLoad; override;
 
Public function PropertySections(const PropertyName: String): TPropertySections; override;
 

Properties

Published property JoinMode: TJoinMode read FJoinMode write SetJoinMode default jmBevel;

Connection type for rectangles in a line

Published property JoinRoundPrecision: integer read FJoinRoundPrecision write SetJoinRoundPrecision default 4;

The number of segments in the circle sector when JoinMode=jmRound

Published property JoinSharpLimitRad: single read FJoinSharpLimitRad write SetJoinSharpLimitRad default 0;

With this or a smaller angle between the lines, an acute angle is not built. Used when JoinMode=jmSharp

Published property JoinBeginMode: TBeginEndMode read FBeginMode write SetBeginMode default bmNone;

The type of the beginning of the line

Published property JoinEndMode: TBeginEndMode read FEndMode write SetEndMode default bmNone;

The type of the end of the line

Published property LineWidth: Single read FLineWidth write SetLineWidth default 10;

Line width

Published property TexCoordMode: TLineTexCoordMode read FTexCoordMode write SetTexCoordMode default cmDefault;

Method for calculating texture coordinates.
With cmDefault, texture coordinates are set by CGE methods.
With cmLine the line repeats the texture as it lengthens. The texture can be any.
With cmBeginEndLine, different areas of the texture are used for the beginning and end. The texture must be specially prepared.
Examples of textures for cmBeginEndLine: BeginEndLine1 or BeginEndLine2 or BeginEndLine3

Published property JoinTexCoordMode: TJoinTexCoordMode read FJoinTexCoordMode write FJoinTexCoordMode default jcmCrop;

The method for calculating texture coordinates on line bends. When JoinMode=jmSharp is not used.


Generated by PasDoc 0.16.0.