KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Interfaces > IKCPathCollisionDetector
IKCPathCollisionDetector Interface

IKCPathCollisionDetector(64) Interface

Detect
GetCollidedObjects

IKCPathCollisionDetector provides access to Collision Detector, which implements Path Collision Detection functionality.

See also: Collision Path sample


HRESULT Detect(PathDetectorContext* context, double* tCollision)

Parameters

context - [in] additional parameters for the operation or NULL.

context.decreasingStart member affects only performance of the method. Set context.decreasingStart to true if it is known that the on the start of movement distance between the objects decreases (but may have some increasing stages later during the movement). Default: false

context.minDistToler  - If minimal distance between the objects is less than this value it is assumed that it a collision has happened. If this member is set to zero or a negative number a default tolerance is used, which is calculated from geometry of the objects and depends on how fine surface approximation is.

context.precision - not used in this release

If context is NULL defaults are used

tCollision - [out, retval] the returned parameter from range [0, 1] at which the collision occurred or large number (greater than 2) if no collision was detected

Remarks:

This method assumes that a set of objects and their movements have been added to the collision detector using IKinematicSet_KC.AddObject  where IKinematicSet_KC was queried from this IKCPathCollisionDetector

If the returned value tCollision is greater or equal to 0 and less than or equal to 1 it is the parameter of the collision moment. Otherwise there where no collision detected.

Use IKinematicSet_KC.SetPosition(tCollision) to move all added objects to the collision situation. After that IMetrics.Dist can be used to obtain extended information about nearest points at collision situation.


HRESULT GetCollidedObjects( IMetrics** object0, IMetrics** object1 )

Parameters

object0 - [out] IMetrics implemented by the first object of the collided pair

object1 - [out] IMetrics implemented by the second object of the collided pair

Remarks:

The methods is useful only for multi object collision detection. It identifies which objects have actually collided. The retuned references are NULL if there where no collision or Detect method has not been called yet.

If there was a multiple objects collision at the same time selection of the collided pair should be considered random.