|
HitTesterHitTest(Ray, PositionNormal, Int32, Boolean, Int32, Boolean) Method |
Hit test a ray against the mesh with specified vertex and index buffer.
Namespace: Ab3d.DirectXAssembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax public static DXRayHitTestResult HitTest(
Ray localRay,
PositionNormal[] vertexBufferArray,
int[] indexBufferArray,
bool hitOnlyFrontFacingTriangles,
int startTriangleIndex,
bool getOnlyNextHitTest
)
Parameters
- localRay Ray
- ray transformed to local coordinate system
- vertexBufferArray PositionNormal
- vertex buffer as array of PositionNormal
- indexBufferArray Int32
- index buffer
- hitOnlyFrontFacingTriangles Boolean
- 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).
- startTriangleIndex Int32
- index of the triangle where the hit testing will begin - triangle indice index is get by multiplying this number by 3
- getOnlyNextHitTest Boolean
- when true, then the next hit result is returned; when false all hit results are get and only the closest to the ray origin is returned.
Return Value
DXRayHitTestResultDXRayHitTestResult when ray hits the mesh otherwise null is returned
See Also