C# Class MrGravity.Game_Objects.Physics_Objects.PhysicsObject

Represents an object that has rules based on physics
Inheritance: GameObject
Afficher le fichier Open project: DizWARE/Mr-Gravity Class Usage Examples

Protected Properties

Свойство Type Description
MEnvironment PhysicsEnvironment
MMass float

Méthodes publiques

Méthode Description
AddForce ( Vector2 force ) : void

Adds an additional force to the physics object

ApplyImmediateForce ( Vector2 force ) : void

Applies the force immediately. This will not be permanant

ChangeGravityForceDirection ( GravityDirections direction ) : void

Reorient gravity in the given direction

Equals ( otherObject otherObject ) : System
FixForBounds ( int width, int height, bool isFixed ) : void

TEMP METHOD - WILL GIVE THE PLAYER THE ABILITY TO FALL FROM ONE END OF THE SCREEN TO THE OTHER

GetCollitionDepth ( GameObject otherObject ) : Vector2

finds how deep they are intersecting (That is what she said!)

HandleCollideBoxAndBox ( GameObject otherObject ) : int

Handles collision for two boxes (this, and other)

HandleCollideCircleAndBox ( GameObject otherObject ) : int

Handles collision for circle and Box (circle =this)

HandleCollideCircleAndCircle ( GameObject otherObject ) : int

Handles collision for circle and circle

HandleCollisionList ( List objList ) : void

Allows for only one collision to be done. Whichever object this is colliding with deepest, handle only that collision.

HandleCollisions ( GameObject obj ) : bool

Decides on the collision detection method for this and the given object

IsCollidingBoxAndBox ( GameObject otherObject ) : bool

Returns true if the physics objects are colliding with each other (only good for 2 boxes)

PhysicsObject ( Microsoft.Xna.Framework.Content.ContentManager content, PhysicsEnvironment &environment, float friction, EntityInfo entity ) : System

Constructs a PhysicsObject; Loads the required info from the content pipeline, and defines its size and location

Method Details

AddForce() public méthode

Adds an additional force to the physics object
public AddForce ( Vector2 force ) : void
force Vector2 Force to be added
Résultat void

ApplyImmediateForce() public méthode

Applies the force immediately. This will not be permanant
public ApplyImmediateForce ( Vector2 force ) : void
force Vector2 Force to apply
Résultat void

ChangeGravityForceDirection() public méthode

Reorient gravity in the given direction
public ChangeGravityForceDirection ( GravityDirections direction ) : void
direction GravityDirections Direction to enforce gravity on
Résultat void

Equals() public méthode

public Equals ( otherObject otherObject ) : System
otherObject otherObject
Résultat System

FixForBounds() public méthode

TEMP METHOD - WILL GIVE THE PLAYER THE ABILITY TO FALL FROM ONE END OF THE SCREEN TO THE OTHER
public FixForBounds ( int width, int height, bool isFixed ) : void
width int
height int
isFixed bool
Résultat void

GetCollitionDepth() public méthode

finds how deep they are intersecting (That is what she said!)
public GetCollitionDepth ( GameObject otherObject ) : Vector2
otherObject GameObject
Résultat Vector2

HandleCollideBoxAndBox() public méthode

Handles collision for two boxes (this, and other)
public HandleCollideBoxAndBox ( GameObject otherObject ) : int
otherObject GameObject object to do collision on(box)
Résultat int

HandleCollideCircleAndBox() public méthode

Handles collision for circle and Box (circle =this)
public HandleCollideCircleAndBox ( GameObject otherObject ) : int
otherObject GameObject object to do collision on(box)
Résultat int

HandleCollideCircleAndCircle() public méthode

Handles collision for circle and circle
public HandleCollideCircleAndCircle ( GameObject otherObject ) : int
otherObject GameObject object to do collision on(circle)
Résultat int

HandleCollisionList() public méthode

Allows for only one collision to be done. Whichever object this is colliding with deepest, handle only that collision.
public HandleCollisionList ( List objList ) : void
objList List list of objects that this is colliding with
Résultat void

HandleCollisions() public méthode

Decides on the collision detection method for this and the given object
public HandleCollisions ( GameObject obj ) : bool
obj GameObject object we are testing
Résultat bool

IsCollidingBoxAndBox() public méthode

Returns true if the physics objects are colliding with each other (only good for 2 boxes)
public IsCollidingBoxAndBox ( GameObject otherObject ) : bool
otherObject GameObject The other object to test against
Résultat bool

PhysicsObject() public méthode

Constructs a PhysicsObject; Loads the required info from the content pipeline, and defines its size and location
public PhysicsObject ( Microsoft.Xna.Framework.Content.ContentManager content, PhysicsEnvironment &environment, float friction, EntityInfo entity ) : System
content Microsoft.Xna.Framework.Content.ContentManager Content pipeline
environment PhysicsEnvironment
friction float
entity MrGravity.Import_Code.EntityInfo
Résultat System

Property Details

MEnvironment protected_oe property

protected PhysicsEnvironment MEnvironment
Résultat PhysicsEnvironment

MMass protected_oe property

protected float MMass
Résultat float