Verlet Intergration Soft Body
Loading...
Searching...
No Matches
VectorGraphics.PrimitiveBatch.Line Class Reference

Represents a line shape defined by a start position, an end position, a color, and a width. The line can be drawn using the Draw method, which calculates the angle and length of the line to properly render it using the white pixel texture. The ConstrainToSide method is used to constrain a point to one side of the line, which can be useful for collision detection or ensuring that particles do not cross the line. More...

Inheritance diagram for VectorGraphics.PrimitiveBatch.Line:
VectorGraphics.PrimitiveBatch.Shape

Public Member Functions

 Line (Vector2 start, Vector2 end, Color color, float width)
 Line (Vector2 start, float angle, float distance, Color color, float width)
override void Draw (SpriteBatch spriteBatch, PrimitiveBatch primitiveBatch)
Public Member Functions inherited from VectorGraphics.PrimitiveBatch.Shape
 Shape (Vector2 position, Color color, bool filled=true)
void Draw (SpriteBatch spriteBatch, PrimitiveBatch primitiveBatch)

Static Public Member Functions

static void Draw (SpriteBatch spriteBatch, PrimitiveBatch primitiveBatch, Vector2 start, Vector2 end, Color color, float width)
static Vector2 ConstrainToSide (Vector2 position, Vector2 start, Vector2 end, float particleRadius=5f)

Public Attributes

Vector2 end
float width
Public Attributes inherited from VectorGraphics.PrimitiveBatch.Shape
Vector2 position
Color color
bool filled

Detailed Description

Represents a line shape defined by a start position, an end position, a color, and a width. The line can be drawn using the Draw method, which calculates the angle and length of the line to properly render it using the white pixel texture. The ConstrainToSide method is used to constrain a point to one side of the line, which can be useful for collision detection or ensuring that particles do not cross the line.


The documentation for this class was generated from the following file:
  • PhysicsCSAlevlProject/libs/MonoGame2DVectorGraphics/Vector.cs