C# 클래스 Project2.PhysicsSystem

This class encapsulates the physics system for a given world of physics bodies. A physics body is a (usually) non-drawn, relatively simple shape or mesh that contains properties (mass, inertia, etc) that the physics engine uses to resolve collisions and solve kinematics for. A physics body may be dynamic or static. A static body's position cannot be changed by the physics engine, but needs to be moved externally. A dynamic object's position will be affected by gravity and other forces and collisions, and does not get moved manually. Its position and orientation are queried externally and used to render representative objects/models on screen (usually more detailed than the physics mesh). This class is implemented as a GameSystem, meaning that once it is registered, it is automagically updated at the correct frequency.
상속: SharpDX.Toolkit.GameSystem
파일 보기 프로젝트 열기: nuclearpidgeon/graphicsproj2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
World Jitter.JitterWorld

보호된 프로퍼티들

프로퍼티 타입 설명
game Project2Game

공개 메소드들

메소드 설명
BuildConvexHullShape ( SharpDX.Toolkit.Graphics.Model model ) : Jitter.Collision.Shapes.ConvexHullShape
BuildOctree ( SharpDX.Toolkit.Graphics.Model model ) : Jitter.Collision.Octree
BuildTriangleMeshShape ( SharpDX.Toolkit.Graphics.Model model ) : Jitter.Collision.Shapes.TriangleMeshShape
OnManipulationCompleted ( GestureRecognizer sender, ManipulationCompletedEventArgs args ) : void

Releases physics body (if applicable) on release of pointer, either mouse button up or removal of touch input

OnManipulationStarted ( GestureRecognizer sender, ManipulationStartedEventArgs args ) : void

Handle initial starting movement of touch/mouse pointer

OnManipulationUpdated ( GestureRecognizer sender, ManipulationUpdatedEventArgs args ) : void

Handle touch/mouse manipulation updated

PhysicsSystem ( Project2Game game ) : System
Tapped ( GestureRecognizer sender, TappedEventArgs args ) : void
Update ( SharpDX.Toolkit.GameTime time ) : void

This method is automagically called as part of GameSystem to update the physics simulation. Physics system interpolates current running time with at max 1 itteration of the system over 1/60 seconds (by default).

addTestBox ( System.Vector3 position, float mass ) : void

Adds a unit sized test cube to the physics world. Deprecated.

toJMatrix ( System.Matrix matrix ) : Jitter.LinearMath.JMatrix

Helper method to interface SharpDX matrix class with Jitter matrix class.

toJVector ( System.Vector3 vector ) : Jitter.LinearMath.JVector

Helper method to interface SharpDX vector class with Jitter vector class.

toMatrix ( Jitter.LinearMath.JMatrix matrix ) : System.Matrix

Helper method to interface SharpDX matrix class with Jitter matrix class.

toVector3 ( Jitter.LinearMath.JVector vector ) : System.Vector3

Helper method to interface SharpDX vector class with Jitter vector class.

비공개 메소드들

메소드 설명
AddBody ( RigidBody rigidBody ) : void
ExtractVertices ( SharpDX.Toolkit.Graphics.Model model ) : List
HandleGrabBody ( System.Vector2 location ) : void

Searches for physics objects to "grab" based on in input location.

HandleMoveGrabBody ( System.Vector2 location ) : void

Moves physics body based on input (touch or mouse) movement location.

RayTo ( System.Vector2 mousePos ) : Ray

Takes a screen space point and maps it to a unit length ray vector in world space.

RaycastCallback ( RigidBody body, Jitter.LinearMath.JVector normal, float fraction ) : bool

Callback for Jitter Raycast method to check if an encountered physics object is static or the player (don't pick up if so..)

RemoveBody ( RigidBody rigidBody ) : void

메소드 상세

BuildConvexHullShape() 공개 정적인 메소드

public static BuildConvexHullShape ( SharpDX.Toolkit.Graphics.Model model ) : Jitter.Collision.Shapes.ConvexHullShape
model SharpDX.Toolkit.Graphics.Model
리턴 Jitter.Collision.Shapes.ConvexHullShape

BuildOctree() 공개 정적인 메소드

public static BuildOctree ( SharpDX.Toolkit.Graphics.Model model ) : Jitter.Collision.Octree
model SharpDX.Toolkit.Graphics.Model
리턴 Jitter.Collision.Octree

BuildTriangleMeshShape() 공개 정적인 메소드

public static BuildTriangleMeshShape ( SharpDX.Toolkit.Graphics.Model model ) : Jitter.Collision.Shapes.TriangleMeshShape
model SharpDX.Toolkit.Graphics.Model
리턴 Jitter.Collision.Shapes.TriangleMeshShape

OnManipulationCompleted() 공개 메소드

Releases physics body (if applicable) on release of pointer, either mouse button up or removal of touch input
public OnManipulationCompleted ( GestureRecognizer sender, ManipulationCompletedEventArgs args ) : void
sender Windows.UI.Input.GestureRecognizer
args Windows.UI.Input.ManipulationCompletedEventArgs
리턴 void

OnManipulationStarted() 공개 메소드

Handle initial starting movement of touch/mouse pointer
public OnManipulationStarted ( GestureRecognizer sender, ManipulationStartedEventArgs args ) : void
sender Windows.UI.Input.GestureRecognizer
args Windows.UI.Input.ManipulationStartedEventArgs
리턴 void

OnManipulationUpdated() 공개 메소드

Handle touch/mouse manipulation updated
public OnManipulationUpdated ( GestureRecognizer sender, ManipulationUpdatedEventArgs args ) : void
sender Windows.UI.Input.GestureRecognizer
args Windows.UI.Input.ManipulationUpdatedEventArgs
리턴 void

PhysicsSystem() 공개 메소드

public PhysicsSystem ( Project2Game game ) : System
game Project2Game
리턴 System

Tapped() 공개 메소드

public Tapped ( GestureRecognizer sender, TappedEventArgs args ) : void
sender Windows.UI.Input.GestureRecognizer
args Windows.UI.Input.TappedEventArgs
리턴 void

Update() 공개 메소드

This method is automagically called as part of GameSystem to update the physics simulation. Physics system interpolates current running time with at max 1 itteration of the system over 1/60 seconds (by default).
public Update ( SharpDX.Toolkit.GameTime time ) : void
time SharpDX.Toolkit.GameTime
리턴 void

addTestBox() 공개 메소드

Adds a unit sized test cube to the physics world. Deprecated.
public addTestBox ( System.Vector3 position, float mass ) : void
position System.Vector3
mass float
리턴 void

toJMatrix() 공개 정적인 메소드

Helper method to interface SharpDX matrix class with Jitter matrix class.
public static toJMatrix ( System.Matrix matrix ) : Jitter.LinearMath.JMatrix
matrix System.Matrix
리턴 Jitter.LinearMath.JMatrix

toJVector() 공개 정적인 메소드

Helper method to interface SharpDX vector class with Jitter vector class.
public static toJVector ( System.Vector3 vector ) : Jitter.LinearMath.JVector
vector System.Vector3
리턴 Jitter.LinearMath.JVector

toMatrix() 공개 정적인 메소드

Helper method to interface SharpDX matrix class with Jitter matrix class.
public static toMatrix ( Jitter.LinearMath.JMatrix matrix ) : System.Matrix
matrix Jitter.LinearMath.JMatrix
리턴 System.Matrix

toVector3() 공개 정적인 메소드

Helper method to interface SharpDX vector class with Jitter vector class.
public static toVector3 ( Jitter.LinearMath.JVector vector ) : System.Vector3
vector Jitter.LinearMath.JVector
리턴 System.Vector3

프로퍼티 상세

World 공개적으로 프로퍼티

public JitterWorld,Jitter World
리턴 Jitter.JitterWorld

game 보호되어 있는 프로퍼티

protected Project2Game,Project2 game
리턴 Project2Game