14#include "../Material.h"
15#include "../../../Utils/Math/Mathematics.h"
16#include "../../../Utils/Math/Vector2D.h"
17#include "../../../Renderer/Utils/Triangle2D.h"
18#include "../../Objects/Object3D.h"
65 void Diffuse(
float viscosity,
float dt);
81 void SineField(
float ratio,
float period,
float amplitude);
90 void StepField(
float ratio,
float period,
float intensity);
108 void SpiralField(
float ratio,
float period,
float amplitude);
148 void SetSize(
float sizeX,
float sizeY);
Abstract base class for rendering materials.
Represents a 3D object with geometry, material, and transformation data.
Represents an RGB color and provides methods for manipulation.
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
A class for managing and rendering 2D vector fields.
uint16_t GetCountX()
Retrieves the number of vectors along the X-axis.
int8_t * vecD
Density of current vectors.
int8_t * vecY
Y-component of current vectors.
float rotation
Rotation of the field in degrees.
void RenderVector()
Renders the vector field as arrows.
~VectorField2D()
Destructor for the VectorField2D class.
Vector2D position
Position of the vector field.
void SetRotation(float rotation)
Sets the rotation of the vector field.
void RenderDensity()
Renders the density values of the vector field.
int8_t * vecX
X-component of current vectors.
bool density
Indicates if the field should render density values.
uint16_t GetCountY()
Retrieves the number of vectors along the Y-axis.
int8_t * vecDP
Density of previous vectors.
void SineField(float ratio, float period, float amplitude)
Creates a sine wave effect in the vector field.
void StepField(float ratio, float period, float intensity)
Creates a stepped pattern effect in the vector field.
void Advect(float dt)
Advances the vector field using advection.
uint32_t GetVectorAtPosition(float x, float y, bool &inBounds)
Retrieves the vector at a specific position in the field.
void SetPosition(float posX, float posY)
Sets the position of the vector field.
RGBColor GetRGB(const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override
Retrieves the RGB color corresponding to a position in the field.
const uint16_t countY
Number of vectors along the Y-axis.
const uint16_t countX
Number of vectors along the X-axis.
int8_t * vecXP
X-component of previous vectors.
void ObjectField(Object3D *object, float intensity)
Generates a field effect based on a 3D object's position and shape.
void MovingSquareField(float ratio, float period, float intensity)
Creates a moving square pattern in the vector field.
void Boundary()
Applies boundary conditions to the vector field.
void SpiralField(float ratio, float period, float amplitude)
Creates a spiral pattern in the vector field.
void Diffuse(float viscosity, float dt)
Performs diffusion on the vector field.
void SetSize(float sizeX, float sizeY)
Sets the size of the vector field.
Vector2D size
Size of the vector field.
int8_t * vecYP
Y-component of previous vectors.