Class: Fox::FXVec4f
- Inherits:
-
Object
- Object
- Fox::FXVec4f
- Defined in:
- rdoc-sources/FXVec4f.rb,
lib/fox16/core.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#w ⇒ Object
Returns the value of attribute w.
-
#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
-
.plane(a, b, c) ⇒ Object
Compute normalized plane equation ax + by + cz + d = 0.
Instance Method Summary collapse
-
#*(n) ⇒ Object
Returns a new FXVec4f instance obtained by memberwise multiplication of this vector’s elements by the scalar n.
-
#+(other) ⇒ Object
Returns a new FXVec4f instance obtained by memberwise addition of the other FXVec4f instance with this one.
-
#-(other) ⇒ Object
Returns a new FXVec4f instance obtained by memberwise subtraction of the other FXVec4f instance from this one.
-
#-@ ⇒ Object
Returns a new FXVec4f instance which is the negation of this one.
-
#/(n) ⇒ Object
Returns a new FXVec4f 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, 2 or 3.
-
#[]=(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.
-
#crosses?(a, b) ⇒ Boolean
Return
true
if edge a-b crosses plane. -
#distance(p) ⇒ Object
Signed distance normalized plane and point.
-
#dot(other) ⇒ Object
Returns the dot (scalar) product of this vector and other.
-
#hi(other) ⇒ Object
Return a new FXVec4f instance which is the greater of this vector and other.
-
#initialize(vec3f, ww = 1.0) ⇒ FXVec4f
constructor
Return an FXVec4f instance initialized from an FXVec3f instance and optional scalar.
- #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 FXVec4f instance which is the lesser of this vector and other.
-
#normalize ⇒ Object
Return a new FXVec4f instance which is a normalized version of this one.
-
#to_a ⇒ Object
Convert to array.
-
#to_s ⇒ Object
Convert to string.
Constructor Details
#initialize(vec3f, ww = 1.0) ⇒ FXVec4f
Return an FXVec4f instance initialized from an FXVec3f instance and optional scalar.
12 |
# File 'rdoc-sources/FXVec4f.rb', line 12 def initialize; end |
Instance Attribute Details
#w ⇒ Object
Returns the value of attribute w.
7 8 9 |
# File 'rdoc-sources/FXVec4f.rb', line 7 def w @w end |
#x ⇒ Object
Returns the value of attribute x.
4 5 6 |
# File 'rdoc-sources/FXVec4f.rb', line 4 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
5 6 7 |
# File 'rdoc-sources/FXVec4f.rb', line 5 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
6 7 8 |
# File 'rdoc-sources/FXVec4f.rb', line 6 def z @z end |
Class Method Details
.plane(a, b, c) ⇒ Object
Compute normalized plane equation ax + by + cz + d = 0.
115 |
# File 'rdoc-sources/FXVec4f.rb', line 115 def FXVec4f.plane(vec); end |
Instance Method Details
#*(n) ⇒ Object
Returns a new FXVec4f instance obtained by memberwise multiplication of this vector’s elements by the scalar n.
58 |
# File 'rdoc-sources/FXVec4f.rb', line 58 def *(n); end |
#+(other) ⇒ Object
Returns a new FXVec4f instance obtained by memberwise addition of the other FXVec4f instance with this one.
44 |
# File 'rdoc-sources/FXVec4f.rb', line 44 def +(other); end |
#-(other) ⇒ Object
Returns a new FXVec4f instance obtained by memberwise subtraction of the other FXVec4f instance from this one.
51 |
# File 'rdoc-sources/FXVec4f.rb', line 51 def -(other); end |
#-@ ⇒ Object
Returns a new FXVec4f instance which is the negation of this one.
37 |
# File 'rdoc-sources/FXVec4f.rb', line 37 def -@(); end |
#/(n) ⇒ Object
Returns a new FXVec4f instance obtained by memberwise division of this vector’s elements by the scalar n. Raises ZeroDivisionError if n is identically zero.
66 |
# File 'rdoc-sources/FXVec4f.rb', line 66 def /(n); end |
#==(other) ⇒ Object
Return true
if this vector is equal to other.
77 |
# File 'rdoc-sources/FXVec4f.rb', line 77 def ==(other); end |
#[](index) ⇒ Object
Returns the element at index, where index is 0, 1, 2 or 3. Raises IndexError if index is out of range.
28 |
# File 'rdoc-sources/FXVec4f.rb', line 28 def [](index); end |
#[]=(index, value) ⇒ Object
Set the element at index to value and return value. Raises IndexError if index is out of range.
34 |
# File 'rdoc-sources/FXVec4f.rb', line 34 def []=(index, value); end |
#clamp(lo, hi) ⇒ Object
Clamp the values of this vector between limits lo and hi.
92 |
# File 'rdoc-sources/FXVec4f.rb', line 92 def clamp(lo, hi); end |
#cross(other) ⇒ Object
Return the cross product of this vector and other.
74 |
# File 'rdoc-sources/FXVec4f.rb', line 74 def cross(other); end |
#crosses?(a, b) ⇒ Boolean
Return true
if edge a-b crosses plane
136 |
# File 'rdoc-sources/FXVec4f.rb', line 136 def crosses?(a, b); end |
#distance(p) ⇒ Object
Signed distance normalized plane and point
133 |
# File 'rdoc-sources/FXVec4f.rb', line 133 def distance(p); end |
#dot(other) ⇒ Object
Returns the dot (scalar) product of this vector and other.
71 |
# File 'rdoc-sources/FXVec4f.rb', line 71 def dot(other); end |
#hi(other) ⇒ Object
Return a new FXVec4f instance which is the greater of this vector and other.
110 |
# File 'rdoc-sources/FXVec4f.rb', line 110 def hi(other); end |
#inspect ⇒ Object
291 |
# File 'lib/fox16/core.rb', line 291 def inspect; to_a.inspect; end |
#length ⇒ Object
Return the length (magnitude) of this vector.
87 |
# File 'rdoc-sources/FXVec4f.rb', line 87 def length; end |
#length2 ⇒ Object
Return the square of the length of this vector.
82 |
# File 'rdoc-sources/FXVec4f.rb', line 82 def length2; end |
#lo(other) ⇒ Object
Return a new FXVec4f instance which is the lesser of this vector and other.
104 |
# File 'rdoc-sources/FXVec4f.rb', line 104 def lo(other); end |
#normalize ⇒ Object
Return a new FXVec4f instance which is a normalized version of this one.
98 |
# File 'rdoc-sources/FXVec4f.rb', line 98 def normalize; end |
#to_a ⇒ Object
Convert to array
286 |
# File 'lib/fox16/core.rb', line 286 def to_a; [x, y, z, w]; end |
#to_s ⇒ Object
Convert to string
289 |
# File 'lib/fox16/core.rb', line 289 def to_s; to_a.to_s; end |