Point
A point in 3D space. This object lives in the Lua session only. Points are defined by numbers and cannot be defined with expressions. Mathematical operations can be done on points.
Example
-- Create a default 'Point' at (0,0,0)
p1 = pf.Point.New()
-- Assign values to each component of the point
p1.x = 1
p1.y = 1
p1.z = 1
-- Create a 'Point' with number values
p2 = pf.Point(2,2,2)
-- Determine the distance between two points
distance = p1:distanceTo(p2)
-- Some of the valid operators for 'Point'
p3 = 2 * p1
p4 = p2 * 2
p5 = p2 / 2
p6 = -p2
p7 = p1 + p2
p8 = p1 - p2
if (p1 ~= p2) then
print(p1.." is not equal to "..p2)
end
Usage locations (object properties)
The following objects have properties using the Point object:
Property List
Method List
- DistanceTo (point Point)
- Returns the distance between this point and another. (Returns a number object.)