class tinylib.Point3D
Available on all platforms
Point3D: 3-dimensional position of vector corresponding
This class is derived from Sandy Point3D.
Class Fields
static var EPSILON:Float
A small value. If the norm()
is smaller than this value, normalize()
function do clear()
instead of normalization.
static function fromString(s:String):Point3D
Generate Point3D from String.
The string should have at least three space-separated float values. For example, "1.0 2.0 3.0" and " 1.0 2.0 3.0 " are valid.
static function fromStringInverted(s:String):Point3D
Generate Point3D from String. See also fromString()
function.
The only difference of this function from fromString()
is
z-value is inverted in this function.
static function getCross(p0:Point3D, p1:Point3D):Point3D
returns new Point3D of vector product p0
* p1
static function getMiddle(p0:Point3D, p1:Point3D, c:Bool, r:Float, o:Point3D):Point3D
returns middle point of p0
and p1
.
Default of the optional values are:
- c: false
- r: 0.0
- o: null
If c
is false (default), returns ( p0
+ p1
) / 2.
If c
is true and o
== null (default), returns
r
* ( p0
+ p1
) / | p0
+ p1
|.
If c
is true and o
!= null, returns
r
* ( p0
+ p1
- 2o
) / | p0
+ p1
- 2o
| + o
. o
is used as
the origin.
Instance Fields
function new(vx:Float, vy:Float, vz:Float):Void
Constructor. Initial value can be assigned by vx
, vy
, and vz
.
function cross(p:Point3D):Point3D
calculate vector product of this
and p
and replace this
.
return value is this
.