![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Applies geometric transformations to one or more 3D objects. More...
#include <ObjectDeformer.h>
Public Types | |
enum | Axis { XAxis , YAxis , ZAxis } |
Represents the axis of deformation or clipping. More... | |
Private Member Functions | |
bool | CheckClipAxis (Vector3D base, bool positive, Axis valueCheckAxis) |
Checks if a given axis value exceeds a clipping threshold. | |
Private Attributes | |
Object3D ** | objects |
Array of pointers to Object3D instances to be deformed. | |
int | objectCount = 0 |
Number of objects in the objects array. | |
Applies geometric transformations to one or more 3D objects.
The ObjectDeformer
class allows for various deformations, including perspective, sinusoidal waves, and surface-based transformations. It supports operations on both individual objects and collections of objects.
Definition at line 25 of file ObjectDeformer.h.
Represents the axis of deformation or clipping.
Enumerator | |
---|---|
XAxis | X-axis. |
YAxis | Y-axis. |
ZAxis | Z-axis. |
Definition at line 31 of file ObjectDeformer.h.
ObjectDeformer | ( | Object3D * | object | ) |
Constructs an ObjectDeformer
for a single object.
object | Pointer to the Object3D to be deformed. |
Definition at line 27 of file ObjectDeformer.cpp.
References objectCount, and objects.
ObjectDeformer | ( | Object3D ** | objects, |
int | objectCount | ||
) |
Constructs an ObjectDeformer
for multiple objects.
objects | Pointer to an array of Object3D pointers. |
objectCount | Number of objects in the array. |
Definition at line 35 of file ObjectDeformer.cpp.
References objectCount, and objects.
Clips the object(s) along a specified axis.
positive | Determines whether to clip positive or negative values. |
clipAxis | Axis along which clipping is performed. |
valueCheckAxis | Axis used for value checks during clipping. |
Definition at line 189 of file ObjectDeformer.cpp.
References CheckClipAxis(), Object3D::GetTriangleGroup(), ITriangleGroup::GetVertices(), objectCount, objects, Vector3D::X, XAxis, Vector3D::Y, YAxis, Vector3D::Z, and ZAxis.
Checks if a given axis value exceeds a clipping threshold.
base | The base vector to check. |
positive | Determines whether the check is for positive or negative values. |
valueCheckAxis | The axis to check for clipping. |
Definition at line 3 of file ObjectDeformer.cpp.
References Vector3D::X, XAxis, Vector3D::Y, YAxis, Vector3D::Z, and ZAxis.
Referenced by AxisZeroClipping().
void CosineInterpolationDeformer | ( | float * | pointMultiplier, |
int | points, | ||
float | scale, | ||
float | minAxis, | ||
float | maxAxis, | ||
Axis | selectionAxis, | ||
Axis | deformAxis | ||
) |
Applies cosine interpolation deformation to the object(s).
pointMultiplier | Array of multipliers for point deformation. |
points | Number of points to deform. |
scale | Scaling factor for the deformation. |
minAxis | Minimum axis value for the deformation range. |
maxAxis | Maximum axis value for the deformation range. |
selectionAxis | Axis used for selecting points to deform. |
deformAxis | Axis along which the deformation is applied. |
Definition at line 129 of file ObjectDeformer.cpp.
References Mathematics::CosineInterpolation(), Object3D::GetTriangleGroup(), ITriangleGroup::GetVertices(), objectCount, objects, Mathematics::RoundUpWindow(), Vector3D::X, XAxis, Vector3D::Y, YAxis, Vector3D::Z, and ZAxis.
void DropwaveDeform | ( | float | magnitude, |
float | timeRatio, | ||
float | periodModifier, | ||
float | frequencyModifier, | ||
Axis | axis | ||
) |
Applies a dropwave deformation to the object(s).
magnitude | Magnitude of the dropwave effect. |
timeRatio | Ratio for time-based animation. |
periodModifier | Modifier for the wave's period. |
frequencyModifier | Modifier for the wave's frequency. |
axis | Axis along which the deformation is applied. |
Definition at line 85 of file ObjectDeformer.cpp.
References Object3D::GetTriangleGroup(), ITriangleGroup::GetVertices(), objectCount, objects, Vector3D::X, XAxis, Vector3D::Y, YAxis, Vector3D::Z, and ZAxis.
Applies a perspective deformation to the object(s).
scaleRatio | Scaling factor for the deformation. |
center | Center point for the perspective effect. |
axis | Axis along which the deformation is applied. |
Definition at line 40 of file ObjectDeformer.cpp.
References Object3D::GetTriangleGroup(), ITriangleGroup::GetVertices(), objectCount, objects, Vector3D::X, XAxis, Vector3D::Y, YAxis, Vector3D::Z, and ZAxis.
void SineWaveSurfaceDeform | ( | Vector3D | offset, |
float | magnitude, | ||
float | timeRatio, | ||
float | periodModifier, | ||
float | frequencyModifier, | ||
Axis | axis | ||
) |
Applies a sine wave surface deformation to the object(s).
offset | Offset for the deformation center. |
magnitude | Magnitude of the wave. |
timeRatio | Ratio for time-based animation. |
periodModifier | Modifier for the wave's period. |
frequencyModifier | Modifier for the wave's frequency. |
axis | Axis along which the deformation is applied. |
Definition at line 107 of file ObjectDeformer.cpp.
References Object3D::GetTriangleGroup(), ITriangleGroup::GetVertices(), objectCount, objects, Vector3D::X, XAxis, Vector3D::Y, YAxis, Vector3D::Z, and ZAxis.
Referenced by Boot::Update().
void SinusoidalDeform | ( | float | magnitude, |
float | timeRatio, | ||
float | periodModifier, | ||
float | frequencyModifier, | ||
Axis | axis | ||
) |
Applies a sinusoidal deformation to the object(s).
magnitude | Magnitude of the sinusoidal wave. |
timeRatio | Ratio for time-based animation. |
periodModifier | Modifier for the wave's period. |
frequencyModifier | Modifier for the wave's frequency. |
axis | Axis along which the deformation is applied. |
Definition at line 63 of file ObjectDeformer.cpp.
References Object3D::GetTriangleGroup(), ITriangleGroup::GetVertices(), objectCount, objects, Vector3D::X, XAxis, Vector3D::Y, YAxis, Vector3D::Z, and ZAxis.
|
private |
Number of objects in the objects
array.
Definition at line 39 of file ObjectDeformer.h.
Referenced by AxisZeroClipping(), CosineInterpolationDeformer(), DropwaveDeform(), ObjectDeformer(), ObjectDeformer(), PerspectiveDeform(), SineWaveSurfaceDeform(), and SinusoidalDeform().
|
private |
Array of pointers to Object3D
instances to be deformed.
Definition at line 38 of file ObjectDeformer.h.
Referenced by AxisZeroClipping(), CosineInterpolationDeformer(), DropwaveDeform(), ObjectDeformer(), ObjectDeformer(), PerspectiveDeform(), SineWaveSurfaceDeform(), and SinusoidalDeform().