Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
Loading...
Searching...
No Matches
Forces Class Reference

#include <Forces.h>

Inheritance diagram for Forces:
[legend]
Collaboration diagram for Forces:
[legend]

Public Member Functions

 Forces (SceneManager *sceneManager)
 
 ~Forces () override=default
 
ShadergetShader () const override
 Gets the shader used to render this object.
 
MeshgetMesh () const override
 Gets the mesh geometry for this object.
 
uint32_t getObjectID () const override
 Gets the unique identifier for this object.
 
void draw () const override
 Performs custom rendering for this object.
 
void setEnabled (bool value)
 
- Public Member Functions inherited from IDrawable
virtual ~IDrawable ()=default
 Virtual destructor for proper cleanup of derived classes.
 

Detailed Description

Definition at line 12 of file Forces.h.

Constructor & Destructor Documentation

◆ Forces()

Forces::Forces ( SceneManager sceneManager)

Definition at line 40 of file Forces.cpp.

Here is the call graph for this function:

◆ ~Forces()

Forces::~Forces ( )
overridedefault

Member Function Documentation

◆ draw()

void Forces::draw ( ) const
overridevirtual

Performs custom rendering for this object.

Implementations are responsible for:

  • Binding appropriate shaders and setting uniforms
  • Managing OpenGL state (depth testing, blending, etc.)
  • Issuing draw calls (direct or instanced)
  • Restoring OpenGL state if modified

This method is called after all instanced objects are rendered.

Note
The camera matrices uniform buffer is already bound when called.
See also
Scene::draw()

Implements ICustomDrawable.

Definition at line 47 of file Forces.cpp.

Here is the call graph for this function:

◆ getMesh()

Mesh * Forces::getMesh ( ) const
inlineoverridevirtual

Gets the mesh geometry for this object.

The mesh is used as part of the batch key for instanced rendering, grouping objects that share the same shader and mesh.

Returns
Pointer to the Mesh object. Must not be null.
See also
ResourceManager::getMesh()
Scene::draw()

Implements IDrawable.

Definition at line 18 of file Forces.h.

◆ getObjectID()

uint32_t Forces::getObjectID ( ) const
inlineoverridevirtual

Gets the unique identifier for this object.

This ID is used for:

  • Object picking and selection
  • Hover state highlighting via shader uniforms
  • Per-instance identification in the rendering pipeline
Returns
The object's unique identifier.
See also
Scene::allocateObjectID()
Scene::freeObjectID()

Implements IDrawable.

Definition at line 19 of file Forces.h.

◆ getShader()

Shader * Forces::getShader ( ) const
inlineoverridevirtual

Gets the shader used to render this object.

The shader is used as part of the batch key for instanced rendering, grouping objects that share the same shader and mesh.

Returns
Pointer to the Shader object. Must not be null.
See also
ResourceManager::getShader()
Scene::draw()

Implements IDrawable.

Definition at line 17 of file Forces.h.

◆ setEnabled()

void Forces::setEnabled ( bool  value)
inline

Definition at line 23 of file Forces.h.


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