RayMarching  0.0.1
Simple 3D engine based on a ray marching rendering
Public Member Functions | Protected Attributes | List of all members
RayMarching::Shape Class Reference

Abstract Shape description. More...

#include <models3.h>

Inheritance diagram for RayMarching::Shape:
RayMarching::SDFObject RayMarching::Cube RayMarching::Cylinder RayMarching::Sphere

Public Member Functions

 Shape (color_t color=BLACK)
 
 Shape (Eigen::Vector3d p, color_t color=BLACK)
 
virtual Eigen::Vector3d getPos () const
 
color_t getColor (const Eigen::Vector3d &p) const override
 
void setColor (color_t color)
 
- Public Member Functions inherited from RayMarching::SDFObject
virtual ~SDFObject ()=default
 
virtual double getDist (Eigen::Vector3d const &p) const =0
 
Line getReflection (const Line &ray) const
 

Protected Attributes

Eigen::Vector3d _pos
 
color_t _color
 

Detailed Description

Abstract Shape description.

Implement few component used in all primitives

Constructor & Destructor Documentation

◆ Shape() [1/2]

RayMarching::Shape::Shape ( color_t  color = BLACK)
inlineexplicit

Creates new abstract Shape

Parameters
colordesired color

◆ Shape() [2/2]

RayMarching::Shape::Shape ( Eigen::Vector3d  p,
color_t  color = BLACK 
)
inlineexplicit

This construction will be deleted later on, position of the Shape will be applied by the TransformataObject

Parameters
pShape's position in space
colorShape's color

Member Function Documentation

◆ getColor()

color_t RayMarching::Shape::getColor ( const Eigen::Vector3d &  p) const
inlineoverridevirtual

Color getter for render engine

Parameters
pRequesting point
Returns
Closest color to the point

Implements RayMarching::SDFObject.

◆ getPos()

virtual Eigen::Vector3d RayMarching::Shape::getPos ( ) const
inlinevirtual

Position getter

Returns
current object position

◆ setColor()

void RayMarching::Shape::setColor ( color_t  color)
inline

Color setter

Parameters
colordesired color

Member Data Documentation

◆ _color

color_t RayMarching::Shape::_color
protected

Shape's color

◆ _pos

Eigen::Vector3d RayMarching::Shape::_pos
protected

Shape position in space


The documentation for this class was generated from the following file: