Unit CastleCurves
Description
3D curves (TCurve and basic descendants).
Source: castlescript/castlecurves.pas (line 17).
Uses
- SysUtils
- Classes
- Generics.Collections
- DOM
- CastleVectors
- CastleBoxes
- CastleUtils
- CastleScript
- CastleClassUtils
- CastleFrustum
- X3DNodes
Overview
Classes, Interfaces, Objects and Records
| Name | Description |
|---|---|
Class ECurveFileInvalid |
|
Class TCurve |
3D curve, a set of points defined by a continuous function Point for arguments within [TBegin, TEnd]. |
Class TCurveList |
|
Class TCasScriptCurve |
Curve defined by explicitly giving functions for Point(t) = x(t), y(t), z(t) as CastleScript expressions. |
Class TControlPointsCurve |
A basic abstract class for curves determined my some set of ControlPoints. |
Class TPiecewiseCubicBezier |
Piecewise (composite) cubic Bezier curve. |
Functions and Procedures
function CubicBezier1D(T: Single; const Points: TVector4): Single; |
function CubicBezier2D(T: Single; const Points: TCubicBezier2DPoints): TVector2; |
function CubicBezier3D(T: Single; const Points: TCubicBezier3DPoints): TVector3; |
function CatmullRomSpline(const X: Single; const Loop: boolean; const Arguments: TSingleList; const Values: TSingleList): Single; |
function CatmullRom(const V0, V1, V2, V3, X: Single): Single; |
function HermiteSpline(const X: Single; const Loop: boolean; const Arguments, Values, Tangents: TSingleList): Single; |
function HermiteTenseSpline(const X: Single; const Loop: boolean; const Arguments, Values: TSingleList): Single; |
function ConvexHullIndexes(Points: TVector3List): TIntegerList; |
Types
TControlPointsCurveClass = class of TControlPointsCurve; |
TControlPointsCurveList = specialize TObjectList<TControlPointsCurve>; |
TCubicBezier2DPoints = array [0..3] of TVector2; |
TCubicBezier3DPoints = array [0..3] of TVector3; |
TCubicBezier3DPointsArray = array of TCubicBezier3DPoints; |
Description
Functions and Procedures
function CubicBezier1D(T: Single; const Points: TVector4): Single; |
|
Cubic (4 control points) Bezier curve (with all weights equal) in 1D. |
function CubicBezier2D(T: Single; const Points: TCubicBezier2DPoints): TVector2; |
|
Cubic (4 control points) Bezier curve (with all weights equal) in 2D. |
function CubicBezier3D(T: Single; const Points: TCubicBezier3DPoints): TVector3; |
|
Cubic (4 control points) Bezier curve (with all weights equal) in 3D. |
function CatmullRomSpline(const X: Single; const Loop: boolean; const Arguments: TSingleList; const Values: TSingleList): Single; |
|
Catmull-Rom spline. Nice way to have a function that for certain arguments reaches certain values, and between interpolates smoothly. Catmull-Rom splines are a special case of cubic Hermite splines, see https://en.wikipedia.org/wiki/Cubic_Hermite_spline . |
function CatmullRom(const V0, V1, V2, V3, X: Single): Single; |
|
Catmull-Rom spline low-level function. For X in [0..1], the curve values change from V1 to V2. V0 and V3 are curve values outside the [0..1] range, used to calculate tangents. See http://www.mvps.org/directx/articles/catmull/. See also
|
function HermiteSpline(const X: Single; const Loop: boolean; const Arguments, Values, Tangents: TSingleList): Single; |
|
Hermite spline. Nice way to have a function that for certain arguments reaches certain values, and between interpolates smoothly. Requires specifying tangent values (use CatmullRomSpline or HermiteTenseSpline to use automatic tangents). |
function HermiteTenseSpline(const X: Single; const Loop: boolean; const Arguments, Values: TSingleList): Single; |
|
Hermite spline with tangents zero (it will be horizontal at control points). Nice way to have a function that for certain arguments reaches certain values, and between interpolates smoothly. This is equivalent (for faster) to using HermiteSpline with all tangents equal to zero. This is called a "cardinal spline", a special case of Hermite spline, with all tangents calculated with "tension" parameter equal to 1 (maximum), which means that all tangents are simply zero (horizontal). See https://en.wikipedia.org/wiki/Cubic_Hermite_spline for math behind this. |
function ConvexHullIndexes(Points: TVector3List): TIntegerList; |
|
Calculate the convex hull ignoring Z coordinates of points. That is, all Points[*].Z are ignored. Returns newly created list with the indexes to Points. If you want to draw an edge of convex hull, you want to iterate over these points like (for each i) Points[Result[i]]). The resulting points are in counter-clockwise order (assuming X goes right, Y goes up). Points lying exactly on the hull edges may, or may not, be included in the result. Points.Count must be >= 1. |
Types
TControlPointsCurveClass = class of TControlPointsCurve; |
|
This item has no description. |
TControlPointsCurveList = specialize TObjectList<TControlPointsCurve>; |
|
This item has no description. |
TCubicBezier2DPoints = array [0..3] of TVector2; |
|
This item has no description. |
TCubicBezier3DPoints = array [0..3] of TVector3; |
|
This item has no description. |
TCubicBezier3DPointsArray = array of TCubicBezier3DPoints; |
|
This item has no description. |
Generated by PasDoc 1.0.5.snapshot.