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

#include <PointMass.h>

Inheritance diagram for Physics::PointMass:
[legend]
Collaboration diagram for Physics::PointMass:
[legend]

Public Member Functions

 PointMass (uint32_t id, double m, glm::vec3 pos=glm::vec3(0.0f), bool isStatic=false)
 
 PointMass (uint32_t id, glm::vec3 pos=glm::vec3(0.0f), bool isStatic=true)
 
void applyImpulse (const glm::vec3 &impulse, BodyLock lock)
 
void setMass (double newMass, BodyLock lock) override
 
void setThermalProperty (const ThermalProperties &newProps, BodyLock lock) override
 
void step (float dt, BodyLock lock) override
 
void recordFrame (float t, BodyLock lock) override
 
void loadFrame (const ObjectSnapshot &snapshot, BodyLock lock) override
 
bool collidesWith (const PhysicsBody &other) const override
 
bool collidesWithPointMass (const PointMass &pm) const override
 
bool collidesWithRigidBody (const RigidBody &rb) const override
 
bool resolveCollisionWith (float dt, PhysicsBody &other) override
 
bool resolveCollisionWithPointMass (float dt, PointMass &pm) override
 
bool resolveCollisionWithRigidBody (float dt, RigidBody &rb) override
 
- Public Member Functions inherited from Physics::PhysicsBody
 PhysicsBody ()=delete
 
virtual ~PhysicsBody ()=default
 
std::unique_lock< std::mutex > lockState () const
 
uint32_t getID () const
 
bool isUnknown (const std::string &key, BodyLock lock) const
 
void setUnknown (const std::string &key, bool active, BodyLock lock)
 
void setForce (const std::string &name, const glm::vec3 &force, BodyLock lock)
 
glm::vec3 getForce (const std::string &name, BodyLock lock) const
 
glm::vec3 getNetForce (BodyLock lock) const
 
std::map< std::string, glm::vec3 > getAllForces (BodyLock lock) const
 
glm::vec3 getPosition (BodyLock lock) const
 
void setPosition (const glm::vec3 &pos, BodyLock lock)
 
glm::vec3 getVelocity (BodyLock lock) const
 
void setVelocity (const glm::vec3 &vel, BodyLock lock)
 
virtual double getMass (BodyLock lock) const
 
virtual ThermalProperties getThermalProperties (BodyLock lock) const
 
float getSurfaceArea () const
 
bool getIsStatic (BodyLock lock) const
 
void setIsStatic (bool newStatic, BodyLock lock)
 
glm::mat4 getWorldTransform (BodyLock lock) const
 
void setWorldTransform (const glm::mat4 &M, BodyLock lock)
 
void setGlobalAccelerationRef (std::atomic< glm::vec3 > &globalAccRef)
 
void clearAllFrames (BodyLock lock)
 
template<typename F >
void withFrames (BodyLock lock, F &&fn) const
 
virtual Bounding::ICollidergetCollider () const
 

Additional Inherited Members

- Protected Member Functions inherited from Physics::PhysicsBody
 PhysicsBody (uint32_t _id)
 
- Protected Attributes inherited from Physics::PhysicsBody
std::mutex stateMutex
 
std::vector< ObjectSnapshotframes
 
float surfaceArea = 1.0f
 

Detailed Description

Definition at line 10 of file PointMass.h.

Constructor & Destructor Documentation

◆ PointMass() [1/2]

Physics::PointMass::PointMass ( uint32_t  id,
double  m,
glm::vec3  pos = glm::vec3(0.0f),
bool  isStatic = false 
)
explicit

Definition at line 14 of file PointMass.cpp.

Here is the call graph for this function:

◆ PointMass() [2/2]

Physics::PointMass::PointMass ( uint32_t  id,
glm::vec3  pos = glm::vec3(0.0f),
bool  isStatic = true 
)
explicit

Definition at line 23 of file PointMass.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ applyImpulse()

void Physics::PointMass::applyImpulse ( const glm::vec3 &  impulse,
BodyLock  lock 
)

Definition at line 60 of file PointMass.cpp.

Here is the caller graph for this function:

◆ collidesWith()

bool Physics::PointMass::collidesWith ( const PhysicsBody other) const
overridevirtual

Implements Physics::PhysicsBody.

Definition at line 105 of file PointMass.cpp.

Here is the call graph for this function:

◆ collidesWithPointMass()

bool Physics::PointMass::collidesWithPointMass ( const PointMass pm) const
overridevirtual

Implements Physics::PhysicsBody.

Definition at line 109 of file PointMass.cpp.

Here is the call graph for this function:

◆ collidesWithRigidBody()

bool Physics::PointMass::collidesWithRigidBody ( const RigidBody rb) const
overridevirtual

Implements Physics::PhysicsBody.

Definition at line 113 of file PointMass.cpp.

Here is the call graph for this function:

◆ loadFrame()

void Physics::PointMass::loadFrame ( const ObjectSnapshot snapshot,
BodyLock  lock 
)
overridevirtual

Implements Physics::PhysicsBody.

Definition at line 82 of file PointMass.cpp.

Here is the caller graph for this function:

◆ recordFrame()

void Physics::PointMass::recordFrame ( float  t,
BodyLock  lock 
)
overridevirtual

Implements Physics::PhysicsBody.

Definition at line 74 of file PointMass.cpp.

◆ resolveCollisionWith()

bool Physics::PointMass::resolveCollisionWith ( float  dt,
PhysicsBody other 
)
overridevirtual

Implements Physics::PhysicsBody.

Definition at line 117 of file PointMass.cpp.

Here is the call graph for this function:

◆ resolveCollisionWithPointMass()

bool Physics::PointMass::resolveCollisionWithPointMass ( float  dt,
PointMass pm 
)
overridevirtual

Implements Physics::PhysicsBody.

Definition at line 121 of file PointMass.cpp.

Here is the call graph for this function:

◆ resolveCollisionWithRigidBody()

bool Physics::PointMass::resolveCollisionWithRigidBody ( float  dt,
RigidBody rb 
)
overridevirtual

Implements Physics::PhysicsBody.

Definition at line 156 of file PointMass.cpp.

Here is the call graph for this function:

◆ setMass()

void Physics::PointMass::setMass ( double  newMass,
BodyLock  lock 
)
overridevirtual

Reimplemented from Physics::PhysicsBody.

Definition at line 31 of file PointMass.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setThermalProperty()

void Physics::PointMass::setThermalProperty ( const ThermalProperties newProps,
BodyLock  lock 
)
overridevirtual

Reimplemented from Physics::PhysicsBody.

Definition at line 40 of file PointMass.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ step()

void Physics::PointMass::step ( float  dt,
BodyLock  lock 
)
overridevirtual

Implements Physics::PhysicsBody.

Definition at line 94 of file PointMass.cpp.


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