Class Path3D
Hierarchy
- Path3D
Index
Constructors
constructor
new Path3D(path, normal, raw) Creates a Path3D. A Path3D is a logical math object, so not a mesh. please read the description in the tutorial : https://doc.babylonjs.com/how_to/how_to_use_path3d
Parameters
path: Vector3[]
an array of Vector3, the curve axis of the Path3D
Optional firstNormal: Nullable<Vector3>
(options) Vector3, the first wanted normal to the curve. Ex (0, 1, 0) for a vertical normal.
Optional raw: boolean
(optional, default false) : boolean, if true the returned Path3D isn't normalized. Useful to depict path acceleration or speed.
Optional alignTangentsWithPath: boolean
(optional, default false) : boolean, if true the tangents will be aligned with the path.
Returns Path3D
Properties
pathSearch playground for path
an array of Vector3, the curve axis of the Path3D
Methods
get Binormal AtSearch playground for getBinormalAt
Returns the binormal vector of an interpolated Path3D curve point at the specified position along this path.
Parameters
position: number
the position of the point along this path, from 0.0 to 1.0
Optional interpolated: boolean
(optional, default false) : boolean, if true returns an interpolated binormal instead of the binormal of the previous path point.
Returns Vector3
a binormal vector corresponding to the interpolated Path3D curve point, if not interpolated, the binormal is taken from the precomputed binormals array.
get BinormalsSearch playground for getBinormals
Returns an array populated with binormal vectors on each Path3D curve point.
Returns Vector3[]
an array populated with binormal vectors on each Path3D curve point.
get Closest Position ToSearch playground for getClosestPositionTo
Returns the position of the closest virtual point on this path to an arbitrary Vector3, from 0.0 to 1.0
Parameters
target: Vector3
the vector of which to get the closest position to
Returns number
the position of the closest virtual point on this path to the target vector
get CurveSearch playground for getCurve
Returns the Path3D array of successive Vector3 designing its curve.
Returns Vector3[]
the Path3D array of successive Vector3 designing its curve.
get Distance AtSearch playground for getDistanceAt
Returns the distance (float) of an interpolated Path3D curve point at the specified position along this path.
Parameters
position: number
the position of the point along this path, from 0.0 to 1.0
Returns number
the distance of the interpolated Path3D curve point at the specified position along this path.
get DistancesSearch playground for getDistances
Returns an array populated with distances (float) of the i-th point from the first curve point.
Returns number[]
an array populated with distances (float) of the i-th point from the first curve point.
get Normal AtSearch playground for getNormalAt
Returns the tangent vector of an interpolated Path3D curve point at the specified position along this path.
Parameters
position: number
the position of the point along this path, from 0.0 to 1.0
Optional interpolated: boolean
(optional, default false) : boolean, if true returns an interpolated normal instead of the normal of the previous path point.
Returns Vector3
a normal vector corresponding to the interpolated Path3D curve point, if not interpolated, the normal is taken from the precomputed normals array.
get NormalsSearch playground for getNormals
Returns an array populated with normal vectors on each Path3D curve point.
Returns Vector3[]
an array populated with normal vectors on each Path3D curve point.
get Point AtSearch playground for getPointAt
Returns an interpolated point along this path
Parameters
position: number
the position of the point along this path, from 0.0 to 1.0
Returns Vector3
a new Vector3 as the point
get PointsSearch playground for getPoints
Returns the Path3D array of successive Vector3 designing its curve.
Returns Vector3[]
the Path3D array of successive Vector3 designing its curve.
get Previous Point Index AtSearch playground for getPreviousPointIndexAt
Returns the array index of the previous point of an interpolated point along this path
Parameters
position: number
the position of the point to interpolate along this path, from 0.0 to 1.0
Returns number
the array index
get Sub Position AtSearch playground for getSubPositionAt
Returns the position of an interpolated point relative to the two path points it lies between, from 0.0 (point A) to 1.0 (point B)
Parameters
position: number
the position of the point to interpolate along this path, from 0.0 to 1.0
Returns number
the sub position
get Tangent AtSearch playground for getTangentAt
Returns the tangent vector of an interpolated Path3D curve point at the specified position along this path.
Parameters
position: number
the position of the point along this path, from 0.0 to 1.0
Optional interpolated: boolean
(optional, default false) : boolean, if true returns an interpolated tangent instead of the tangent of the previous path point.
Returns Vector3
a tangent vector corresponding to the interpolated Path3D curve point, if not interpolated, the tangent is taken from the precomputed tangents array.
get TangentsSearch playground for getTangents
Returns an array populated with tangent vectors on each Path3D curve point.
Returns Vector3[]
an array populated with tangent vectors on each Path3D curve point.
lengthSearch playground for length
Returns number
the computed length (float) of the path.
sliceSearch playground for slice
Returns a sub path (slice) of this path
Parameters
Optional start: number
the position of the fist path point, from 0.0 to 1.0, or a negative value, which will get wrapped around from the end of the path to 0.0 to 1.0 values
Optional end: number
the position of the last path point, from 0.0 to 1.0, or a negative value, which will get wrapped around from the end of the path to 0.0 to 1.0 values
Returns Path3D
a sub path (slice) of this path
updateSearch playground for update
Forces the Path3D tangent, normal, binormal and distance recomputation.
Parameters
path: Vector3[]
path which all values are copied into the curves points
Optional firstNormal: Nullable<Vector3>
which should be projected onto the curve
Optional alignTangentsWithPath: boolean
(optional, default false) : boolean, if true the tangents will be aligned with the path
Returns Path3D
the same object updated.
Represents a 3D path made up of multiple 3D points
https://doc.babylonjs.com/divingDeeper/mesh/path3D