Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.CurveDistanceMapping Class Reference

Curve distance mapping. More...

Inheritance diagram for Dragengine.Scenery.CurveDistanceMapping:

Public Member Functions

Constructors
CurveDistanceMapping new ()
 Create curve distance mapping.
CurveDistanceMapping new (CurveDistanceMapping copy)
 Create curve distance mapping.
Management
float getResolution ()
 Resolution in meters used for sampling.
float getLength ()
 Length of sampled curve in meters.
float map (float distance)
 Get evaluation parameter for distance.
void clear ()
 Clear mapping.
void init (CurveBezier3D curve)
 Initialize mapping using a 3d bezier curve.
void init (CurveBezier3D curve, float resolution, int segmentSamples)
 Initialize mapping using a 3d bezier curve.

Detailed Description

Curve distance mapping.

Samples a curve by distance for evaluating curves on a distance basis instead of local coordinates.

Member Function Documentation

◆ clear()

void Dragengine.Scenery.CurveDistanceMapping.clear ( )

Clear mapping.

References map().

Referenced by init().

◆ getLength()

float Dragengine.Scenery.CurveDistanceMapping.getLength ( )

Length of sampled curve in meters.

Referenced by map().

◆ getResolution()

float Dragengine.Scenery.CurveDistanceMapping.getResolution ( )

Resolution in meters used for sampling.

References getResolution().

Referenced by getResolution().

◆ init() [1/2]

void Dragengine.Scenery.CurveDistanceMapping.init ( CurveBezier3D curve)

Initialize mapping using a 3d bezier curve.

Previous mapping parameters are overwritten. The method chooses resolution and segment sample count by examining the curve before sampling it.

References clear(), and init().

Referenced by init(), and init().

◆ init() [2/2]

void Dragengine.Scenery.CurveDistanceMapping.init ( CurveBezier3D curve,
float resolution,
int segmentSamples )

Initialize mapping using a 3d bezier curve.

Previous mapping parameters are overwritten.

Parameters
curveCurve to sample from.
resolutionSample resolution in meters clamped to 1mm or larger. Smaller values increase memory consumption for the mapping table a lot for long curves. A good value is 0.1 resolution for curves less than 1m and larger for longer curves. Curves which are equally spaced already can use large resolution values while strongly not equally spaced curves require smaller resolution values to give good results.
segmentSamplesNumber of samples to take along curve segments. Higher sample counts increase accuracy of the mapping especially the estimated curve length. Higher sample counts increase processing time but do not increase memory consumption. Curves which are equally spaced can use small sample counts while strongly not equally spaced curves require higher sample counter to give good results. For curves which are mostly equally spaced or close to it a samples count of 10 is a good choice. For not so equally spaced curves higher values of 20 or more may be required.
Exceptions
EInvalidParamsegmentSamples is less than 0.

References init().

◆ map()

float Dragengine.Scenery.CurveDistanceMapping.map ( float distance)

Get evaluation parameter for distance.

References getLength().

Referenced by clear().

◆ new() [1/2]

CurveDistanceMapping Dragengine.Scenery.CurveDistanceMapping.new ( )

Create curve distance mapping.

References new().

Referenced by new(), and new().

◆ new() [2/2]

CurveDistanceMapping Dragengine.Scenery.CurveDistanceMapping.new ( CurveDistanceMapping copy)

Create curve distance mapping.

References new().


The documentation for this class was generated from the following file: