Class: Numerix::Plane
Overview
A structure encapsulating a 3D Plane.
Instance Attribute Summary collapse
-
#distance ⇒ Float
The distance of the plane along its normal from the origin.
-
#normal ⇒ Vector3
The normal vector of the plane.
Class Method Summary collapse
-
.from_vertices(pnt1, pnt2, pnt3) ⇒ Plane
Creates a Plane that contains the three given points.
Instance Method Summary collapse
-
#dot(other) ⇒ Float
Calculates the dot product of a plane and Vector4.
-
#dot_coord(other) ⇒ Float
Returns the dot product of a specified Vector3 and the normal vector of this Plane plus the distance value of the plane.
-
#dot_norm(other) ⇒ Float
Returns the dot product of a specified Vector3 and the normal vector of this plane.
-
#initialize(*args) ⇒ Plane
constructor
A new instance of Plane.
-
#normalize ⇒ Plane
Creates a new plane whose normal vector is the source plane's normal vector normalized.
-
#normalize! ⇒ self
Normalizes this plane's normal vector.
-
#to_s ⇒ String
A String representation of this instance.
-
#transform(other) ⇒ Plane
Applies a transformation to the plane.
-
#transform!(other) ⇒ self
Applies a transformation to the plane.
Methods inherited from Structure
#[], #[]=, #address, #dup, #each, #pack, #ptr, size, unpack
Constructor Details
Instance Attribute Details
#distance ⇒ Float
Returns the distance of the plane along its normal from the origin.
14 15 16 |
# File 'lib/numerix/plane.rb', line 14 def distance @distance end |
#normal ⇒ Vector3
Returns the normal vector of the plane.
9 10 11 |
# File 'lib/numerix/plane.rb', line 9 def normal @normal end |
Class Method Details
.from_vertices(pnt1, pnt2, pnt3) ⇒ Plane
Creates a Plane that contains the three given points.
150 151 |
# File 'lib/numerix/plane.rb', line 150 def from_vertices(pnt1, pnt2, pnt3) end |
Instance Method Details
#dot(other) ⇒ Float
Calculates the dot product of a plane and Vector4.
97 98 |
# File 'lib/numerix/plane.rb', line 97 def dot(other) end |
#dot_coord(other) ⇒ Float
Returns the dot product of a specified Vector3 and the normal vector of this Plane plus the distance value of the plane.
107 108 |
# File 'lib/numerix/plane.rb', line 107 def dot_coord(other) end |
#dot_norm(other) ⇒ Float
Returns the dot product of a specified Vector3 and the normal vector of this plane.
117 118 |
# File 'lib/numerix/plane.rb', line 117 def dot_norm(other) end |
#normalize ⇒ Plane
Creates a new plane whose normal vector is the source plane's normal vector normalized.
125 126 |
# File 'lib/numerix/plane.rb', line 125 def normalize end |
#normalize! ⇒ self
Normalizes this plane's normal vector.
132 133 |
# File 'lib/numerix/plane.rb', line 132 def normalize! end |
#to_s ⇒ String
Returns a String representation of this instance.
137 138 |
# File 'lib/numerix/plane.rb', line 137 def to_s end |
#transform(matrix) ⇒ Plane #transform(rotation) ⇒ Plane
This plane must already be normalized, so that its normal vector is of unit length, before this method is called.
Applies a transformation to the plane.
67 68 |
# File 'lib/numerix/plane.rb', line 67 def transform(other) end |
#transform!(matrix) ⇒ self #transform!(rotation) ⇒ self
This plane must already be normalized, so that its normal vector is of unit length, before this method is called.
Applies a transformation to the plane.
88 89 |
# File 'lib/numerix/plane.rb', line 88 def transform!(other) end |