![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Represents a 3D object with geometry, material, and transformation data. More...
#include <Object3D.h>

Public Member Functions | |
| Object3D (IStaticTriangleGroup *originalTriangles, ITriangleGroup *modifiedTriangles, Material *material) | |
Constructs an Object3D instance. | |
| ~Object3D () | |
Destructor for Object3D. | |
| void | Enable () |
| Enables the object, making it visible and active. | |
| void | Disable () |
| Disables the object, making it invisible and inactive. | |
| bool | IsEnabled () |
| Checks if the object is enabled. | |
| Vector3D | GetCenterOffset () |
| Retrieves the object's center offset. | |
| void | GetMinMaxDimensions (Vector3D &minimum, Vector3D &maximum) |
| Retrieves the minimum and maximum dimensions of the object. | |
| Vector3D | GetSize () |
| Retrieves the size of the object. | |
| Transform * | GetTransform () |
| Retrieves the object's transformation data. | |
| void | SetTransform (Transform &t) |
| Sets the object's transformation data. | |
| void | ResetVertices () |
| Resets the object's vertices to their original positions. | |
| void | UpdateTransform () |
| Updates the object's geometry based on its transformation data. | |
| ITriangleGroup * | GetTriangleGroup () |
| Retrieves the modifiable geometry of the object. | |
| Material * | GetMaterial () |
| Retrieves the material assigned to the object. | |
| void | SetMaterial (Material *material) |
| Sets the material for the object. | |
Private Attributes | |
| Transform | transform |
| Transform object representing the object's position, rotation, and scale. | |
| IStaticTriangleGroup * | originalTriangles |
| Pointer to the static representation of the object's geometry. | |
| ITriangleGroup * | modifiedTriangles |
| Pointer to the modifiable representation of the object's geometry. | |
| Material * | material |
| Pointer to the material assigned to the object. | |
| bool | enabled = true |
| Indicates whether the object is currently enabled. | |
Represents a 3D object with geometry, material, and transformation data.
The Object3D class manages the geometric representation, transformation, and material properties of a 3D object. It provides methods to enable or disable the object, modify its transformations, reset its geometry, and retrieve its material or geometry data.
Definition at line 28 of file Object3D.h.
| Object3D | ( | IStaticTriangleGroup * | originalTriangles, |
| ITriangleGroup * | modifiedTriangles, | ||
| Material * | material | ||
| ) |
Constructs an Object3D instance.
| originalTriangles | Pointer to the static representation of the object's geometry. |
| modifiedTriangles | Pointer to the modifiable representation of the object's geometry. |
| material | Pointer to the material assigned to the object. |
Definition at line 3 of file Object3D.cpp.
References material.
| ~Object3D | ( | ) |
Destructor for Object3D.
Definition at line 7 of file Object3D.cpp.
| void Disable | ( | ) |
Disables the object, making it invisible and inactive.
Definition at line 13 of file Object3D.cpp.
References enabled.
| void Enable | ( | ) |
Enables the object, making it visible and active.
Definition at line 9 of file Object3D.cpp.
References enabled.
| Vector3D GetCenterOffset | ( | ) |
Retrieves the object's center offset.
Vector3D representing the object's center offset. Definition at line 21 of file Object3D.cpp.
References Vector3D::Divide(), ITriangleGroup::GetVertexCount(), ITriangleGroup::GetVertices(), and modifiedTriangles.
| Material * GetMaterial | ( | ) |
Retrieves the material assigned to the object.
Material assigned to the object. Definition at line 76 of file Object3D.cpp.
References material.
Referenced by Rasterizer::Rasterize().
Retrieves the minimum and maximum dimensions of the object.
| minimum | Reference to a Vector3D to store the minimum dimensions. |
| maximum | Reference to a Vector3D to store the maximum dimensions. |
Definition at line 31 of file Object3D.cpp.
References ITriangleGroup::GetVertexCount(), ITriangleGroup::GetVertices(), Vector3D::Max(), Vector3D::Min(), and modifiedTriangles.
Referenced by GetSize().
| Vector3D GetSize | ( | ) |
Retrieves the size of the object.
Vector3D representing the object's size. Definition at line 38 of file Object3D.cpp.
References GetMinMaxDimensions().
| Transform * GetTransform | ( | ) |
Retrieves the object's transformation data.
Transform object. Definition at line 46 of file Object3D.cpp.
References transform.
Referenced by BoundaryMotionSimulator::Update(), and PhysicsSimulator::Update().
| ITriangleGroup * GetTriangleGroup | ( | ) |
Retrieves the modifiable geometry of the object.
ITriangleGroup representing the object's modifiable geometry. Definition at line 72 of file Object3D.cpp.
References modifiedTriangles.
Referenced by ObjectAlign::AlignObjects(), ObjectAlign::AlignObjectsNoScale(), ObjectDeformer::AxisZeroClipping(), ObjectDeformer::CosineInterpolationDeformer(), ObjectDeformer::DropwaveDeform(), ObjectAlign::GetCentroid(), ObjectAlign::GetObjectCenter(), ObjectAlign::GetObjectPlanarityRatio(), ObjectAlign::GetObjectSize(), ObjectAlign::GetPlaneNormal(), ObjectAlign::GetPlaneOrientation(), ObjectAlign::NormalizeObjectCenter(), ObjectAlign::NormalizeObjectPlane(), VectorField2D::ObjectField(), ObjectDeformer::PerspectiveDeform(), Rasterizer::Rasterize(), ObjectDeformer::SineWaveSurfaceDeform(), and ObjectDeformer::SinusoidalDeform().
| bool IsEnabled | ( | ) |
Checks if the object is enabled.
Definition at line 17 of file Object3D.cpp.
References enabled.
Referenced by Rasterizer::Rasterize().
| void ResetVertices | ( | ) |
Resets the object's vertices to their original positions.
Definition at line 54 of file Object3D.cpp.
References ITriangleGroup::GetVertexCount(), IStaticTriangleGroup::GetVertices(), ITriangleGroup::GetVertices(), modifiedTriangles, and originalTriangles.
Referenced by BoundaryMotionSimulator::Update(), and Crash::Update().
Sets the material for the object.
| material | Pointer to the new Material to be assigned. |
Definition at line 80 of file Object3D.cpp.
References material.
Sets the object's transformation data.
| t | Reference to the new Transform. |
Definition at line 50 of file Object3D.cpp.
References transform.
| void UpdateTransform | ( | ) |
Updates the object's geometry based on its transformation data.
Definition at line 60 of file Object3D.cpp.
References Transform::GetPosition(), Transform::GetRotation(), Transform::GetRotationOffset(), Transform::GetScale(), Transform::GetScaleOffset(), ITriangleGroup::GetVertexCount(), ITriangleGroup::GetVertices(), modifiedTriangles, Quaternion::RotateVector(), and transform.
Indicates whether the object is currently enabled.
Definition at line 34 of file Object3D.h.
Referenced by Disable(), Enable(), and IsEnabled().
|
private |
Pointer to the material assigned to the object.
Definition at line 33 of file Object3D.h.
Referenced by GetMaterial(), Object3D(), and SetMaterial().
|
private |
Pointer to the modifiable representation of the object's geometry.
Definition at line 32 of file Object3D.h.
Referenced by GetCenterOffset(), GetMinMaxDimensions(), GetTriangleGroup(), ResetVertices(), and UpdateTransform().
|
private |
Pointer to the static representation of the object's geometry.
Definition at line 31 of file Object3D.h.
Referenced by ResetVertices().
|
private |
Transform object representing the object's position, rotation, and scale.
Definition at line 30 of file Object3D.h.
Referenced by GetTransform(), SetTransform(), and UpdateTransform().