Verlet Intergration Soft Body
Loading...
Searching...
No Matches
PhysicsCSAlevlProject.Particle Class Reference

The Particle class represents a single particle in the physics simulation, containing properties such as position, mass, accumulated force, and whether it is pinned or selected. The DrawableParticle class extends Particle by adding visual properties like color and size, and includes a method to draw itself using a SpriteBatch and PrimitiveBatch. The OscillatingParticle class further extends DrawableParticle to include oscillation parameters such as amplitude, frequency, and angle, allowing it to move in a sinusoidal pattern around an anchor position. This design allows for flexible representation of particles in the simulation, supporting both static and dynamic behaviors while also providing visual feedback for rendering. More...

Inheritance diagram for PhysicsCSAlevlProject.Particle:
PhysicsCSAlevlProject.DrawableParticle

Public Member Functions

 Particle (Vector2 position, float mass, bool isPinned)

Public Attributes

Vector2 Position
 the position of the particle
Vector2 PreviousPosition
 the previous position of the particle
float Mass
 the mass of the particle
Vector2 AccumulatedForce
 the accumalated force due to hooks law
int ID
 the ID of the particle
float TotalForceMagnitude
 magnitude of of the total force applied to the particle
bool IsPinned
 toggle for if th eparticle is pinned used to determine if the particle should be affected by physics or not
bool IsSelected
 toggle for if the particle is selected used for the UI to determine if the particle should be drawn with a selection highlight and to allow the particle to be dragged with the mouse when selected

Detailed Description

The Particle class represents a single particle in the physics simulation, containing properties such as position, mass, accumulated force, and whether it is pinned or selected. The DrawableParticle class extends Particle by adding visual properties like color and size, and includes a method to draw itself using a SpriteBatch and PrimitiveBatch. The OscillatingParticle class further extends DrawableParticle to include oscillation parameters such as amplitude, frequency, and angle, allowing it to move in a sinusoidal pattern around an anchor position. This design allows for flexible representation of particles in the simulation, supporting both static and dynamic behaviors while also providing visual feedback for rendering.


The documentation for this class was generated from the following file:
  • PhysicsCSAlevlProject/Objects.Particles.cs