ARPrintPick
From Blue Mars Developer Guidebook
There are security restrictions on this article
|
|
This is an Avatar Reality Utilities function.
Function
- ARPrintPick(count)
- print results of most recent ARMousePick call
- count - number of hit results to print
Notes
count should be the number returned by ARMousePick.
This function demonstrates how to access the contents of the results table are filled in by Physics.RayWorldIntersectionAR and Physics.RayWorldIntersection
Code
function ARPrintPick(count)
ARPrint("Found "..count.." intersections");
for i = 1,count do
local firstHit = g_HitTable[i];
ARPrint("hit type: "..g_HitResultTypes[firstHit.type+1]);
ARPrint("hit pos: "..Vec2Str(firstHit.pos));
ARPrint("hit normal: "..Vec2Str(firstHit.normal));
ARPrint("hit dist: "..firstHit.dist);
if firstHit.entity then
ARPrintEntity(firstHit.entity);
end
if firstHit.renderNode then
ARPrint("hit rendernode: "..tostring(firstHit.renderNode));
end
if firstHit.surface_idx then
ARPrint("hit surface: "..tostring(firstHit.surface_idx));
end
end
end
String representations for the hit types.
g_HitResultTypes = {
"TERRAIN",
"STATIC",
"ENTITY",
"FOLIAGE",
"ROPE",
"OBSTRUCTION",
"WATERVOLUME",
}

