C# Class KinectRCCar.WpfUI.ControlLogic

Inheritance: IControlLogic, IDisposable
Afficher le fichier Open project: devinh/KinectRCCar

Méthodes publiques

Méthode Description
ControlLogic ( IKinectService kinectService, ICarControllerService carControllerService, IWpfUISettings settings, IUnityContainer container ) : System
DisableControl ( ) : void
Dispose ( ) : void
Start ( ) : void
Stop ( ) : void

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Private Methods

Méthode Description
CalculateDirection ( System.Windows.Media.Media3D.Vector3D leftHand, System.Windows.Media.Media3D.Vector3D handsMidpoint ) : void

Calculates the Direction to have the car go. The direction is calculated as a percentage of the angle between the position of the leftHand and 0. The calculated angle is then divided by Pi/2 to determine the direction as a percentage. A positive direction is a direction to the right. A negative position is a direction to the left.

CalculateVelocity ( double handsMidpointZ, double positionZ ) : void

Calculates the velocity of the car. The velocity is calculated as a percentage of the distance the hands are from a set neutral point. The is able to move back and forth as the neutral point is calculated based on the distance the neutral point is from the user.

ControlCar ( Microsoft.Kinect.Skeleton skeletons ) : void
CountDownTimerReset ( ) : void
EnableControl ( ) : void
EnableDisableControl ( System.Windows.Media.Media3D.Vector3D handsMidpoint, double spineYPosition, System.Windows.Media.Media3D.Vector3D leftHand, System.Windows.Media.Media3D.Vector3D rightHand ) : void

Checks to see if the hands are in the starting position and in the "play area" before enabling control. Control is disabled if the hands drop outside the "play area.

GetJointVector ( JointType joint, Microsoft.Kinect.Skeleton sd ) : System.Windows.Media.Media3D.Vector3D
HandsInPlayArea ( System.Windows.Media.Media3D.Vector3D handsMidpoint, double spinePositionY ) : bool
HandsStable ( System.Windows.Media.Media3D.Vector3D leftHand, System.Windows.Media.Media3D.Vector3D rightHand ) : bool
KinectServiceOnSkeletonFrameReady ( object sender, SkeletonArrayReadyEventArgs e ) : void
OnControllingEvent ( bool isControlling ) : void
OnNewDirectionEvent ( double direction ) : void
OnNewVelocityEvent ( double velocity ) : void
OnTimeLeftTick ( System.TimeSpan tickTime ) : void
SetupCountdownTimer ( ) : void
StartControl ( ) : void
StopControl ( ) : void

Method Details

ControlLogic() public méthode

public ControlLogic ( IKinectService kinectService, ICarControllerService carControllerService, IWpfUISettings settings, IUnityContainer container ) : System
kinectService IKinectService
carControllerService ICarControllerService
settings IWpfUISettings
container IUnityContainer
Résultat System

DisableControl() public méthode

public DisableControl ( ) : void
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

Start() public méthode

public Start ( ) : void
Résultat void

Stop() public méthode

public Stop ( ) : void
Résultat void