KiCad PCB EDA Suite
PLATED_COPPER_NORMAL Class Reference

#include <material.h>

Inheritance diagram for PLATED_COPPER_NORMAL:
MATERIAL_GENERATOR

Public Member Functions

 PLATED_COPPER_NORMAL ()
 
 PLATED_COPPER_NORMAL (float aScale)
 
virtual ~PLATED_COPPER_NORMAL ()
 
SFVEC3F Generate (const RAY &aRay, const HITINFO &aHitInfo) const override
 Generate a 3D vector based on the ray and hit information depending on the implementation. More...
 

Private Attributes

float m_scale
 

Detailed Description

Definition at line 98 of file material.h.

Constructor & Destructor Documentation

◆ PLATED_COPPER_NORMAL() [1/2]

PLATED_COPPER_NORMAL::PLATED_COPPER_NORMAL ( )
inline

Definition at line 101 of file material.h.

102 {
103 m_scale = 1.0f;
104 }

References m_scale.

◆ PLATED_COPPER_NORMAL() [2/2]

PLATED_COPPER_NORMAL::PLATED_COPPER_NORMAL ( float  aScale)
inline

Definition at line 106 of file material.h.

107 {
108 m_scale = 1.0f / aScale;
109 }

References m_scale.

◆ ~PLATED_COPPER_NORMAL()

virtual PLATED_COPPER_NORMAL::~PLATED_COPPER_NORMAL ( )
inlinevirtual

Definition at line 111 of file material.h.

112 {
113 }

Member Function Documentation

◆ Generate()

SFVEC3F PLATED_COPPER_NORMAL::Generate ( const RAY aRay,
const HITINFO aHitInfo 
) const
overridevirtual

Generate a 3D vector based on the ray and hit information depending on the implementation.

Parameters
aRaythe camera ray that hits the object
aHitInfothe hit information
Returns
the result of the procedural

Implements MATERIAL_GENERATOR.

Definition at line 219 of file material.cpp.

220{
221 SFVEC3F hitPos = aHitInfo.m_HitPoint * m_scale;
222
223 const float noise1 = ( s_perlinNoise.noise( hitPos.x, hitPos.y ) - 0.5f );
224 const float noise2 = ( s_perlinNoise.noise( hitPos.y, hitPos.x ) - 0.5f );
225
226 return SFVEC3F( noise1, noise2, 0.0f ) * 0.1f;
227}
float noise(float x, float y, float z) const
static PerlinNoise s_perlinNoise
Definition: material.cpp:136
SFVEC3F m_HitPoint
(12) hit position
Definition: hitinfo.h:44
glm::vec3 SFVEC3F
Definition: xv3d_types.h:44

References HITINFO::m_HitPoint, m_scale, PerlinNoise::noise(), and s_perlinNoise.

Member Data Documentation

◆ m_scale

float PLATED_COPPER_NORMAL::m_scale
private

Definition at line 118 of file material.h.

Referenced by Generate(), and PLATED_COPPER_NORMAL().


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