C# 클래스 MrGravity.Game_Objects.Physics_Objects.PhysicsObject

Represents an object that has rules based on physics
상속: GameObject
파일 보기 프로젝트 열기: DizWARE/Mr-Gravity 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
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