Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] - Needs support for the following key bindings #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions ThroughTheEyes/FPStateFloating.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,31 @@ public void evtHook_PreOnFixedUpdate (KerbalEVA eva)
//************Rotation************
Quaternion manualRotation = Quaternion.identity;
Vector3 commandedManualRotation = Vector3.zero;
if (GameSettings.YAW_LEFT.GetKey (false)) {
if (GameSettings.YAW_LEFT.GetKey (false)) { // || GameSettings.EVA_yaw_left || GameSettings.axis_EVA_yaw
manualRotation = manualRotation * Quaternion.AngleAxis ((float)(-(double)eva.turnRate * Mathf.Rad2Deg) * Time.deltaTime, eva.transform.up);
commandedManualRotation -= eva.transform.up;
//KSPLog.print ("YAW LEFT");
} else if (GameSettings.YAW_RIGHT.GetKey (false)) {
} else if (GameSettings.YAW_RIGHT.GetKey (false)) { // || GameSettings.EVA_yaw_right || GameSettings.axis_EVA_yaw
manualRotation = manualRotation * Quaternion.AngleAxis ((float)((double)eva.turnRate * Mathf.Rad2Deg) * Time.deltaTime, eva.transform.up);
commandedManualRotation += eva.transform.up;
//KSPLog.print ("YAW RIGHT");
}

if (GameSettings.PITCH_UP.GetKey (false)) {
if (GameSettings.PITCH_UP.GetKey (false)) { // GameSettings.axis_EVA_pitch
manualRotation = manualRotation * Quaternion.AngleAxis ((float)(-(double)eva.turnRate * Mathf.Rad2Deg) * Time.deltaTime, eva.transform.right);
commandedManualRotation -= eva.transform.right;
//KSPLog.print ("PITCH UP");
} else if (GameSettings.PITCH_DOWN.GetKey (false)) {
} else if (GameSettings.PITCH_DOWN.GetKey (false)) { // GameSettings.axis_EVA_pitch
manualRotation = manualRotation * Quaternion.AngleAxis ((float)((double)eva.turnRate * Mathf.Rad2Deg) * Time.deltaTime, eva.transform.right);
commandedManualRotation += eva.transform.right;
//KSPLog.print ("PITCH DOWN");
}

if (GameSettings.ROLL_RIGHT.GetKey (false)) {
if (GameSettings.ROLL_RIGHT.GetKey (false)) { // GameSettings.axis_EVA_roll
manualRotation = manualRotation * Quaternion.AngleAxis ((float)(-(double)eva.turnRate * Mathf.Rad2Deg) * Time.deltaTime, eva.transform.forward);
commandedManualRotation -= eva.transform.forward;
//KSPLog.print ("ROLL RIGHT");
} else if (GameSettings.ROLL_LEFT.GetKey (false)) {
} else if (GameSettings.ROLL_LEFT.GetKey (false)) { // GameSettings.axis_EVA_roll
manualRotation = manualRotation * Quaternion.AngleAxis ((float)((double)eva.turnRate * Mathf.Rad2Deg) * Time.deltaTime, eva.transform.forward);
commandedManualRotation += eva.transform.forward;
//KSPLog.print ("ROLL LEFT");
Expand Down Expand Up @@ -173,31 +173,31 @@ public void evtHook_PreOnFixedUpdate (KerbalEVA eva)

//************Translation************
Vector3 manualTranslation = Vector3.zero;
if (GameSettings.TRANSLATE_LEFT.GetKey (false)) {
if (GameSettings.TRANSLATE_LEFT.GetKey (false)) { // GameSettings.EVA_Pack_left || GameSettings.axis_EVA_translate_x
manualTranslation += Vector3.left;
//manualRotation = manualRotation * Quaternion.AngleAxis((float) (-(double) eva.turnRate * Mathf.Rad2Deg) * Time.deltaTime, eva.transform.up);
//KSPLog.print ("TRANSLATE LEFT");
} else if (GameSettings.TRANSLATE_RIGHT.GetKey (false)) {
} else if (GameSettings.TRANSLATE_RIGHT.GetKey (false)) { // GameSettings.EVA_Pack_right || GameSettings.axis_EVA_translate_x
manualTranslation += Vector3.right;
//manualRotation = manualRotation * Quaternion.AngleAxis((float) ((double) eva.turnRate * Mathf.Rad2Deg) * Time.deltaTime, eva.transform.up);
//KSPLog.print ("TRANSLATE RIGHT");
}

if (GameSettings.TRANSLATE_UP.GetKey (false)) {
if (GameSettings.TRANSLATE_UP.GetKey (false)) { // GameSettings.EVA_Pack_up || GameSettings.axis_EVA_translate_y
manualTranslation += Vector3.up;
//manualRotation = manualRotation * Quaternion.AngleAxis((float) (-(double) eva.turnRate * Mathf.Rad2Deg) * Time.deltaTime, eva.transform.right);
//KSPLog.print ("TRANSLATE UP");
} else if (GameSettings.TRANSLATE_DOWN.GetKey (false)) {
} else if (GameSettings.TRANSLATE_DOWN.GetKey (false)) { // GameSettings.EVA_Pack_down || GameSettings.axis_EVA_translate_y
manualTranslation += Vector3.down;
//manualRotation = manualRotation * Quaternion.AngleAxis((float) ((double) eva.turnRate * Mathf.Rad2Deg) * Time.deltaTime, eva.transform.right);
//KSPLog.print ("TRANSLATE DOWN");
}

if (GameSettings.TRANSLATE_FWD.GetKey (false)) {
if (GameSettings.TRANSLATE_FWD.GetKey (false)) { // GameSettings.EVA_Pack_forward || GameSettings.axis_EVA_translate_z
manualTranslation += Vector3.forward;
//manualRotation = manualRotation * Quaternion.AngleAxis((float) (-(double) eva.turnRate * Mathf.Rad2Deg) * Time.deltaTime, eva.transform.forward);
//KSPLog.print ("TRANSLATE RIGHT");
} else if (GameSettings.TRANSLATE_BACK.GetKey (false)) {
} else if (GameSettings.TRANSLATE_BACK.GetKey (false)) { // GameSettings.EVA_Pack_back || GameSettings.axis_EVA_translate_z
manualTranslation += Vector3.back;
//manualRotation = manualRotation * Quaternion.AngleAxis((float) ((double) eva.turnRate * Mathf.Rad2Deg) * Time.deltaTime, eva.transform.forward);
//KSPLog.print ("TRANSLATE LEFT");
Expand Down