C# Class MyPolarBear.EntityHelper

Show file Open project: sgdc/sgdc-old

Public Methods

Method Description
AngleBetween ( Vector2 firstVector, Vector2 secondVector ) : float
CollisionBoxFromTexture ( Vector2 position, Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 origin, float scale ) : Rectangle
DistanceBetween ( Vector2 firstVector, Vector2 secondVector ) : float
LevelBounce ( Rectangle EntityCollisionBox, Rectangle LevelCollisionBox, float Bounciness ) : Vector2
MoveBackOnScreen ( Rectangle EntityCollisionBox, Rectangle ScreenCollisionBox ) : Vector2
OriginFromTexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : Vector2

Returns a vector at the center of the given texture.

UpdateCollisionBox ( Rectangle collisionBox, Vector2 position, Vector2 origin, float scale ) : Rectangle
WallBounce ( Rectangle EntityCollisionBox, Rectangle WallCollisionBox, float Bounciness ) : Vector2

Method Details

AngleBetween() public static method

public static AngleBetween ( Vector2 firstVector, Vector2 secondVector ) : float
firstVector Vector2
secondVector Vector2
return float

CollisionBoxFromTexture() public static method

public static CollisionBoxFromTexture ( Vector2 position, Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 origin, float scale ) : Rectangle
position Vector2
texture Microsoft.Xna.Framework.Graphics.Texture2D
origin Vector2
scale float
return Microsoft.Xna.Framework.Rectangle

DistanceBetween() public static method

public static DistanceBetween ( Vector2 firstVector, Vector2 secondVector ) : float
firstVector Vector2
secondVector Vector2
return float

LevelBounce() public static method

public static LevelBounce ( Rectangle EntityCollisionBox, Rectangle LevelCollisionBox, float Bounciness ) : Vector2
EntityCollisionBox Microsoft.Xna.Framework.Rectangle
LevelCollisionBox Microsoft.Xna.Framework.Rectangle
Bounciness float
return Vector2

MoveBackOnScreen() public static method

public static MoveBackOnScreen ( Rectangle EntityCollisionBox, Rectangle ScreenCollisionBox ) : Vector2
EntityCollisionBox Microsoft.Xna.Framework.Rectangle
ScreenCollisionBox Microsoft.Xna.Framework.Rectangle
return Vector2

OriginFromTexture() public static method

Returns a vector at the center of the given texture.
public static OriginFromTexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : Vector2
texture Microsoft.Xna.Framework.Graphics.Texture2D The texture to find the origin of.
return Vector2

UpdateCollisionBox() public static method

public static UpdateCollisionBox ( Rectangle collisionBox, Vector2 position, Vector2 origin, float scale ) : Rectangle
collisionBox Microsoft.Xna.Framework.Rectangle
position Vector2
origin Vector2
scale float
return Microsoft.Xna.Framework.Rectangle

WallBounce() public static method

public static WallBounce ( Rectangle EntityCollisionBox, Rectangle WallCollisionBox, float Bounciness ) : Vector2
EntityCollisionBox Microsoft.Xna.Framework.Rectangle
WallCollisionBox Microsoft.Xna.Framework.Rectangle
Bounciness float
return Vector2