C# Класс MrGravity.Game_Objects.Physics_Objects.PhysicsObject

Represents an object that has rules based on physics
Наследование: GameObject
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
MEnvironment PhysicsEnvironment
MMass float

Открытые методы

Метод Описание
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

Описание методов

AddForce() публичный Метод

Adds an additional force to the physics object
public AddForce ( Vector2 force ) : void
force Vector2 Force to be added
Результат void

ApplyImmediateForce() публичный Метод

Applies the force immediately. This will not be permanant
public ApplyImmediateForce ( Vector2 force ) : void
force Vector2 Force to apply
Результат void

ChangeGravityForceDirection() публичный Метод

Reorient gravity in the given direction
public ChangeGravityForceDirection ( GravityDirections direction ) : void
direction GravityDirections Direction to enforce gravity on
Результат void

Equals() публичный Метод

public Equals ( otherObject otherObject ) : System
otherObject otherObject
Результат System

FixForBounds() публичный Метод

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
Результат void

GetCollitionDepth() публичный Метод

finds how deep they are intersecting (That is what she said!)
public GetCollitionDepth ( GameObject otherObject ) : Vector2
otherObject GameObject
Результат Vector2

HandleCollideBoxAndBox() публичный Метод

Handles collision for two boxes (this, and other)
public HandleCollideBoxAndBox ( GameObject otherObject ) : int
otherObject GameObject object to do collision on(box)
Результат int

HandleCollideCircleAndBox() публичный Метод

Handles collision for circle and Box (circle =this)
public HandleCollideCircleAndBox ( GameObject otherObject ) : int
otherObject GameObject object to do collision on(box)
Результат int

HandleCollideCircleAndCircle() публичный Метод

Handles collision for circle and circle
public HandleCollideCircleAndCircle ( GameObject otherObject ) : int
otherObject GameObject object to do collision on(circle)
Результат int

HandleCollisionList() публичный Метод

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
Результат void

HandleCollisions() публичный Метод

Decides on the collision detection method for this and the given object
public HandleCollisions ( GameObject obj ) : bool
obj GameObject object we are testing
Результат bool

IsCollidingBoxAndBox() публичный Метод

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
Результат bool

PhysicsObject() публичный Метод

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
Результат System

Описание свойств

MEnvironment защищенное свойство

protected PhysicsEnvironment MEnvironment
Результат PhysicsEnvironment

MMass защищенное свойство

protected float MMass
Результат float