You are here: Lua Scripting Resources eGuide > Lua Scripting API Reference Guide > Physics Library > segmentQuery

19.13.3 segmentQuery

physics.Space:segmentQuery(startvect, stopvect, layers, group,

Parameter

Type

Description

self

in physics.Shape

The input Shape

startvect

in physics.Vect

An end point of the segment

stopvect

in physics.Vect

Other end point of the segment

layers

in number

A bitmap of the layers.
Match if shape.layers inter- sects layers

group

in number

The group number to check.
Match if object is not in group

function

function(shape, t, normal)

A function to call providing each Shape in turn that matches the criteria

Queries the Space for all Shapes that intersect the line segment from startvect to stopvect and match layers and not in group. The function is called with each matching Shape. Sensor Shapes are included.

The callback function is called with each Shape, proportion of distance along the line segment (a fraction from 0 to 1), and the surface normal vector of the intersection point of the Shape.

Introduced in platform.apiLevel = '2.0'