Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
Gondwana.Physics.Collisions.CollisionAdjust Struct Reference

Per-edge inset amounts applied to visual bounds to produce a collision rectangle. More...

Inheritance diagram for Gondwana.Physics.Collisions.CollisionAdjust:

Public Member Functions

 CollisionAdjust (int top, int bottom, int left, int right)
 Initializes a new instance of the CollisionAdjust struct.
readonly Rectangle ApplyTo (Rectangle rectangle)
 Applies this adjustment to the supplied rectangle.
readonly bool Equals (CollisionAdjust other)
override readonly bool Equals (object? obj)
override readonly int GetHashCode ()

Static Public Member Functions

static bool operator== (CollisionAdjust left, CollisionAdjust right)
 Determines whether two adjustments are equal.
static bool operator!= (CollisionAdjust left, CollisionAdjust right)
 Determines whether two adjustments are not equal.

Static Public Attributes

static readonly CollisionAdjust None = new()
 Represents an adjustment with no pixel offsets.

Properties

int Top [get, set]
 Gets or sets the number of pixels by which to inset the top edge.
int Bottom [get, set]
 Gets or sets the number of pixels by which to inset the bottom edge.
int Left [get, set]
 Gets or sets the number of pixels by which to inset the left edge.
int Right [get, set]
 Gets or sets the number of pixels by which to inset the right edge.

Detailed Description

Per-edge inset amounts applied to visual bounds to produce a collision rectangle.

Positive values move the corresponding edge inward toward the center of the rectangle. Negative values move the edge outward, expanding the rectangle.

Definition at line 15 of file CollisionAdjust.cs.

Constructor & Destructor Documentation

◆ CollisionAdjust()

Gondwana.Physics.Collisions.CollisionAdjust.CollisionAdjust ( int top,
int bottom,
int left,
int right )

Initializes a new instance of the CollisionAdjust struct.

Parameters
topThe signed inset amount for the top edge.
bottomThe signed inset amount for the bottom edge.
leftThe signed inset amount for the left edge.
rightThe signed inset amount for the right edge.

Definition at line 53 of file CollisionAdjust.cs.

Member Function Documentation

◆ ApplyTo()

readonly Rectangle Gondwana.Physics.Collisions.CollisionAdjust.ApplyTo ( Rectangle rectangle)

Applies this adjustment to the supplied rectangle.

Parameters
rectangleThe unadjusted visual rectangle.
Returns
The derived collision rectangle.

Definition at line 66 of file CollisionAdjust.cs.

◆ Equals() [1/2]

readonly bool Gondwana.Physics.Collisions.CollisionAdjust.Equals ( CollisionAdjust other)

◆ Equals() [2/2]

override readonly bool Gondwana.Physics.Collisions.CollisionAdjust.Equals ( object? obj)

◆ GetHashCode()

override readonly int Gondwana.Physics.Collisions.CollisionAdjust.GetHashCode ( )

◆ operator!=()

bool Gondwana.Physics.Collisions.CollisionAdjust.operator!= ( CollisionAdjust left,
CollisionAdjust right )
static

Determines whether two adjustments are not equal.

Parameters
leftThe left.
rightThe right.
Returns
true if the operands are not equal; otherwise, false.

◆ operator==()

bool Gondwana.Physics.Collisions.CollisionAdjust.operator== ( CollisionAdjust left,
CollisionAdjust right )
static

Determines whether two adjustments are equal.

Parameters
leftThe left.
rightThe right.
Returns
true if the operands are equal; otherwise, false.

Member Data Documentation

◆ None

readonly CollisionAdjust Gondwana.Physics.Collisions.CollisionAdjust.None = new()
static

Represents an adjustment with no pixel offsets.

Definition at line 44 of file CollisionAdjust.cs.

Property Documentation

◆ Bottom

int Gondwana.Physics.Collisions.CollisionAdjust.Bottom
getset

Gets or sets the number of pixels by which to inset the bottom edge.

Definition at line 27 of file CollisionAdjust.cs.

◆ Left

int Gondwana.Physics.Collisions.CollisionAdjust.Left
getset

Gets or sets the number of pixels by which to inset the left edge.

Definition at line 33 of file CollisionAdjust.cs.

◆ Right

int Gondwana.Physics.Collisions.CollisionAdjust.Right
getset

Gets or sets the number of pixels by which to inset the right edge.

Definition at line 39 of file CollisionAdjust.cs.

◆ Top

int Gondwana.Physics.Collisions.CollisionAdjust.Top
getset

Gets or sets the number of pixels by which to inset the top edge.

Definition at line 21 of file CollisionAdjust.cs.