|
RobinTrace
|
Standard shape specialization. More...
#include <standard.h>
Public Member Functions | |
| standard () | |
| Default constructor. More... | |
| standard (double _c, double _k) | |
| Initialization constructor. More... | |
| standard (double _c) | |
| Sphere constructor. More... | |
| virtual void | intersect (ray &r) override |
Operate the intersection of ray r with standard shape. More... | |
| virtual Vec3 | normal (const ray &r) override |
Compute the normal of the standard shape at the current ray r position. More... | |
Public Attributes | |
| double | c |
| Curvature. More... | |
| double | k |
| Quadric constant. More... | |
Private Member Functions | |
| virtual std::string | print_str () const override |
| Printer. | |
Standard shape specialization.
| standard::standard | ( | ) |
Default constructor.
The default initialization is to a plane surface,
| standard::standard | ( | double | _c, |
| double | _k | ||
| ) |
Initialization constructor.
Initializes the standard shape to curvature _c and quadric constant _k.
| _c | Initial curvature of the standard shape. |
| _k | Initial quadric constant of the standard shape. |
| standard::standard | ( | double | _c | ) |
Sphere constructor.
Initialize a sphere of curvature _c.
| _c | Initial sphere curvature. |
|
overridevirtual |
Operate the intersection of ray r with standard shape.
Possible error case: no intersection found between ray and shape.
The exact definition of the standard shape is implicitely specified by this operation.
Implements shape.
Compute the normal of the standard shape at the current ray r position.
It is assumed this operation is applied where the normal vector can be computed, for instance after a successful intersection. No error cases are signaled by the normal computation.
Implements shape.
| double standard::c |
Curvature.
This is the reciprocal of the radius of curvature \(R\).
\[ c = \frac{1}{R} \]
The case \( c = 0 \) describes a plane.
| double standard::k |
Quadric constant.
The type of quadric is specified by k. The cases are the following,