Castle Game Engine: CastleCurves: Class TControlPointsCurve

# Class TControlPointsCurve
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleCurves ## Declaration `type TControlPointsCurve = class(TCurve)` ## Description A basic abstract class for curves determined my some set of ControlPoints. Note: it is not defined in this class any correspondence between values of T (argument for Point function) and ControlPoints. ## Hierarchy TComponent T3D TCurve TControlPointsCurve ## Overview ### Fields
| `ControlPoints: TVector3SingleList;`
### Methods
| `function CreateConvexHullPoints: TVector3SingleList; virtual;`
| `procedure DestroyConvexHullPoints(Points: TVector3SingleList); virtual;`
| `procedure RenderControlPoints;`
| `function BoundingBox: TBox3D; override;`
| `procedure UpdateControlPoints; virtual;`
| `class function NiceClassName: string; virtual; abstract;`
| `procedure RenderConvexHull;`
| `constructor Create(AOwner: TComponent); override;`
| `constructor CreateDivideCasScriptCurve(CasScriptCurve: TCasScriptCurve; ControlPointsCount: Cardinal);`
| `destructor Destroy; override;`
### Properties
| `property ControlPointsColor: TCastleColor read FControlPointsColor write FControlPointsColor;`
| `property ConvexHullColor: TCastleColor read FConvexHullColor write FConvexHullColor;`
## Description ### Fields
| `ControlPoints: TVector3SingleList;`
### Methods
| `function CreateConvexHullPoints: TVector3SingleList; virtual;`
Using these function you can control how Convex Hull (for RenderConvexHull) is calculated: `CreateConvexHullPoints` should return points that must be in convex hull (we will run ConvexHull function on those points), DestroyConvexHullPoints should finalize them. This way you can create new object in `CreateConvexHullPoints` and free it in DestroyConvexHullPoints, but you can also give in `CreateConvexHullPoints` reference to some already existing object and do nothing in DestroyConvexHullPoints. (we will not modify object given as `CreateConvexHullPoints` in any way) Default implementation in this class returns ControlPoints as `CreateConvexHullPoints`. (and does nothing in DestroyConvexHullPoints)
| `procedure DestroyConvexHullPoints(Points: TVector3SingleList); virtual;`
| `procedure RenderControlPoints;`
Render control points, using ControlPointsColor.
| `function BoundingBox: TBox3D; override;`
This class provides implementation for `BoundingBox`: it is simply a `BoundingBox` of ControlPoints. Subclasses may (but don't have to) override this to calculate better (more accurate) `BoundingBox`.
| `procedure UpdateControlPoints; virtual;`
Always after changing ControlPoints or TBegin or TEnd and before calling Point, BoundingBox (and anything that calls them, e.g. Render calls Point) call this method. It recalculates necessary things. ControlPoints.Count must be >= 2. When overriding: always call inherited first.
| `class function NiceClassName: string; virtual; abstract;`
Nice class name, with spaces, starts with a capital letter. Much better than ClassName. Especially under FPC 1.0.x where ClassName is always uppercased.
| `procedure RenderConvexHull;`
Render convex hull polygon, using ConvexHullColor. Ignores Z-coord of ControlPoints.
| `constructor Create(AOwner: TComponent); override;`
Constructor. It has to be virtual because it's called by CreateDivideCasScriptCurve.
| `constructor CreateDivideCasScriptCurve(CasScriptCurve: TCasScriptCurve; ControlPointsCount: Cardinal);`
Calculates ControlPoints taking Point(i, ControlPointsCount-1) for i in [0 .. ControlPointsCount-1] from CasScriptCurve. TBegin and TEnd are copied from CasScriptCurve.
| `destructor Destroy; override;`
### Properties
| `property ControlPointsColor: TCastleColor read FControlPointsColor write FControlPointsColor;`
| `property ConvexHullColor: TCastleColor read FConvexHullColor write FConvexHullColor;`
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:09