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

The Stick class represents a connection between two particles in the physics simulation, defined by its endpoints (P1 and P2) and its natural length. The DrawableStick class extends Stick by adding visual properties such as color and width, and includes a method to draw itself using a SpriteBatch and PrimitiveBatch. The IsCut property allows for simulating stick breakage, where a stick can be marked as cut to prevent it from being drawn or participating in physics interactions. This design allows for flexible representation of connections between particles, supporting both intact and broken sticks while also providing visual feedback for rendering the mesh structure. More...

Inheritance diagram for PhysicsCSAlevlProject.Stick:
PhysicsCSAlevlProject.DrawableStick PhysicsCSAlevlProject.Mesh.MeshStick

Public Member Functions

 Stick (Particle p1, Particle p2)

Public Attributes

Particle P1
 the inital particle the stick is connected to
Particle P2
 the final particle the stick is connected to
float Length
 the natural length of the stick, which is the distance between the two particles when the stick is at rest

Detailed Description

The Stick class represents a connection between two particles in the physics simulation, defined by its endpoints (P1 and P2) and its natural length. The DrawableStick class extends Stick by adding visual properties such as color and width, and includes a method to draw itself using a SpriteBatch and PrimitiveBatch. The IsCut property allows for simulating stick breakage, where a stick can be marked as cut to prevent it from being drawn or participating in physics interactions. This design allows for flexible representation of connections between particles, supporting both intact and broken sticks while also providing visual feedback for rendering the mesh structure.


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