C# Class Source.Collisions.Body

A body, could be any polygon or circle
Afficher le fichier Open project: HarkerGameDev/TheGame

Méthodes publiques

Свойство Type Description
Color Color
Velocity Vector2

Protected Properties

Свойство Type Description
Points Vector2[]

Méthodes publiques

Méthode Description
Body ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Vector2 size, float rotation = 0f ) : System
Draw ( SpriteBatch spriteBatch ) : void
Intersects ( Polygon other ) : Vector2

Intersection detection function Mostly derived from http://www.codeproject.com/Articles/15573/2D-Polygon-Collision-Detection

MoveByPosition ( Vector2 by ) : void
MoveToPosition ( Vector2 pos ) : void
Raycast ( Vector2 rayStart, Vector2 rayDir ) : float

Gets the parametric T value for the ray on start in direction dir, 0 if nothing Based on http://ncase.me/sight-and-light/

TestPoint ( Vector2 point ) : bool

Currently making a small rectangle and using Intersect to TestPoint

Update ( float deltaTime ) : void

Method Details

Body() public méthode

public Body ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Vector2 size, float rotation = 0f ) : System
texture Microsoft.Xna.Framework.Graphics.Texture2D
position Vector2
size Vector2
rotation float
Résultat System

Draw() public méthode

public Draw ( SpriteBatch spriteBatch ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
Résultat void

Intersects() public abstract méthode

Intersection detection function Mostly derived from http://www.codeproject.com/Articles/15573/2D-Polygon-Collision-Detection
public abstract Intersects ( Polygon other ) : Vector2
other Polygon The other Body to check intersection with
Résultat Vector2

MoveByPosition() public méthode

public MoveByPosition ( Vector2 by ) : void
by Vector2
Résultat void

MoveToPosition() public méthode

public MoveToPosition ( Vector2 pos ) : void
pos Vector2
Résultat void

Raycast() public abstract méthode

Gets the parametric T value for the ray on start in direction dir, 0 if nothing Based on http://ncase.me/sight-and-light/
public abstract Raycast ( Vector2 rayStart, Vector2 rayDir ) : float
rayStart Vector2
rayDir Vector2
Résultat float

TestPoint() public méthode

Currently making a small rectangle and using Intersect to TestPoint
public TestPoint ( Vector2 point ) : bool
point Vector2
Résultat bool

Update() public méthode

public Update ( float deltaTime ) : void
deltaTime float
Résultat void

Property Details

Color public_oe property

public Color Color
Résultat Color

Points protected_oe property

protected Vector2[] Points
Résultat Vector2[]

Velocity public_oe property

public Vector2 Velocity
Résultat Vector2