Panda3D
|
The result of a NurbsCurveEvaluator. More...
Public Member Functions | |
adaptiveSample (float tolerance) | |
Determines the set of subdivisions necessary to approximate the curve with a set of linear segments, no point of which is farther than tolerance units from the actual curve. | |
float | evalExtendedPoint (float t, int d) |
Evaluates the curve in n-dimensional space according to the extended vertices associated with the curve in the indicated dimension. | |
bool | evalPoint (float t, VBase3 point) |
Computes the point on the curve corresponding to the indicated value in parametric time. | |
float | evalSegmentExtendedPoint (int segment, float t, int d) |
Evaluates the curve in n-dimensional space according to the extended vertices associated with the curve in the indicated dimension. | |
evalSegmentPoint (int segment, float t, VBase3 point) | |
Evaluates the point on the curve corresponding to the indicated value in parametric time within the indicated curve segment. | |
evalSegmentTangent (int segment, float t, VBase3 tangent) | |
As eval_segment_point, but computes the tangent to the curve at the indicated point. | |
bool | evalTangent (float t, VBase3 tangent) |
Computes the tangent to the curve at the indicated point in parametric time. | |
float | getEndT () |
Returns the last legal value of t on the curve. | |
int | getNumSamples () |
Returns the number of sample points generated by the previous call to adaptive_sample(). | |
int | getNumSegments () |
Returns the number of piecewise continuous segments within the curve. | |
int | getRefCount () |
Returns the current reference count. | |
Point3 const | getSamplePoint (int n) |
Returns the point on the curve of the nth sample point generated by the previous call to adaptive_sample(). | |
list | getSamplePoints () |
float | getSampleT (int n) |
Returns the t value of the nth sample point generated by the previous call to adaptive_sample(). | |
list | getSampleTs () |
float | getSegmentT (int segment, float t) |
Accepts a t value in the range [0, 1], and assumed to be relative to the indicated segment (as in eval_segment_point()), and returns the corresponding t value in the entire curve (as in eval_point()). | |
float | getStartT () |
Returns the first legal value of t on the curve. | |
ref () | |
Explicitly increments the reference count. | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | testRefCountNonzero () |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
bool | unref () |
Explicitly decrements the reference count. | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
The result of a NurbsCurveEvaluator.
This object represents a curve in a particular coordinate space. It can return the point and/or tangent to the curve at any point.
This is not related to NurbsCurve, CubicCurveseg or any of the ParametricCurve-derived objects in this module. It is a completely parallel implementation of NURBS curves, and will probably eventually replace the whole ParametricCurve class hierarchy.
adaptiveSample | ( | float | tolerance | ) |
Determines the set of subdivisions necessary to approximate the curve with a set of linear segments, no point of which is farther than tolerance units from the actual curve.
After this call, you may walk through the resulting set of samples with get_num_samples(), get_sample_t(), and get_sample_point().
float evalExtendedPoint | ( | float | t, |
int | d | ||
) |
Evaluates the curve in n-dimensional space according to the extended vertices associated with the curve in the indicated dimension.
bool evalPoint | ( | float | t, |
VBase3 | point | ||
) |
Computes the point on the curve corresponding to the indicated value in parametric time.
Returns true if the t value is valid, false otherwise.
Evaluates the curve in n-dimensional space according to the extended vertices associated with the curve in the indicated dimension.
Evaluates the point on the curve corresponding to the indicated value in parametric time within the indicated curve segment.
t should be in the range [0, 1].
The curve is internally represented as a number of connected (or possibly unconnected) piecewise continuous segments. The exact number of segments for a particular curve depends on the knot vector, and is returned by get_num_segments(). Normally, eval_point() is used to evaluate a point along the continuous curve, but when you care more about local continuity, you can use eval_segment_point() to evaluate the points along each segment.
As eval_segment_point, but computes the tangent to the curve at the indicated point.
The tangent vector will not necessarily be normalized, and could be zero, particularly at the endpoints.
bool evalTangent | ( | float | t, |
VBase3 | tangent | ||
) |
Computes the tangent to the curve at the indicated point in parametric time.
This tangent vector will not necessarily be normalized, and could be zero. See also eval_point().
static TypeHandle getClassType | ( | ) | [static, inherited] |
Reimplemented in NodeReferenceCount, TypedReferenceCount, VirtualFile, VirtualFileComposite, VirtualFileMount, VirtualFileMountMultifile, VirtualFileMountSystem, VirtualFileSimple, HTTPChannel, VirtualFileHTTP, VirtualFileMountHTTP, VrpnClient, ClientBase, PGItem, PandaNode, PGButton, PGTop, PGEntry, PGMouseWatcherBackground, MouseWatcherRegion, PGMouseWatcherParameter, TypedWritableReferenceCount, PGVirtualFrame, PGSliderBar, PGScrollFrame, PGWaitBar, FilterProperties, AudioSound, AudioManager, BamCacheRecord, CallbackObject, CachedTypedWritableReferenceCount, ClockObject, CopyOnWriteObject, NodeCachedReferenceCount, PythonCallbackObject, LerpFunctor, IntLerpFunctor, FloatLerpFunctor, SimpleLerpFunctorPoint2, SimpleLerpFunctorPoint3, SimpleLerpFunctorPoint4, SimpleLerpFunctorVBase2, SimpleLerpFunctorVBase3, SimpleLerpFunctorVBase4, SimpleLerpFunctorVec2, SimpleLerpFunctorVec3, SimpleLerpFunctorVec4, IntQueryLerpFunctor, FloatQueryLerpFunctor, SimpleQueryLerpFunctorPoint2, SimpleQueryLerpFunctorPoint3, SimpleQueryLerpFunctorPoint4, SimpleQueryLerpFunctorVBase2, SimpleQueryLerpFunctorVBase3, SimpleQueryLerpFunctorVBase4, SimpleQueryLerpFunctorVec2, SimpleQueryLerpFunctorVec3, SimpleQueryLerpFunctorVec4, MultiLerpFunctor, LerpBlendType, EaseInBlendType, EaseOutBlendType, EaseInOutBlendType, NoBlendType, Lerp, AutonomousLerp, ButtonThrower, DataNode, MouseInterfaceNode, DriveInterface, MouseSubregion, MouseWatcherGroup, MouseWatcher, Trackball, Transform2SG, TextFont, DynamicTextPage, Texture, DynamicTextFont, GeomTextGlyph, Geom, StaticTextFont, TextNode, ParametricCurve, CubicCurveseg, PiecewiseCurve, HermiteCurve, NurbsCurve, RopeNode, SheetNode, BoundingVolume, GeometricBoundingVolume, FiniteBoundingVolume, BoundingBox, BoundingHexahedron, BoundingLine, BoundingPlane, BoundingSphere, OmniBoundingVolume, DisplayRegionBase, GraphicsOutputBase, GraphicsStateGuardianBase, InternalName, GeomVertexArrayFormat, GeomVertexFormat, GeomVertexArrayData, GeomVertexArrayDataHandle, VertexTransform, TransformTable, TransformBlendTable, VertexSlider, SliderTable, GeomVertexData, AnimateVerticesRequest, AsyncTask, GeomPrimitive, TextureStage, GeomLines, GeomLinestrips, GeomPoints, GeomTriangles, GeomTrifans, GeomTristrips, Material, Lens, OrthographicLens, MatrixLens, PerspectiveLens, Shader, TextureReloadRequest, UserVertexSlider, UserVertexTransform, VideoTexture, AsyncTaskBase, AsyncTaskChain, AsyncTaskManager, AsyncTaskPause, AsyncTaskSequence, EventStoreValueBase, EventStoreTypedRefCount, Event, PointerEventList, PythonTask, Thread, ExternalThread, MainThread, PythonThread, WindowHandle.OSHandle, WindowHandle, OSHandle, DisplayRegion, GraphicsDevice, GraphicsPipe, GraphicsStateGuardian, StereoDisplayRegion, GraphicsOutput, GraphicsBuffer, GraphicsWindow, NativeWindowHandle, ParasiteBuffer, AnalogNode, ButtonNode, DialNode, MouseAndKeyboard, TrackerNode, VirtualMouse, CollisionHandler, CollisionSolid, CollisionNode, CollisionEntry, CollisionHandlerEvent, CollisionHandlerHighestEvent, CollisionHandlerPhysical, CollisionHandlerFloor, CollisionHandlerGravity, CollisionHandlerPusher, CollisionHandlerFluidPusher, CollisionHandlerQueue, CollisionDSSolid, CollisionBox, CollisionSphere, CollisionInvSphere, CollisionRay, CollisionLine, CollisionPlane, CollisionPolygon, CollisionParabola, CollisionFloorMesh, CollisionSegment, CollisionTube, CollisionVisualizer, CharacterJoint, MovingPartMatrix, CharacterSlider, MovingPartScalar, CharacterVertexSlider, JointVertexTransform, Character, PartBundleNode, CharacterJointBundle, PartBundle, CharacterJointEffect, RenderEffect, AnimGroup, AnimBundle, AnimBundleNode, PartGroup, AnimControl, AnimChannelBase, AnimChannelACMatrixSwitchType, AnimChannelACScalarSwitchType, AnimChannelMatrixDynamic, AnimChannelMatrixXfmTable, AnimChannelScalarDynamic, AnimChannelScalarTable, AnimPreloadTable, BindAnimRequest, ModelLoadRequest, MovingPartBase, MovingPartACMatrixSwitchType, MovingPartACScalarSwitchType, FFMpegTexture, FrameRateMeter, SceneGraphAnalyzerMeter, MovieTexture, NodeVertexTransform, RigidBodyCombiner, PipeOcclusionCullTraverser, CullTraverser, MovieVideo, MovieVideoCursor, MovieAudio, MovieAudioCursor, InkblotVideo, InkblotVideoCursor, FfmpegVideo, FfmpegVideoCursor, FfmpegAudio, FfmpegAudioCursor, MicrophoneAudio, UserDataAudio, UserDataAudioCursor, TransformState, RenderAttrib, RenderModeAttrib, TexMatrixAttrib, RenderState, AlphaTestAttrib, AntialiasAttrib, RenderEffects, TransparencyAttrib, AudioVolumeAttrib, AuxBitplaneAttrib, AuxSceneData, BillboardEffect, LensNode, Camera, PlaneNode, ClipPlaneAttrib, ColorAttrib, ColorBlendAttrib, ColorScaleAttrib, ColorWriteAttrib, CompassEffect, CullBinAttrib, CullFaceAttrib, GeomNode, DecalEffect, DepthOffsetAttrib, DepthTestAttrib, DepthWriteAttrib, EventStorePandaNode, Fog, FogAttrib, Light, LightAttrib, LightRampAttrib, PandaLoader, MaterialAttrib, ModelFlattenRequest, ModelNode, ModelRoot, TextureAttrib, TexGenAttrib, PolylightNode, PolylightEffect, ShaderInput, ShaderAttrib, ShowBoundsEffect, TexProjectorEffect, ScissorEffect, PosLerpFunctor, HprLerpFunctor, ScaleLerpFunctor, ColorLerpFunctor, PosHprLerpFunctor, HprScaleLerpFunctor, PosHprScaleLerpFunctor, ColorScaleLerpFunctor, PortalNode, RescaleNormalAttrib, ScissorAttrib, ShadeModelAttrib, StencilAttrib, UvScrollNode, LightNode, AmbientLight, CallbackNode, LightLensNode, DirectionalLight, LODNode, FadeLODNode, PointLight, SelectiveChildNode, SequenceNode, Spotlight, SwitchNode, RecorderBase, MouseRecorder, RecorderController, and SocketStreamRecorder.
float getEndT | ( | ) |
Returns the last legal value of t on the curve.
int getNumSamples | ( | ) |
Returns the number of sample points generated by the previous call to adaptive_sample().
int getNumSegments | ( | ) |
Returns the number of piecewise continuous segments within the curve.
This number is usually not important unless you plan to call eval_segment_point().
int getRefCount | ( | ) | [inherited] |
Returns the current reference count.
Returns the point on the curve of the nth sample point generated by the previous call to adaptive_sample().
For tangents, or extended points, you should use get_sample_t() and pass it into eval_tangent() or eval_extended_point().
list getSamplePoints | ( | ) |
float getSampleT | ( | int | n | ) |
Returns the t value of the nth sample point generated by the previous call to adaptive_sample().
list getSampleTs | ( | ) |
float getSegmentT | ( | int | segment, |
float | t | ||
) |
Accepts a t value in the range [0, 1], and assumed to be relative to the indicated segment (as in eval_segment_point()), and returns the corresponding t value in the entire curve (as in eval_point()).
float getStartT | ( | ) |
Returns the first legal value of t on the curve.
Usually this is 0.0.
ref | ( | ) | [inherited] |
Explicitly increments the reference count.
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
bool testRefCountIntegrity | ( | ) | [inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
bool testRefCountNonzero | ( | ) | [inherited] |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
Returns true if ok, false otherwise.
bool unref | ( | ) | [inherited] |
Explicitly decrements the reference count.
Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete().
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
The return value is true if the new reference count is nonzero, false if it is zero.
Reimplemented in GeomVertexArrayFormat, and GeomVertexFormat.