Click or drag to resize
Ab4d.SharpEngine logo

HitTestOptions Properties

The HitTestOptions type exposes the following members.

Properties
 NameDescription
Public propertyBackgroundRenderingLayer When BackgroundRenderingLayer is specified, then the objects that are assigned to that rendering layer will be considered farther from the camera than objects from other rendering layers. This means that the GetClosestHitObject method will return objects from any other rendering queue if they exist before returning objects from the specified rendering layer. When calling GetAllHitObjects, then this property does not have effect.
Public propertyGenerateOctreeOnMeshInitialization When true and when mesh has more positions than MeshPositionsCountForOctreeGeneration, then the Octree is generated at mesh initialization time. When false and when mesh has more positions than MeshPositionsCountForOctreeGeneration, then the Octree is generated when first HitTest method is called on the mesh. Default value is false.
Public propertyGetOnlyFrontFacingTriangles When true then only triangles that have normals (calculated from triangle positions) oriented in the opposite direction as the ray are returned (because ray is usually created from the camera's position this returns only triangles that are facing the camera). When false (by default), all hit triangles are returned regardless of their orientation.
Public propertyGetOnlyOneHitPerSceneNode When true then only one hit result is get from one SceneNode. When false (by default), then multiple hit results can be created by one SceneNode. This property is used only by the GetAllHitObjects method and not by GetClosestHitObject method.
Public propertyMeshPositionsCountForOctreeGeneration Gets or sets an integer value that specifies number of positions in a mesh at which a Octree is generated to speed up hit testing (e.g. if mesh has more positions then a value specified with this property, then Octree will be generated for the mesh). Default value is 512.
Public propertyOctreeExpandChildBoundingBoxes ExpandChildBoundingBoxes is a float that defined how much the bounding boxes of node overlap. By default, the value is set to 0.2 - so each bounding box is extended for 20% (but it does not go out of the parent's bounding box). This way the triangles that lay on node borders will be put into the child nodes instead of having them in the parent node (there we need to do a hit test every time).
Public propertyOctreeMaxNodeLevel Number of levels used for Octree - bigger number reduces the number of triangles in each node but increased the Octree initialization time and used memory. Default value is 4.
Public propertyOverlayRenderingLayer When OverlayRenderingLayer is specified, then the objects that are assigned to that rendering layer will be considered closer to the camera than objects from other rendering layers. This means that the GetClosestHitObject method will return objects from the specified rendering queue even if in 3D space they are behind objects from other rendering layers. When calling GetAllHitObjects, then this property does not have effect.
Public propertyPreventCallingUpdateBeforeHitTesting Before hit testing the Scene.Update method is called when the scene's DirtyFlags indicate that the bounding boxes of some scene nodes need to be updated. This may take a lot of time. If user manually calls Scene.Update method of it the BoundingBox are always correct, then PreventCallingUpdateBeforeHitTesting property can be set to true to prevent automatic calling of Update method.
Public propertyReportAllHitTrianglesWhenEdgeIsHit When an edge of a triangle is hit, then by default (ReportAllHitTrianglesWhenEdgeIsHit is false) only one hit result is generated. But when ReportAllHitTrianglesWhenEdgeIsHit is true, then two hit results will be reported when two triangles share the same edge.
Public propertyUseMultiThreading When true then multi-threaded hit testing algorithms are used when possible.
Top
See Also