Class: Fox::FXRanged
- Inherits:
-
Object
- Object
- Fox::FXRanged
- Defined in:
- rdoc-sources/FXRanged.rb
Overview
Represents a range in 3-D space.
Instance Attribute Summary collapse
-
#lower ⇒ Object
Lower corner of range FXVec3d.
-
#upper ⇒ Object
Upper corner of range FXVec3d.
Instance Method Summary collapse
-
#center ⇒ Object
Return the center of the box (a point, as an FXVec3d instance).
-
#contains?(aSphere) ⇒ Boolean
Returns
true
if this box properly contains aSphere (an FXSphered instance). -
#corner(c) ⇒ Object
Return the _c_th corner of this box (an FXVec3d instance).
-
#depth ⇒ Object
Return the depth of the box.
-
#diagonal ⇒ Object
Return the diagonal vector for the box (an FXVec3d instance).
-
#diameter ⇒ Object
Return the length of the diagonal of the box.
-
#empty? ⇒ Boolean
Returns
true
if this is an empty range (i.e. if any of the side lengths is zero or less). -
#height ⇒ Object
Return the height of the box.
-
#include!(*args) ⇒ Object
Include the given range or point into this range and return a reference to self.
-
#initialize(sphere) ⇒ FXRanged
constructor
Initialize box to fully contain the given sphere (an FXSphered instance).
-
#intersect(plane) ⇒ Object
Intersect box with a plane ax+by+cz+w; returns -1, 0 or 1.
-
#intersection(other) ⇒ Object
Return a new FXRanged instance which is the intersection of this box and another box.
-
#intersects?(u, v) ⇒ Boolean
Return true if the ray from u to v (both FXVec3d instances representing the ray endpoints) intersects this box.
-
#longest ⇒ Object
Return the length of the longest side of the box.
-
#overlaps?(other) ⇒ Boolean
Returns
true
if any part of this range overlaps the other range. -
#radius ⇒ Object
Return the radius of the box.
-
#shortest ⇒ Object
Return the length of the shortest side of the box.
-
#union(other) ⇒ Object
Return a new FXRanged instance which is the union of this box and another box.
-
#width ⇒ Object
Return the width of the box.
Constructor Details
#initialize(sphere) ⇒ FXRanged
Initialize box to fully contain the given sphere (an FXSphered instance)
14 |
# File 'rdoc-sources/FXRanged.rb', line 14 def initialize(xlo=0.0, xhi=0.0, ylo=0.0, yhi=0.0, zlo=0.0, zhi=0.0) ; end |
Instance Attribute Details
#lower ⇒ Object
Lower corner of range Fox::FXVec3d
8 9 10 |
# File 'rdoc-sources/FXRanged.rb', line 8 def lower @lower end |
#upper ⇒ Object
Upper corner of range Fox::FXVec3d
11 12 13 |
# File 'rdoc-sources/FXRanged.rb', line 11 def upper @upper end |
Instance Method Details
#center ⇒ Object
Return the center of the box (a point, as an FXVec3d instance).
47 |
# File 'rdoc-sources/FXRanged.rb', line 47 def center; end |
#contains?(aSphere) ⇒ Boolean
Returns true
if this box properly contains aSphere (an FXSphered instance)
54 |
# File 'rdoc-sources/FXRanged.rb', line 54 def contains?(x, y, z) ; end |
#corner(c) ⇒ Object
Return the _c_th corner of this box (an FXVec3d instance). Raises IndexError if c is less than zero or greater than 7.
90 |
# File 'rdoc-sources/FXRanged.rb', line 90 def corner(c); end |
#depth ⇒ Object
Return the depth of the box
29 |
# File 'rdoc-sources/FXRanged.rb', line 29 def depth; end |
#diagonal ⇒ Object
Return the diagonal vector for the box (an FXVec3d instance).
44 |
# File 'rdoc-sources/FXRanged.rb', line 44 def diagonal; end |
#diameter ⇒ Object
Return the length of the diagonal of the box
38 |
# File 'rdoc-sources/FXRanged.rb', line 38 def diameter; end |
#empty? ⇒ Boolean
Returns true
if this is an empty range (i.e. if any of the side lengths is zero or less).
51 |
# File 'rdoc-sources/FXRanged.rb', line 51 def empty?() ; end |
#height ⇒ Object
Return the height of the box
26 |
# File 'rdoc-sources/FXRanged.rb', line 26 def height; end |
#include!(*args) ⇒ Object
Include the given range or point into this range and return a reference to self. Valid forms are:
range.include!(aRange) -> range
range.include!(x, y, z) -> range
range.include!(vec) -> range
range.include!(sphere) -> range
76 |
# File 'rdoc-sources/FXRanged.rb', line 76 def include!(*args) ; end |
#intersect(plane) ⇒ Object
Intersect box with a plane ax+by+cz+w; returns -1, 0 or 1.
79 |
# File 'rdoc-sources/FXRanged.rb', line 79 def intersect(plane); end |
#intersection(other) ⇒ Object
Return a new FXRanged instance which is the intersection of this box and another box.
98 |
# File 'rdoc-sources/FXRanged.rb', line 98 def intersection(other); end |
#intersects?(u, v) ⇒ Boolean
Return true if the ray from u to v (both FXVec3d instances representing the ray endpoints) intersects this box.
83 |
# File 'rdoc-sources/FXRanged.rb', line 83 def intersects?(u, v) ; end |
#longest ⇒ Object
Return the length of the longest side of the box
32 |
# File 'rdoc-sources/FXRanged.rb', line 32 def longest; end |
#overlaps?(other) ⇒ Boolean
Returns true
if any part of this range overlaps the other range.
86 |
# File 'rdoc-sources/FXRanged.rb', line 86 def overlaps?(other) ; end |
#radius ⇒ Object
Return the radius of the box
41 |
# File 'rdoc-sources/FXRanged.rb', line 41 def radius; end |
#shortest ⇒ Object
Return the length of the shortest side of the box
35 |
# File 'rdoc-sources/FXRanged.rb', line 35 def shortest; end |
#union(other) ⇒ Object
Return a new FXRanged instance which is the union of this box and another box.
94 |
# File 'rdoc-sources/FXRanged.rb', line 94 def union(other); end |
#width ⇒ Object
Return the width of the box
23 |
# File 'rdoc-sources/FXRanged.rb', line 23 def width; end |