mirror of
https://github.com/DrBeef/JKXR.git
synced 2025-02-16 17:01:59 +00:00
Two handed saber improvement
This commit is contained in:
parent
0517b987e2
commit
ec021f9b2e
3 changed files with 52 additions and 32 deletions
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.drbeef.jkxr"
|
package="com.drbeef.jkxr"
|
||||||
android:versionCode="42"
|
android:versionCode="44"
|
||||||
android:versionName="0.7.2" android:installLocation="auto" >
|
android:versionName="0.7.4" android:installLocation="auto" >
|
||||||
|
|
||||||
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
||||||
<uses-feature android:glEsVersion="0x00030002" android:required="true"/>
|
<uses-feature android:glEsVersion="0x00030002" android:required="true"/>
|
||||||
|
|
|
@ -437,7 +437,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
VectorAdd(offhandPositionAverage, vr.offhandposition[i], offhandPositionAverage);
|
VectorAdd(offhandPositionAverage, vr.offhandposition[i], offhandPositionAverage);
|
||||||
}
|
}
|
||||||
VectorScale(offhandPositionAverage, 0.2f, offhandPositionAverage);
|
VectorScale(offhandPositionAverage, 0.2f, offhandPositionAverage);
|
||||||
if (vr.weapon_stabilised) {
|
if (vr.weapon_stabilised && !vr.dualsabers) {
|
||||||
if (vr_virtual_stock->integer == 1 || vr.cgzoommode == 2 || vr.cgzoommode == 4) {
|
if (vr_virtual_stock->integer == 1 || vr.cgzoommode == 2 || vr.cgzoommode == 4) {
|
||||||
//offset to the appropriate eye a little bit
|
//offset to the appropriate eye a little bit
|
||||||
vec2_t xy = {0, 0};
|
vec2_t xy = {0, 0};
|
||||||
|
@ -463,17 +463,22 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float x =
|
vec3_t delta;
|
||||||
pOff->Pose.position.x - pWeapon->Pose.position.x;
|
delta[0] = pOff->Pose.position.x - pWeapon->Pose.position.x;
|
||||||
float y =
|
delta[1] = pOff->Pose.position.y - pWeapon->Pose.position.y;
|
||||||
pOff->Pose.position.y - pWeapon->Pose.position.y;
|
delta[2] = pOff->Pose.position.z - pWeapon->Pose.position.z;
|
||||||
float z =
|
|
||||||
pOff->Pose.position.z - pWeapon->Pose.position.z;
|
|
||||||
float zxDist = length(x, z);
|
|
||||||
|
|
||||||
if (zxDist != 0.0f && z != 0.0f) {
|
int anglesToSet = ANGLES_ADJUSTED;
|
||||||
VectorSet(vr.weaponangles[ANGLES_ADJUSTED], -RAD2DEG(atanf(y / zxDist)),
|
if (cl.frame.ps.weapon == WP_SABER)
|
||||||
-RAD2DEG(atan2f(x, -z)), vr.weaponangles[ANGLES_ADJUSTED][ROLL] /
|
{
|
||||||
|
anglesToSet = ANGLES_SABER;
|
||||||
|
VectorNegate(delta, delta);
|
||||||
|
}
|
||||||
|
|
||||||
|
float zxDist = length(delta[0], delta[2]);
|
||||||
|
if (zxDist != 0.0f && delta[2] != 0.0f) {
|
||||||
|
VectorSet(vr.weaponangles[anglesToSet], -RAD2DEG(atanf(delta[1] / zxDist)),
|
||||||
|
-RAD2DEG(atan2f(delta[0], -delta[2])), vr.weaponangles[anglesToSet][ROLL] /
|
||||||
2.0f); //Dampen roll on stabilised weapon
|
2.0f); //Dampen roll on stabilised weapon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -575,21 +580,39 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Check quicksave
|
// Check quicksave
|
||||||
|
static bool indicateQuickSave = true;
|
||||||
if (canUseQuickSave) {
|
if (canUseQuickSave) {
|
||||||
int channel = (vr_control_scheme->integer >= 10) ? 1 : 0;
|
int channel = (vr_control_scheme->integer >= 10) ? 2 : 1;
|
||||||
TBXR_Vibrate(40, channel, 0.5); // vibrate to let user know they can switch
|
if (indicateQuickSave)
|
||||||
|
{
|
||||||
if (((pOffTrackedRemoteNew->Buttons & offButton1) !=
|
TBXR_Vibrate(40, channel, 0.5); // vibrate to let user know they can switch
|
||||||
(pOffTrackedRemoteOld->Buttons & offButton1)) &&
|
indicateQuickSave = false;
|
||||||
(pOffTrackedRemoteNew->Buttons & offButton1)) {
|
|
||||||
sendButtonActionSimple("savegame quicksave");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((pOffTrackedRemoteNew->Buttons & offButton2) !=
|
if (((secondaryButtonsNew & secondaryButton1) !=
|
||||||
(pOffTrackedRemoteOld->Buttons & offButton2)) &&
|
(secondaryButtonsOld & secondaryButton1)) &&
|
||||||
(pOffTrackedRemoteNew->Buttons & offButton2)) {
|
(secondaryButtonsNew & secondaryButton1)) {
|
||||||
sendButtonActionSimple("loadgame quicksave");
|
#ifdef JK2_MODE
|
||||||
|
sendButtonActionSimple("save quik*");
|
||||||
|
#else
|
||||||
|
sendButtonActionSimple("save quick");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (((secondaryButtonsNew & secondaryButton2) !=
|
||||||
|
(secondaryButtonsOld & secondaryButton2)) &&
|
||||||
|
(secondaryButtonsNew & secondaryButton2)) {
|
||||||
|
#ifdef JK2_MODE
|
||||||
|
sendButtonActionSimple("load quik");
|
||||||
|
#else
|
||||||
|
sendButtonActionSimple("load quick");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Next time we can quick save, allow a haptic blip
|
||||||
|
indicateQuickSave = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -999,19 +999,15 @@ void CFxScheduler::CreateEffect( CPrimitiveTemplate *fx, int clientID, int delay
|
||||||
case Particle:
|
case Particle:
|
||||||
//---------
|
//---------
|
||||||
|
|
||||||
if ( clientID >= 0 && clientID < ENTITYNUM_WORLD )
|
//Special handling for player muzzle flashes
|
||||||
|
if ( clientID == 0 )
|
||||||
{
|
{
|
||||||
if (clientID == 0)
|
flags = fx->mFlags | FX_DEPTH_HACK;
|
||||||
{
|
|
||||||
flags = fx->mFlags | FX_DEPTH_HACK;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ..um, ok.....
|
|
||||||
centity_t *cent = &cg_entities[clientID];
|
centity_t *cent = &cg_entities[clientID];
|
||||||
|
|
||||||
if (cent && cent->gent && cent->gent->client)
|
if (cent && cent->gent && cent->gent->client)
|
||||||
{
|
{
|
||||||
FX_AddParticle(-1, cent->gent->client->renderInfo.muzzlePoint, vel, accel, fx->mGravity.GetVal(),
|
FX_AddParticle(-1, cent->gent->client->renderInfo.muzzlePoint, vel, accel, fx->mGravity.GetVal(),
|
||||||
fx->mSizeStart.GetVal(), fx->mSizeEnd.GetVal(), fx->mSizeParm.GetVal(),
|
fx->mSizeStart.GetVal(), fx->mSizeEnd.GetVal(), fx->mSizeParm.GetVal(),
|
||||||
fx->mAlphaStart.GetVal(), fx->mAlphaEnd.GetVal(),
|
fx->mAlphaStart.GetVal(), fx->mAlphaEnd.GetVal(),
|
||||||
fx->mAlphaParm.GetVal(),
|
fx->mAlphaParm.GetVal(),
|
||||||
|
@ -1024,6 +1020,7 @@ void CFxScheduler::CreateEffect( CPrimitiveTemplate *fx, int clientID, int delay
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//Default behaviour
|
||||||
FX_AddParticle(clientID, org, vel, accel, fx->mGravity.GetVal(),
|
FX_AddParticle(clientID, org, vel, accel, fx->mGravity.GetVal(),
|
||||||
fx->mSizeStart.GetVal(), fx->mSizeEnd.GetVal(), fx->mSizeParm.GetVal(),
|
fx->mSizeStart.GetVal(), fx->mSizeEnd.GetVal(), fx->mSizeParm.GetVal(),
|
||||||
fx->mAlphaStart.GetVal(), fx->mAlphaEnd.GetVal(),
|
fx->mAlphaStart.GetVal(), fx->mAlphaEnd.GetVal(),
|
||||||
|
|
Loading…
Reference in a new issue