Class Curve3
Index
Constructors
constructor
-
A Curve3 object is a logical object, so not a mesh, to handle curves in the 3D geometric space. A Curve3 is designed from a series of successive Vector3. Tuto : https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#curve3-object
Parameters
- points: Vector3[]
points which make up the curve
Returns Curve3
- points: Vector3[]
Methods
continue
-
Returns a new instance of Curve3 object : var curve = curveA.continue(curveB); This new Curve3 is built by translating and sticking the curveB at the end of the curveA. curveA and curveB keep unchanged.
Parameters
- curve: DeepImmutable<Curve3>
the curve to continue from this curve
Returns Curve3
the newly constructed curve
- curve: DeepImmutable<Curve3>
get Points
-
Returns Vector3[]
the Curve3 stored array of successive Vector3
length
-
Returns number
the computed length (float) of the curve.
StaticArc Thru3 Points
-
ArcThru3Points(
first: Vector3,
second: Vector3,
third: Vector3,
steps?: number,
closed?: boolean,
fullCircle?: boolean,
): Curve3Returns a Curve3 object along an arc through three vector3 points: The three points should not be colinear. When they are the Curve3 is empty.
Parameters
- first: Vector3
(Vector3) the first point the arc must pass through.
- second: Vector3
(Vector3) the second point the arc must pass through.
- third: Vector3
(Vector3) the third point the arc must pass through.
- steps: number = 32
(number) the larger the number of steps the more detailed the arc.
- closed: boolean = false
(boolean) optional with default false, when true forms the chord from the first and third point
- fullCircle: boolean = false
Circle (boolean) optional with default false, when true forms the complete circle through the three points
Returns Curve3
the created Curve3
- first: Vector3
StaticCreate Catmull Rom Spline
-
CreateCatmullRomSpline(
points: DeepImmutableArray<Vector3>,
nbPoints: number,
closed?: boolean,
): Curve3Returns a Curve3 object along a CatmullRom Spline curve :
Parameters
- points: DeepImmutableArray<Vector3>
(array of Vector3) the points the spline must pass through. At least, four points required
- nbPoints: number
(integer) the wanted number of points between each curve control points
Optionalclosed: boolean(boolean) optional with default false, when true forms a closed loop from the points
Returns Curve3
the created Curve3
- points: DeepImmutableArray<Vector3>
StaticCreate Cubic Bezier
-
CreateCubicBezier(
v0: DeepImmutable<Vector3>,
v1: DeepImmutable<Vector3>,
v2: DeepImmutable<Vector3>,
v3: DeepImmutable<Vector3>,
nbPoints: number,
): Curve3Returns a Curve3 object along a Cubic Bezier curve : https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#cubic-bezier-curve
Parameters
- v0: DeepImmutable<Vector3>
(Vector3) the origin point of the Cubic Bezier
- v1: DeepImmutable<Vector3>
(Vector3) the first control point
- v2: DeepImmutable<Vector3>
(Vector3) the second control point
- v3: DeepImmutable<Vector3>
(Vector3) the end point of the Cubic Bezier
- nbPoints: number
(integer) the wanted number of points in the curve
Returns Curve3
the created Curve3
- v0: DeepImmutable<Vector3>
StaticCreate Hermite Spline
-
CreateHermiteSpline(
p1: DeepImmutable<Vector3>,
t1: DeepImmutable<Vector3>,
p2: DeepImmutable<Vector3>,
t2: DeepImmutable<Vector3>,
nSeg: number,
): Curve3Returns a Curve3 object along a Hermite Spline curve : https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#hermite-spline
Parameters
- p1: DeepImmutable<Vector3>
(Vector3) the origin point of the Hermite Spline
- t1: DeepImmutable<Vector3>
(Vector3) the tangent vector at the origin point
- p2: DeepImmutable<Vector3>
(Vector3) the end point of the Hermite Spline
- t2: DeepImmutable<Vector3>
(Vector3) the tangent vector at the end point
- nSeg: number
(integer) the number of curve segments or nSeg + 1 points in the array
Returns Curve3
the created Curve3
- p1: DeepImmutable<Vector3>
StaticCreate Quadratic Bezier
-
CreateQuadraticBezier(
v0: DeepImmutable<Vector3>,
v1: DeepImmutable<Vector3>,
v2: DeepImmutable<Vector3>,
nbPoints: number,
): Curve3Returns a Curve3 object along a Quadratic Bezier curve : https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#quadratic-bezier-curve
Parameters
- v0: DeepImmutable<Vector3>
(Vector3) the origin point of the Quadratic Bezier
- v1: DeepImmutable<Vector3>
(Vector3) the control point
- v2: DeepImmutable<Vector3>
(Vector3) the end point of the Quadratic Bezier
- nbPoints: number
(integer) the wanted number of points in the curve
Returns Curve3
the created Curve3
- v0: DeepImmutable<Vector3>
A Curve3 object is a logical object, so not a mesh, to handle curves in the 3D geometric space. A Curve3 is designed from a series of successive Vector3.
See
https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves