Class TCurve
Unit
CastleCurves
Declaration
type TCurve = class(T3D)
Description
3D curve, a set of points defined by a continous function Point for arguments within [TBegin, TEnd].
Note that some descendants return only an approximate BoundingBox result, it may be too small or too large sometimes. (Maybe at some time I'll make this more rigorous, as some code may require that it's a proper bounding box, maybe too large but never too small.)
Hierarchy
Overview
Methods
Properties
Description
Methods
 |
function Point(const t: Float): TVector3Single; virtual; abstract; |
Curve function, for each parameter value determine the 3D point. This determines the actual shape of the curve.
|
 |
function PointOfSegment(i, Segments: Cardinal): TVector3Single; |
Curve function to work with rendered line segments begin/end points. This is simply a more specialized version of Point, it scales the argument such that you get Point(TBegin) for I = 0 and you get Point(TEnd) for I = Segments.
|
 |
procedure Render(Segments: Cardinal); |
Render curve by dividing it into a given number of line segments. So actually every curve will be rendered as a set of straight lines. You should just give some large number for Segments to have something that will be really smooth.
OpenGL commands:
This method calls glBegin(GL_LINE_STRIP);
Then it calls glVertexv(PointOfSegment(i, Segments)) for i in [0; Segments] (yes, this means that it calls glVertex Segments+1 times).
Then this method calls glEnd.
|
 |
constructor Create(const ATBegin, ATEnd: Float); reintroduce; |
|
Properties
 |
property TBegin: Float read FTBegin; |
The valid range of curve function argument. Must be TBegin <= TEnd.
|
 |
property TEnd: Float read FTEnd; |
|
 |
property DefaultSegments: Cardinal
read FDefaultSegments write FDefaultSegments default 10; |
Default number of segments, used when rendering by T3D interface (that is, Render(Frustum, TransparentGroup...) method.)
|
|