Class: Fox::FXVec3f
- Inherits:
-
Object
- Object
- Fox::FXVec3f
- Defined in:
- rdoc-sources/FXVec3f.rb,
lib/fox16/core.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
-
#z ⇒ Object
Returns the value of attribute z.
Class Method Summary collapse
-
.normal(a, b, c, d) ⇒ Object
Compute approximate normal from four points a, b, c and d.
Instance Method Summary collapse
-
#*(n) ⇒ Object
Returns a new FXVec3f instance obtained by memberwise multiplication of this vector’s elements by the scalar n.
-
#+(other) ⇒ Object
Returns a new FXVec3f instance obtained by memberwise addition of the other FXVec3f instance with this one.
-
#-(other) ⇒ Object
Returns a new FXVec3f instance obtained by memberwise subtraction of the other FXVec3f instance from this one.
-
#-@ ⇒ Object
Returns a new FXVec3f instance which is the negation of this one.
-
#/(n) ⇒ Object
Returns a new FXVec3f instance obtained by memberwise division of this vector’s elements by the scalar n.
-
#==(other) ⇒ Object
Return
true
if this vector is equal to other. -
#[](index) ⇒ Object
Returns the element at index, where index is 0, 1 or 2.
-
#[]=(index, value) ⇒ Object
Set the element at index to value and return value.
-
#clamp(lo, hi) ⇒ Object
Clamp the values of this vector between limits lo and hi.
-
#cross(other) ⇒ Object
Return the cross product of this vector and other.
-
#dot(other) ⇒ Object
Returns the dot (scalar) product of this vector and other.
-
#hi(other) ⇒ Object
Return a new FXVec3f instance which is the greater of this vector and other.
-
#initialize(xx, yy, zz = 1.0) ⇒ FXVec3f
constructor
Return an FXVec3f instance initialized with specified component values.
- #inspect ⇒ Object
-
#length ⇒ Object
Return the length (magnitude) of this vector.
-
#length2 ⇒ Object
Return the square of the length of this vector.
-
#lo(other) ⇒ Object
Return a new FXVec3f instance which is the lesser of this vector and other.
-
#normalize ⇒ Object
Return a new FXVec3f instance which is a normalized version of this one.
-
#to_a ⇒ Object
Convert to array.
-
#to_s ⇒ Object
Convert to string.
Constructor Details
#initialize(xx, yy, zz = 1.0) ⇒ FXVec3f
Return an FXVec3f instance initialized with specified component values.
11 |
# File 'rdoc-sources/FXVec3f.rb', line 11 def initialize; end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
4 5 6 |
# File 'rdoc-sources/FXVec3f.rb', line 4 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
5 6 7 |
# File 'rdoc-sources/FXVec3f.rb', line 5 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
6 7 8 |
# File 'rdoc-sources/FXVec3f.rb', line 6 def z @z end |
Class Method Details
.normal(a, b, c, d) ⇒ Object
Compute approximate normal from four points a, b, c and d.
110 |
# File 'rdoc-sources/FXVec3f.rb', line 110 def FXVec3f.normal(a, b, c); end |
Instance Method Details
#*(n) ⇒ Object
Returns a new FXVec3f instance obtained by memberwise multiplication of this vector’s elements by the scalar n.
52 |
# File 'rdoc-sources/FXVec3f.rb', line 52 def *(n); end |
#+(other) ⇒ Object
Returns a new FXVec3f instance obtained by memberwise addition of the other FXVec3f instance with this one.
38 |
# File 'rdoc-sources/FXVec3f.rb', line 38 def +(other); end |
#-(other) ⇒ Object
Returns a new FXVec3f instance obtained by memberwise subtraction of the other FXVec3f instance from this one.
45 |
# File 'rdoc-sources/FXVec3f.rb', line 45 def -(other); end |
#-@ ⇒ Object
Returns a new FXVec3f instance which is the negation of this one.
31 |
# File 'rdoc-sources/FXVec3f.rb', line 31 def -@(); end |
#/(n) ⇒ Object
Returns a new FXVec3f instance obtained by memberwise division of this vector’s elements by the scalar n. Raises ZeroDivisionError if n is identically zero.
60 |
# File 'rdoc-sources/FXVec3f.rb', line 60 def /(n); end |
#==(other) ⇒ Object
Return true
if this vector is equal to other.
71 |
# File 'rdoc-sources/FXVec3f.rb', line 71 def ==(other); end |
#[](index) ⇒ Object
Returns the element at index, where index is 0, 1 or 2. Raises IndexError if index is out of range.
22 |
# File 'rdoc-sources/FXVec3f.rb', line 22 def [](index); end |
#[]=(index, value) ⇒ Object
Set the element at index to value and return value. Raises IndexError if index is out of range.
28 |
# File 'rdoc-sources/FXVec3f.rb', line 28 def []=(index, value); end |
#clamp(lo, hi) ⇒ Object
Clamp the values of this vector between limits lo and hi.
86 |
# File 'rdoc-sources/FXVec3f.rb', line 86 def clamp(lo, hi); end |
#cross(other) ⇒ Object
Return the cross product of this vector and other.
68 |
# File 'rdoc-sources/FXVec3f.rb', line 68 def cross(other); end |
#dot(other) ⇒ Object
Returns the dot (scalar) product of this vector and other.
65 |
# File 'rdoc-sources/FXVec3f.rb', line 65 def dot(other); end |
#hi(other) ⇒ Object
Return a new FXVec3f instance which is the greater of this vector and other.
104 |
# File 'rdoc-sources/FXVec3f.rb', line 104 def hi(other); end |
#inspect ⇒ Object
271 |
# File 'lib/fox16/core.rb', line 271 def inspect; to_a.inspect; end |
#length ⇒ Object
Return the length (magnitude) of this vector.
81 |
# File 'rdoc-sources/FXVec3f.rb', line 81 def length; end |
#length2 ⇒ Object
Return the square of the length of this vector.
76 |
# File 'rdoc-sources/FXVec3f.rb', line 76 def length2; end |
#lo(other) ⇒ Object
Return a new FXVec3f instance which is the lesser of this vector and other.
98 |
# File 'rdoc-sources/FXVec3f.rb', line 98 def lo(other); end |
#normalize ⇒ Object
Return a new FXVec3f instance which is a normalized version of this one.
92 |
# File 'rdoc-sources/FXVec3f.rb', line 92 def normalize; end |
#to_a ⇒ Object
Convert to array
266 |
# File 'lib/fox16/core.rb', line 266 def to_a; [x, y, z]; end |
#to_s ⇒ Object
Convert to string
269 |
# File 'lib/fox16/core.rb', line 269 def to_s; to_a.to_s; end |