niPick⚓︎
Class used in the picking intersection system within the game engine. Using a ray, the engine performs picking operations on a scene graph or any subtree. Given a ray and a subtree, the subtree is traversed and matching nodes are added to an array.
Properties⚓︎
coordinateType⚓︎
The coordinate type for the object. Maps to values in ni.pickCoordinateType table.
Returns:
result(ni.pickCoordinateType)
frontOnly⚓︎
If true, back face triangles (those with clockwise winding order) are culled prior to intersection calculations. If false, intersections of ray with triangles are computed regardless of triangle orientation.
Returns:
result(boolean)
intersectType⚓︎
The intersect type for the object. Maps to values in ni.pickIntersectType table.
Returns:
result(ni.pickIntersectType)
lastAddedRecord⚓︎
The pick record that was last added to the object.
Returns:
result(niPickRecord)
observeAppCullFlag⚓︎
If true, the pick stops if it encounters an object with the 'app culled' flag set. If false, the pick will continue over 'app culled' objects.
Returns:
result(boolean)
pickType⚓︎
The pick type for the object. Maps to values in ni.pickType table.
Returns:
result(ni.pickType)
results⚓︎
Read-only. The array of pick records obtained by the last call to pickObjects.
Returns:
result(niPickRecord[])
returnColor⚓︎
If true, a vertex color value is returned for the point of intersection of triangles during picking.
Returns:
result(boolean)
returnNormal⚓︎
If true, a unit-length normal is returned for the point of intersection of triangles intersected during the picking.
Returns:
result(boolean)
returnSmoothNormal⚓︎
If true and if vertex normals exist, then a unit-length normal vector is interpolated from the vertex normals and returned during the picking operation.
Returns:
result(boolean)
returnTexture⚓︎
If true, texture coordinates are returned for the point of intersection of triangles during the picking operation.
Returns:
result(boolean)
root⚓︎
The root of the scene graph on which the next picking operation will be performed.
Returns:
result(niNode)
sortType⚓︎
The sort type for the object. Maps to values in ni.pickSortType table.
Returns:
result(ni.pickSortType)
Methods⚓︎
clearResults⚓︎
Clears the results of any previous picking operation.
myObject:clearResults()
pickObjects⚓︎
Performs the picking operation by casting a ray.
myObject:pickObjects(origin, direction, append, maxDistance)
Parameters:
origin(tes3vector3): The origin of the ray in world coordinates.direction(tes3vector3)append(boolean): Default:false. This parameter indicates whether the new results are appended to the results array, or if a new array is formed clearing the results array.maxDistance(number): Optional. Default value: 0.0F