Compare commits

...

120 commits

Author SHA1 Message Date
Simon
6977676656 Prevent config being saved every frame
fixes the occasional freezing that some people experience
2024-04-08 21:04:17 +01:00
Simon
6e119d989a Improved build properties 2024-04-08 21:03:50 +01:00
Grant Bagwell
5711fe3eeb
Update README.md 2024-01-15 02:20:09 +01:00
Simon
69d6bdb842 Added missing cvars for standalone 2024-01-14 15:28:43 +00:00
Grant Bagwell
e123731955 Added Trigger Release Band Cvars + Fixed Vive Controls
Added Cvars for engaging Grip by level. Defaults Below:
vr_engage_trigger 0.7
vr_release_trigger 0.7
vr_engage_trigger_index 0.7 (Index Only)
vr_release_trigger_index 0.05 (Index Only)

Vive Controls
Left Trackpad press (whilst roughly in the middle) - Crouch
Left menu Button - Pause
Trackpad Right Press - DataPad

Right Menu Button - 1st / 3rd person
Right Trackpad Press Up = Alt Fire / Switch Off Saber
Right Trackpad Press Down = Jump
Right Trackpad Press Center = Use / Interact
2024-01-13 20:12:27 +01:00
Simon
c7f4874aba Increase Version to 1.1.27 2024-01-13 10:52:39 +00:00
Simon
6a714b3398 Couple of movement fixes
- Make 3rd person movement adhere to a compass direction so that special moves can be executed
- Reduced speed of smooth turn as it was too fast on lowest setting
2024-01-13 10:52:23 +00:00
Simon
5bf7075115 Fix jittery/bandy behaviour on VDXR and SteamLink 2024-01-13 10:51:15 +00:00
Simon Brown
a5d36a08a8
Update README.md 2024-01-09 22:24:50 +00:00
Grant Bagwell
2344e74dc1
Update README.md 2024-01-07 17:13:23 +01:00
Simon
5067a51890 Updated to installer for public release 2023-12-28 18:23:55 +00:00
Grant Bagwell
f12c537742
Update README.md 2023-12-23 17:54:53 +01:00
Simon Brown
486705201e
Update README.md 2023-12-23 16:52:32 +00:00
Simon Brown
901455ab5d
Update README.md 2023-12-22 13:52:51 +00:00
Simon
aba2216bc1 Update JKXRGithub.jpg 2023-12-22 13:51:03 +00:00
Simon
44cf68c5f2 Change installer compression to zip 2023-12-21 22:51:15 +00:00
Simon
165945550b Update JKXR_JKO.iss 2023-12-21 22:41:19 +00:00
Simon
af4cabfd64 Fix white screen issue
something to do with the renderer being destroyed every time you transition from screen view to game view
2023-12-21 21:43:06 +00:00
Simon
06c85581b6 Tried to improve imperial blaster scope image edges 2023-12-21 21:17:41 +00:00
Simon
fc6ec8b08d Updated tray icon and beef crawl 2023-12-21 21:06:29 +00:00
Simon
0fedd03af7 Updated beef crawl and readme for public release 2023-12-21 19:07:12 +00:00
Simon
0ac277bc5b Updated version number for release: 1.1.26 2023-12-21 18:49:20 +00:00
Petr Bartos
c27fc0a020 Blank loading picture which is sometimes rendered crossed eyed 2023-12-21 18:46:16 +00:00
Petr Bartos
6b6ef728d4 Updated control scheme help 2023-12-21 18:46:16 +00:00
Petr Bartos
26fa1511c6 Enable super sampling menu item also for Pico 2023-12-21 18:46:16 +00:00
Simon
5cb9a73394 Improved the weapon grab cone 2023-12-21 18:45:33 +00:00
Simon
671299dc6c Revert "Configurable super sampling for PCVR (untested\!)"
This reverts commit 0e58a043ac.
2023-12-20 18:36:25 +00:00
Simon
e5313e1b36 Small fixes to things missed for the weapon scope 2023-12-19 21:27:56 +00:00
Simon
59117e3081 Update version 2023-12-19 21:27:35 +00:00
Simon
b62be71afc Remove weapon alignment config from weapon pack 2023-12-19 21:27:18 +00:00
Petr Bartos
0e58a043ac Configurable super sampling for PCVR (untested\!) 2023-12-18 18:36:30 +00:00
Petr Bartos
b0ceacda6f Configurable super sampling (standalone only) 2023-12-18 18:36:30 +00:00
Petr Bartos
437d584421 Fix hanging cutscenes on fast machines (backport from OpenJK) 2023-12-18 18:36:30 +00:00
Petr Bartos
96df03025f Increase NPC limit even more 2023-12-18 18:36:30 +00:00
Grant Bagwell
6cf975b889 Vive Wand Index Knuckles Support Finalised 2023-12-17 00:23:46 +01:00
Grant Bagwell
453c2fd749 Pico Saber Defaults 2023-12-14 23:22:20 +01:00
Petr Bartos
bc6b23786e Recognise Controllers - add missing declarations to android build 2023-12-13 20:06:16 +01:00
Grant Bagwell
a56dad8ca3 Merge branch 'main' of https://github.com/DrBeef/JKXR 2023-12-13 19:04:17 +01:00
Grant Bagwell
054b36c3d3 Recognise Controllers
Index Saber Default
Vive Vibration Adjustment
2023-12-13 19:04:14 +01:00
Simon
af7647dc44 Merge branch 'main' of https://github.com/DrBeef/JKXR 2023-12-13 07:37:10 +00:00
Simon
6bf6666b7b Restore OpenXR performance boost level setting 2023-12-13 07:37:08 +00:00
Grant Bagwell
ee0f69e34b Merge branch 'main' of https://github.com/DrBeef/JKXR 2023-12-13 02:58:27 +01:00
Grant Bagwell
c7a1314a1f Vive / Index Bindings / Vibration PCVR issue
Also refactored a lot of naming to be consistent with OpenXR definitions and removed unused variables.
Vibration solved by removing frequency.
Vive needs to be shortened still once we've identified controllers
2023-12-13 02:58:25 +01:00
Simon
99a54fd190 Additional states for screen layer 2023-12-12 22:58:27 +00:00
Simon
bf3006da46 Fix crash in JKA 2023-12-12 22:46:36 +00:00
Simon
0698ac2d28 Haptics for concussion rifle 2023-12-12 22:30:18 +00:00
Simon
130652ae62 Removed unused code 2023-12-12 22:30:08 +00:00
Simon
5d41a967b7 Added performance flags for Quest decives 2023-12-12 22:29:57 +00:00
Simon
a1436a2722 Update OpenXR to 1.0.29 2023-12-12 22:29:42 +00:00
Simon
f5c84bd51d Fix issue with two handed weapons preventing force wheel from showing 2023-12-12 22:29:00 +00:00
Petr Bartos
c712a5ecff Updated control scheme help 2023-12-12 18:18:10 +00:00
Petr Bartos
6041a39a2e Increase NPC limit 2023-12-12 18:18:10 +00:00
Petr Bartos
3a3f0483c5 Split newgame and ingame saber menu to solve problem with injected MP map launcher 2023-12-09 20:23:44 +00:00
Simon
48e9037aaf Make gaze based force push.pull more forgiving to the player's aim 2023-12-09 20:16:47 +00:00
Simon
1141b17bf1 Fix crash when going into a cut scene with scope activated 2023-12-09 17:05:09 +00:00
Simon
930d64b758 Some stuff to ensure screen shows up in the correct place 2023-12-09 10:38:10 +00:00
Simon
e6542f1d0f Improved weapon offhand grab logic 2023-12-09 10:37:22 +00:00
Simon
0c6d44f655 Allow player to recall saber to their hand with a gesture when it is dropped 2023-12-09 10:36:59 +00:00
Petr Bartos
98bc53c9a3 Fix typo in hand model path 2023-12-05 22:05:12 +00:00
Petr Bartos
bb0f5b1bf8 r_lodCurveError added to menu; updated defaults 2023-12-05 22:05:11 +00:00
Simon
193295bb7a Update beef_crawl.tga 2023-12-02 16:50:25 +00:00
Petr Bartos
e4000f260d Remove Kyle's hand model from JKA 2023-12-02 09:38:58 +00:00
Petr Bartos
58d634064f Update credits 2023-12-01 20:16:49 +00:00
Petr Bartos
56901cc225 Backport culling fixes for Android build 2023-12-01 20:16:49 +00:00
Simon
f66fe62907 Change to culling logic to fix issue with inverted weapons/hands 2023-11-30 23:33:11 +00:00
Petr Bartos
ffecbc8be4 Custom hands models (with weird right hand rendering bug) 2023-11-29 23:26:48 +00:00
Simon
4f14c3da14 Corrected JKO weapons from Bummser 2023-11-29 23:26:32 +00:00
Simon
558de83f6f Updated version for next EA 2023-11-29 23:26:18 +00:00
Simon
128c67fb8a Installer Changes 2023-11-29 23:26:06 +00:00
Petr Bartos
0846f98023 Adjust force powers for custom started map 2023-11-29 21:53:47 +00:00
Simon
7a5d972992 Align baton for a when a Mod uses it in JKA 2023-11-27 23:11:27 +00:00
Simon
8c3fa38e30 Installer and cvar changes 2023-11-26 17:43:05 +00:00
Simon
5758f29d34 Change desktop window title to JKXR 2023-11-26 11:21:55 +00:00
Simon
e593cd8d0a Added files to ignore
These have to be manually added to the folders
2023-11-26 11:21:38 +00:00
Simon
28d5a485b6 Change Installer to Inno Setup 2023-11-26 11:20:51 +00:00
Simon
80b821913b Windows Installer for JKO and JKA 2023-11-25 17:46:32 +00:00
Simon
d10b4d9c2c Fixes for scope on android 2023-11-24 19:57:02 +00:00
Petr Bartos
2820b99e6b Give 999 health cheat 2023-11-23 22:34:17 +00:00
Petr Bartos
1e4f1aae0f Add always run option to menu; move saber motion ignite to weapons menu 2023-11-23 22:34:06 +00:00
Simon
a21b683cc2 A number of fixes...
- Fixed issue where sounds when using scope came from the wrong location
 - Now walk direction when scoped is correct
 - Walking when scoped won't cause horrible display jitering between scoped and unscoped views
 - Fixed situation when NPC saber battles caused haptics to fire
2023-11-23 22:33:07 +00:00
Simon
959ee3b485 Revert "Allow wall running and some other moves while in first person"
This reverts commit bb8c3bfa77.
2023-11-19 20:31:11 +00:00
Simon
f5a9e442dc Fix "Force See" overlay being misaligned 2023-11-19 20:29:06 +00:00
Simon
e7667b063e Allow slow movement while scoped 2023-11-19 20:13:41 +00:00
Simon
42a982bd58 Update weapons_vr.cfg 2023-11-19 20:13:27 +00:00
Simon
44511cddbc fix android crash 2023-11-19 12:04:04 +00:00
Simon
2720f371d7 Version number update 2023-11-19 11:33:48 +00:00
Simon
ae51ef5f27 Small adjustments to make saber align better in JKA 2023-11-19 11:32:24 +00:00
Simon
bb8c3bfa77 Allow wall running and some other moves while in first person
Hopefully this won't break anything!
2023-11-19 09:28:12 +00:00
Simon
11f6204ba5 vr_always_run cvar so player doesn't cycle move speeds on thumbstick 2023-11-18 17:51:31 +00:00
Simon
83bee3bbff Multiple fixes
- Scope mask / force effects masks are too small. Edges are visible.
- Cutscenes can't be skipped when in 2D mode (none immersive)
- If you zoom in with the scoped rifle you also change the running speed. 😬
- walking while shooting scoped
2023-11-18 13:07:22 +00:00
Simon
3cec1ae469 Fix things being culled at the edges of view on Quest 3 2023-11-18 11:09:26 +00:00
Petr Bartos
283c994bdd Fix permission loop problem (problem seems to be that application crashes (and is restarted) when requesting two permissions at once) 2023-11-18 10:53:05 +00:00
Petr Bartos
0aaf76fa3b Integration of NpcSP mod; MP map selection menu 2023-11-18 10:53:05 +00:00
Petr Bartos
36b806a1e8 JKO backport (new unlimited power cheat; fine tuning of force powers in cheat menu) 2023-11-18 10:53:05 +00:00
Petr Bartos
3a4c6b9dea New unlimited power cheat; fine tuning of force powers in cheat menu 2023-11-18 10:53:05 +00:00
Petr Bartos
b4ac0894e3 Improve level transition fix (not all powers are updatable) 2023-11-18 10:53:05 +00:00
Petr Bartos
e5575976db Fix some menu descriptions 2023-11-18 10:53:05 +00:00
Simon
b3145a91bf Fix gaps at edges of view 2023-11-18 10:52:00 +00:00
Simon
bde091d6b2 Use correct framebuffer 2023-11-02 22:04:42 +00:00
Simon
e7f8770008 ST_QUICK_MENU 2023-11-02 21:50:04 +00:00
Simon
25987a5fb7 Revert "Move Speed selector on offhand radial quick menu"
This reverts commit bc964e2ee0.
2023-11-02 21:48:19 +00:00
Petr Bartos
4c3613c754 Fix shadow configuration 2023-11-02 21:47:47 +00:00
Petr Bartos
f819bc8918 Fix level progress in case all force powers are maxed 2023-11-02 21:47:24 +00:00
Petr Bartos
b0a45e5907 Show refresh rate option only on supported platforms 2023-11-02 21:47:07 +00:00
Petr Bartos
c3b4f55a0b Fix disruptor zoom in JKA 2023-11-02 21:46:45 +00:00
Simon
59a79bdf84 Update make_z_vr_assets_pk3.bat 2023-11-02 21:42:18 +00:00
Simon
3b8a9eac81 Fix crash on standalone when two handing weapons 2023-10-18 21:09:38 +01:00
Simon
bc964e2ee0 Move Speed selector on offhand radial quick menu 2023-09-28 21:29:51 +01:00
Simon
8a09007ad0 Multiple small changes:
- Menu option to use motion to reignite saber
- Show error dialog if app can't start due to no headset detected
- Cvar to allow people to configure custom distance for weapon scopes to engage from HMD
- Use faster buffer blit for desktop window
2023-09-17 08:46:21 +01:00
Simon
572b6c5f8a Reduce sensitivity of grip activation of selectors (better for Index users) 2023-08-13 15:09:53 +01:00
Simon
40eb55d0d3 Fix hand not showing in JKO when saber is thrown 2023-08-13 08:57:30 +01:00
Simon
2f024f77b0 fix issue loading game library running JK from another folder 2023-08-12 23:23:04 +01:00
Simon
572ae3f340 Look in current dir for game library 2023-08-12 20:19:47 +01:00
Simon
d28bd8aa9c Fix missing intro movies on Quest 2023-08-12 15:25:36 +01:00
Simon
ca40a99ec1 Implement separate saber pitch adjustment
it uses the OpenXR grip pose and an adjuster separate to the weapon one
2023-08-12 15:25:23 +01:00
Simon
bc5fd7073e Restored original weapon scaling
looks so much better
2023-08-08 20:37:37 +01:00
Simon
e5b561a46b Revert "new cvar r_alwaysmaxlod for PCVR build"
This reverts commit 8e7c1f69a4.
2023-08-08 20:29:41 +01:00
Simon
8e7c1f69a4 new cvar r_alwaysmaxlod for PCVR build 2023-08-06 17:37:42 +01:00
Simon
9387dea98f Modified PCVR build to use 64 bit OpenAL 2023-08-06 17:36:27 +01:00
Simon
e2c4cfd015 Don't use vid_restart, get user to manually restart JKXR on video settings change 2023-08-05 18:15:52 +01:00
189 changed files with 12915 additions and 1331 deletions

18
.gitignore vendored
View file

@ -260,3 +260,21 @@ pip-log.txt
## CLion
#############
.idea
JKXR-PCVR-Installer/JKXR_JKO.exe
JKXR-PCVR-Installer/JKXR_JKA.exe
JKXR-PCVR-Installer/JKXR_JKA_Setup.exe
JKXR-PCVR-Installer/JKXR_JKO_Setup.exe
JKXR-PCVR-Installer/JKO/rdjosp-vanilla_x86_64.dll
JKXR-PCVR-Installer/JKO/openjo_sp.x86_64.exe
JKXR-PCVR-Installer/JKO/jospgamex86_64.dll
JKXR-PCVR-Installer/JKO/base/Haps_Stormtrooper.pk3
JKXR-PCVR-Installer/JKO/base/GGDynamicWeapons.pk3
JKXR-PCVR-Installer/JKO/base/Episode3blades.pk3
JKXR-PCVR-Installer/JKO/base/assets6_vr_weapons_shaders.pk3
JKXR-PCVR-Installer/JKA/rdsp-vanilla_x86_64.dll
JKXR-PCVR-Installer/JKA/openjk_sp.x86_64.exe
JKXR-PCVR-Installer/JKA/jagamex86_64.dll
JKXR-PCVR-Installer/JKA/base/GGDynamicWeapons.pk3
JKXR-PCVR-Installer/JKA/base/Episode3blades.pk3
JKXR-PCVR-Installer/JKA/base/DT_Stormtrooper_ROTJ_SP.pk3
JKXR-PCVR-Installer/JKA/base/DT_Stormtrooper_ROTJ.pk3

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
openjk_sp.x86_64.exe

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
openjo_sp.x86_64.exe

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,91 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "JKXR - Jedi Academy"
#define MyAppVersion "1.1.27"
#define MyAppPublisher "Team Beef VR"
#define MyAppURL "https://www.patreon.com/teambeef"
#define MyAppExeName "openjk_sp.x86_64.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{330568D5-5C62-44D3-8C54-5D51FFEEDFFC}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\Steam\steamapps\common\Jedi Academy\GameData\
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputDir=C:\Dev\Quest\JKXR\JKXR-PCVR-Installer
OutputBaseFilename=JKXR_JKA_Setup
Compression=zip
SolidCompression=yes
WizardStyle=modern
AlwaysShowDirOnReadyPage=yes
AppendDefaultDirName=no
DisableWelcomePage=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKA\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKA\jagamex86_64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKA\TeamBeefVR.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKA\OpenAL32.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKA\rdsp-vanilla_x86_64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\packaged_mods_credits.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKA\SDL2.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKA\base\*"; DestDir: "{app}\base"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\vr_splash.bmp"; Flags: dontcopy
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Code]
var
Page: TWizardPage;
procedure InitializeWizard();
var
BitmapImage: TBitmapImage;
BitmapFileName: String;
begin
Page := CreateCustomPage(wpWelcome, 'JKXR - Jedi Academy Installer', 'Join our Patreon at: patreon.com/teambeef');
BitmapFileName := ExpandConstant('{tmp}\vr_splash.bmp');
ExtractTemporaryFile(ExtractFileName(BitmapFileName));
BitmapImage := TBitmapImage.Create(Page);
BitmapImage.Bitmap.LoadFromFile(BitmapFileName);
BitmapImage.Center := True;
BitmapImage.Stretch := True;
BitmapImage.Parent := Page.Surface;
with BitmapImage do begin
Width := Page.SurfaceHeight + 10;
Height := Page.SurfaceHeight + 10;
Parent := Page.Surface;
end;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
{ Validate certain pages before allowing the user to proceed }
if CurPageID = Page.ID then begin
SuppressibleMsgBox('If installing into the same location as an existing Jedi Academy install, please ensure you choose the directory that contains the single player executable and the "base" folder (probably called Jedi Academy\GameData)', mbConfirmation, MB_OK, IDOK);
end;
Result := True;
end;

View file

@ -0,0 +1,91 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "JKXR - Jedi Outcast"
#define MyAppVersion "1.1.27"
#define MyAppPublisher "Team Beef VR"
#define MyAppURL "https://www.patreon.com/teambeef"
#define MyAppExeName "openjo_sp.x86_64.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{962B9188-98B6-4216-BEB8-C8BCF901C6D0}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\Steam\steamapps\common\Jedi Outcast\GameData\
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputDir=C:\Dev\Quest\JKXR\JKXR-PCVR-Installer
OutputBaseFilename=JKXR_JKO_Setup
Compression=zip
SolidCompression=yes
WizardStyle=modern
AlwaysShowDirOnReadyPage=yes
AppendDefaultDirName=no
DisableWelcomePage=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKO\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKO\jospgamex86_64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKO\TeamBeefVR.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKO\OpenAL32.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKO\rdjosp-vanilla_x86_64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKO\SDL2.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\packaged_mods_credits.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\JKO\base\*"; DestDir: "{app}\base"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Dev\Quest\JKXR\JKXR-PCVR-Installer\vr_splash.bmp"; Flags: dontcopy
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Code]
var
Page: TWizardPage;
procedure InitializeWizard();
var
BitmapImage: TBitmapImage;
BitmapFileName: String;
begin
Page := CreateCustomPage(wpWelcome, 'JKXR - Jedi Outcast Installer', 'Join our Patreon at: patreon.com/teambeef');
BitmapFileName := ExpandConstant('{tmp}\vr_splash.bmp');
ExtractTemporaryFile(ExtractFileName(BitmapFileName));
BitmapImage := TBitmapImage.Create(Page);
BitmapImage.Bitmap.LoadFromFile(BitmapFileName);
BitmapImage.Center := True;
BitmapImage.Stretch := True;
BitmapImage.Parent := Page.Surface;
with BitmapImage do begin
Width := Page.SurfaceHeight + 10;
Height := Page.SurfaceHeight + 10;
Parent := Page.Surface;
end;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
{ Validate certain pages before allowing the user to proceed }
if CurPageID = Page.ID then begin
SuppressibleMsgBox('If installing into the same location as an existing Jedi Outcast install, please ensure you choose the directory that contains the single player executable and the "base" folder (probably called Jedi Outcast\GameData)', mbConfirmation, MB_OK, IDOK);
end;
Result := True;
end;

View file

@ -0,0 +1,192 @@
The following excellent mods were included in the apk:
=============================================================================================================================
TITLE: Vince Crusty and Elin's VR Fully Modeled Weapons Pack
AUTHORS: Elin and Vince Crusty
FILE NAME: z_Crusty_and_Elin_vr_weapons.pk3
FILE SIZE: 1.0 MB
DATE RELEASED: 21 MAR 2023
DESCRIPTION: This mod replaces all the Jedi Outcast weapons with fully modeled weapons for use in VR
THIS MODIFICATION IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY ACTIVISION, RAVEN, OR LUCASARTS ENTERTAINMENT COMPANY LLC. ELEMENTS TM & © LUCASARTS ENTERTAINMENT COMPANY LLC AND/OR ITS LICENSORS.
=============================================================================================================================
Author:
Grab
File name:
GGDynamicWeapons v1.0
Description:
Dynamic light for weapons effects
Instalation:
Take one of these .pk3's and put it into your base folder.
Known issues:
Probably only Seeker's shots are missing dynamic lightning. Might be fixed in future.
Copyright:
Grab
=============================================================================================================================
Readme File:
JEDI KNIGHT: JEDI ACADEMY MODIFICATION
**************************************
Title : Episode 3: Revenge of the Sith Lightsaber Blades REVISED
author : PK_Azlon
email :digitalvapor@mac.com
File Name :episode3blades.pk3
Description: Due to feedback, and the fact that I myself was not satisfied with my previous release of this blade pack, I have completely remade the glows for my Episode 3: Revenge of the Sith Lightsaber Blades.
Most people were unhappy with the sky blue blade, and after a 5th viewing of the movie, I was too. So I have gone back and made the blue closer to what is seen in the film, and also made the glows about 64 pixels thinner. While this introduces a little bit of grainyness, the overall blade looks much better.
----------------------------------
Installation: Extract episode3sabers.pk3 into Jedi Academy's /gamedata/base directory.
This pack is made to replace the previous release, so if asked if you want to overwrite the existing copy (if you have it) Choose yes.
New textures: YES!
New Models: No
Special thanks to Raven for making this game, and a VERY SPECIAL Thanks to George Lucas for making Star Wars Episode III: Revenge of the Sith so much better than Epidodes 1, 2, and 6
Copyright / Permissions
THIS MODIFICATION IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY ACTIVISION, RAVEN, OR LUCASARTS ENTERTAINMENT COMPANY LLC. ELEMENTS TM & © LUCASARTS ENTERTAINMENT COMPANY LLC AND/OR ITS LICENSORS.
=============================================================================================================================
******************************************
JEDI KNIGHT II : JEDI OUTCAST MODIFICATION
******************************************
Title : HapSlash's Improved Stormtrooper - JO
Author : HapSlash
E-Mail : slash_happy@yahoo.com
Website : www.hapslash.com
File Name : Haps-Stormtrooper.pk3
File Size : 1.23MB
Date Released : 02-27-04
Description
----------------------------------------------------------------------
The first pk3 includes the Improved Stormtrooper model, which features accurate movie stylings, team skins, complete caps, and full LOD support . This file is set up to replace the default Stormtrooper.
Also included is a second pk3 which will replace the 3rd person
Stormtrooper blaster with my own version of the E-11.
Installation
----------------------------------------------------------------------
Simply extract both pk3's to the gamedata/base folder of your Jedi Outcast
directory.
Comments
----------------------------------------------------------------------
First of all I think that thank's are in order to INFINITY BLADE, who
took the time to weight the model & convert it almost 5 times before the
finished product was released. Without him this project never would have
gotten very far.
I originally started this upgrade due to the number of problems I had
with the original. The main changes are primarily in the head, torso,
and knees, with texture changes throughout. Other than the cosmetic
changes I also noticed that not all of the body sections had caps on
them, with this model I've added them all in.
Well here it is, my first released model. A lot of hard work, blood,
sweat, tears, and almost a years worth of procrastination went into this,...
Enjoy.
======================================================================
THIS MODIFICATION IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY ACTIVISION, RAVEN, OR LUCASARTS ENTERTAINMENT COMPANY LLC. ELEMENTS TM & © LUCASARTS ENTERTAINMENT COMPANY LLC AND/OR ITS LICENSORS.
*******************************************
JEDI KNIGHT III : JEDI ACADEMY MODIFICATION
*******************************************
Title : DT Stormtrooper ROTJ 2.0
Author : DT
Version : 2.0
File Size : 3.2 MB
Date Released : September 6, 2013
Model : DT
Textures : DT
Weighting : DT
Description:
----------------------------------------------------------------------
Stormtrooper, as seen in Return of the Jedi. Specular & slight gloss added. SP PK3 Included to replace base JKA Stormtrooper.
Known Bugs:
- Slight clipping in certain animations, unavoidable thanks to the JKA skeleton.
Bot: Yes.
NPC: Yes.
LODs: Yes.
Team Skins: Yes.
SP Replacement: Yes.
SP Customise Menu: No.
Credits:
----------------------------------------------------------------------
Thanks to Circa for making the SP replacement for me. :)
Installation:
----------------------------------------------------------------------
Simply extract the pk3(s) to the gamedata/base folder of your Jedi Academy directory.
======================================================================
THIS MODIFICATION IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY ACTIVISION, RAVEN, OR LUCASARTS ENTERTAINMENT COMPANY LLC. ELEMENTS TM & © LUCASARTS ENTERTAINMENT COMPANY LLC AND/OR ITS LICENSORS.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 MiB

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.jkxr"
android:versionCode="63"
android:versionName="1.1.16" android:installLocation="auto" >
android:versionCode="70"
android:versionName="1.1.28" android:installLocation="auto" >
<!-- Tell the system this app requires OpenGL ES 3.1. -->
<uses-feature android:glEsVersion="0x00030002" android:required="true"/>
@ -17,8 +17,9 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application android:allowBackup="false"
android:icon="@drawable/ic_jkxr"
android:icon="@mipmap/teambeef"
android:label="@string/jkxr"
android:extractNativeLibs="true"
android:requestLegacyExternalStorage="true" >
@ -28,6 +29,11 @@
<!-- META QUEST -->
<meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2"/>
<meta-data android:name="com.oculus.ossplash" android:value="true"/>
<!-- Set Dual Core mode for Quest 2/Pro -->
<meta-data android:name="com.oculus.dualcorecpuset" android:value="true" />
<!-- Enabling CPU and GPU level trading: -1 = -1 level to gpu, +1 level to cpu -->
<!-- CPU needs all the power it can get!! -->
<meta-data android:name="com.oculus.trade_cpu_for_gpu_amount" android:value="-1" />
<!-- PICO XR -->
<meta-data android:name="pvr.app.type" android:value="vr" />

View file

@ -1,5 +1,15 @@
buildscript {
repositories {
google() // For Gradle 4.0+
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
}
}
apply plugin: 'com.android.application'
apply from: "${rootProject.projectDir}/XrApp.gradle"
android {
// This is the name of the generated apk file, which will have
@ -14,12 +24,13 @@ android {
// will replace an older one.
applicationId "com.drbeef." + project.archivesBaseName
// override app plugin abiFilters for both 32 and 64-bit support
externalNativeBuild {
ndk {
abiFilters 'arm64-v8a'
}
ndkBuild {
def numProcs = Runtime.runtime.availableProcessors()
arguments "V=0", "-j$numProcs", "-C$project.buildDir.parent", "APP_PLATFORM=android-29", "NDK_TOOLCHAIN_VERSION=clang", "APP_STL=c++_static"
abiFilters 'arm64-v8a'
}
}
@ -28,26 +39,95 @@ android {
targetSdkVersion 29
}
sourceSets {
main {
externalNativeBuild {
ndkBuild {
path file('jni/Android.mk')
}
}
signingConfigs {
def keystorePath = (project.hasProperty('key.store')) ?
new File(project.getProperty('key.store')) :
project.file('android.debug.keystore')
def keystorePassword = (project.hasProperty('key.store.password')) ?
project.getProperty('key.store.password') : 'android'
def keystoreKeyAlias = (project.hasProperty('key.alias')) ?
project.getProperty('key.alias') : 'androiddebugkey'
def keystoreKeyPassword = (project.hasProperty('key.alias.password')) ?
project.getProperty('key.alias.password') : 'android'
debug {
storeFile keystorePath
storePassword keystorePassword
keyAlias keystoreKeyAlias
keyPassword keystoreKeyPassword
v2SigningEnabled true
}
release {
storeFile keystorePath
storePassword keystorePassword
keyAlias keystoreKeyAlias
keyPassword keystoreKeyPassword
v2SigningEnabled true
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
debuggable true
jniDebuggable true
externalNativeBuild {
ndkBuild {
arguments "NDK_DEBUG=1","USE_ASAN=1"
}
}
}
release {
signingConfig signingConfigs.release
debuggable false
jniDebuggable false
externalNativeBuild {
ndkBuild {
arguments "NDK_DEBUG=0","USE_ASAN=0"
}
}
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['../../java']
jniLibs.srcDir 'libs'
res.srcDirs = ['../../res']
assets.srcDirs = ['../../assets']
}
jni.srcDirs = ['jni']
}
packagingOptions {
exclude 'lib/arm64-v8a/libopenxr_loader.so'
lintOptions {
checkReleaseBuilds false
disable 'ExpiredTargetSdkVersion'
}
//packagingOptions {
// exclude 'lib/arm64-v8a/libopenxr_loader.so'
//}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
compileSdkVersion = 29
buildToolsVersion = '29.0.3'
ndkVersion '21.1.6352462'
}
dependencies {
@ -59,12 +139,15 @@ dependencies {
repositories {
google()
}
buildscript {
repositories {
google()
}
// Workaround to fix issue in Android Studio Chipmunk 2021.2.1 and later
// where opening a project would result in a 'prepareKotlinBuildScriptModel'
// not found error
if (!tasks.findByName("prepareKotlinBuildScriptModel")) {
tasks.register("prepareKotlinBuildScriptModel") {}
}
task packBaseResources(type: Zip) {
from "../../z_vr_assets_base/"
destinationDir file("../../assets/")

View file

@ -0,0 +1,8 @@
org.gradle.jvmargs=-Xmx1536M \
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
org.gradle.caching=true
org.gradle.configureondemand=true

View file

@ -1,6 +1,5 @@
#Sun Sep 04 16:36:21 BST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View file

@ -173,6 +173,7 @@ set(JK2SPDir "${CMAKE_SOURCE_DIR}/codeJK2")
set(SharedDir ${CMAKE_SOURCE_DIR}/shared)
set(OpenJKLibDir "${CMAKE_SOURCE_DIR}/lib")
set(GSLIncludeDirectory "${OpenJKLibDir}/gsl-lite/include")
set(OpenALIncludeDirectory "${CMAKE_SOURCE_DIR}/code/client/OpenAL")
set(JKXRDir "${CMAKE_SOURCE_DIR}/JKXR")
set(OpenXRLibDir "${OpenJKLibDir}/openxr/include")
set(OpenGLExternalIncludeDir "${OpenJKLibDir}/external/include")

File diff suppressed because it is too large Load diff

View file

@ -2,13 +2,16 @@ extern cvar_t *vr_turn_mode;
extern cvar_t *vr_turn_angle;
extern cvar_t *vr_positional_factor;
extern cvar_t *vr_walkdirection;
extern cvar_t *vr_3rdperson_digital_direction;
extern cvar_t *vr_weapon_pitchadjust;
extern cvar_t *vr_saber_pitchadjust;
extern cvar_t *vr_control_scheme;
extern cvar_t *vr_virtual_stock;
extern cvar_t *vr_switch_sticks;
extern cvar_t *vr_immersive_cinematics;
extern cvar_t *vr_screen_dist;
extern cvar_t *vr_weapon_velocity_trigger;
extern cvar_t *vr_scope_engage_distance;
extern cvar_t *vr_force_velocity_trigger;
extern cvar_t *vr_force_distance_trigger;
extern cvar_t *vr_two_handed_weapons;
@ -16,6 +19,7 @@ extern cvar_t *vr_force_motion_controlled;
extern cvar_t *vr_force_motion_push;
extern cvar_t *vr_force_motion_pull;
extern cvar_t *vr_motion_enable_saber;
extern cvar_t *vr_always_run;
extern cvar_t *vr_crouch_toggle;
extern cvar_t *vr_irl_crouch_enabled;
extern cvar_t *vr_irl_crouch_to_stand_ratio;
@ -30,4 +34,8 @@ extern cvar_t *vr_gesture_triggered_use;
extern cvar_t *vr_use_gesture_boundary;
extern cvar_t *vr_align_weapons; // Only used for development
extern cvar_t *vr_refresh;
extern cvar_t *vr_super_sampling;
extern cvar_t *vr_engage_trigger;
extern cvar_t *vr_release_trigger;
extern cvar_t *vr_engage_trigger_index;
extern cvar_t *vr_release_trigger_index;

View file

@ -15,13 +15,16 @@ cvar_t *vr_turn_mode;
cvar_t *vr_turn_angle;
cvar_t *vr_positional_factor;
cvar_t *vr_walkdirection;
cvar_t *vr_3rdperson_digital_direction;
cvar_t *vr_weapon_pitchadjust;
cvar_t *vr_saber_pitchadjust;
cvar_t *vr_control_scheme;
cvar_t *vr_virtual_stock;
cvar_t *vr_switch_sticks;
cvar_t *vr_immersive_cinematics;
cvar_t *vr_screen_dist;
cvar_t *vr_weapon_velocity_trigger;
cvar_t * vr_scope_engage_distance;
cvar_t *vr_force_velocity_trigger;
cvar_t *vr_force_distance_trigger;
cvar_t *vr_two_handed_weapons;
@ -29,6 +32,7 @@ cvar_t *vr_force_motion_controlled;
cvar_t *vr_force_motion_push;
cvar_t *vr_force_motion_pull;
cvar_t *vr_motion_enable_saber;
cvar_t * vr_always_run;
cvar_t *vr_crouch_toggle;
cvar_t *vr_irl_crouch_enabled;
cvar_t *vr_irl_crouch_to_stand_ratio;
@ -43,6 +47,11 @@ cvar_t *vr_gesture_triggered_use;
cvar_t *vr_use_gesture_boundary;
cvar_t *vr_align_weapons;
cvar_t *vr_refresh;
cvar_t *vr_super_sampling;
cvar_t *vr_engage_trigger;
cvar_t *vr_release_trigger;
cvar_t *vr_engage_trigger_index;
cvar_t *vr_release_trigger_index;
ovrInputStateTrackedRemote leftTrackedRemoteState_old;
ovrInputStateTrackedRemote leftTrackedRemoteState_new;

View file

@ -39,6 +39,8 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
vr.right_handed = vr_control_scheme->value < 10 ||
vr_control_scheme->value == 99; // Always right-handed for weapon calibration
bool thirdPersonActive = !!((int) Cvar_VariableValue("cg_thirdPerson"));
static bool dominantGripPushed = false;
//Need this for the touch screen
@ -121,15 +123,40 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
Cvar_Set("vr_control_scheme", "99");
}
static int cinCameraTimestamp = -1;
if (vr.cin_camera && cinCameraTimestamp == -1) {
cinCameraTimestamp = Sys_Milliseconds();
}
else if (!vr.cin_camera) {
cinCameraTimestamp = -1;
}
//Set controller angles - We need to calculate all those we might need (including adjustments) for the client to then take its pick
{
vec3_t rotation = {0};
QuatToYawPitchRoll(pWeapon->Pose.orientation, rotation, vr.weaponangles[ANGLES_DEFAULT]);
QuatToYawPitchRoll(pOff->Pose.orientation, rotation, vr.offhandangles[ANGLES_DEFAULT]);
rotation[PITCH] = 45;
//If we are in a saberBlockDebounce thing then add on an angle
//Lerped upon how far from the start of the saber move
//Lerped upon how far from the start of the saber move
//Index default -> vr_saber_pitchadjust->value = -2.42187500
//Vive Default -> 0.312500000
rotation[PITCH] = vr_saber_pitchadjust->value;
//Individual Controller offsets (so that they match quest)
if (gAppState.controllersPresent == INDEX_CONTROLLERS)
{
rotation[PITCH] += 10.938125f;
}
else if (gAppState.controllersPresent == VIVE_CONTROLLERS)
{
rotation[PITCH] += 13.6725f;
}
else if (gAppState.controllersPresent == PICO_CONTROLLERS)
{
rotation[PITCH] += 12.500625f;
}
if (vr.saberBlockDebounce > cl.serverTime) {
float lerp = 0.0f;
//Where are we in the lerp
@ -188,10 +215,15 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
}
QuatToYawPitchRoll(pWeapon->Pose.orientation, rotation, vr.weaponangles[ANGLES_SABER]);
QuatToYawPitchRoll(pOff->Pose.orientation, rotation, vr.offhandangles[ANGLES_SABER]);
QuatToYawPitchRoll(pWeapon->GripPose.orientation, rotation, vr.weaponangles[ANGLES_SABER]);
QuatToYawPitchRoll(pOff->GripPose.orientation, rotation, vr.offhandangles[ANGLES_SABER]);
// + (gAppState.controllersPresent == INDEX_CONTROLLERS ? -35
//VIVE CONTROLLERS -> -33.6718750
rotation[PITCH] = vr_weapon_pitchadjust->value;
if (gAppState.controllersPresent == VIVE_CONTROLLERS)
{
rotation[PITCH] -= 33.6718750f;
}
QuatToYawPitchRoll(pWeapon->Pose.orientation, rotation, vr.weaponangles[ANGLES_ADJUSTED]);
QuatToYawPitchRoll(pOff->Pose.orientation, rotation, vr.offhandangles[ANGLES_ADJUSTED]);
@ -212,6 +244,28 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
static float menuYaw = 0;
if (VR_UseScreenLayer() && !vr.misc_camera)
{
if (vr.cin_camera && cinCameraTimestamp + 1000 < Sys_Milliseconds())
{
// To skip cinematic use any thumb or trigger (but wait a while
// to prevent skipping when cinematic is started during action)
if ((primaryButtonsNew & primaryThumb) != (primaryButtonsOld & primaryThumb)) {
sendButtonAction("+use", (primaryButtonsNew & primaryThumb));
}
if ((secondaryButtonsNew & secondaryThumb) != (secondaryButtonsOld & secondaryThumb)) {
sendButtonAction("+use", (secondaryButtonsNew & secondaryThumb));
}
if ((pDominantTrackedRemoteNew->Buttons & xrButton_Trigger) != (pDominantTrackedRemoteOld->Buttons & xrButton_Trigger)) {
sendButtonAction("+use", (pDominantTrackedRemoteNew->Buttons & xrButton_Trigger));
// mark button as already pressed to prevent firing after entering the game
pDominantTrackedRemoteOld->Buttons |= xrButton_Trigger;
}
if ((pOffTrackedRemoteNew->Buttons & xrButton_Trigger) != (pOffTrackedRemoteOld->Buttons & xrButton_Trigger)) {
sendButtonAction("+use", (pOffTrackedRemoteNew->Buttons & xrButton_Trigger));
// mark button as already pressed to prevent firing after entering the game
pOffTrackedRemoteOld->Buttons |= xrButton_Trigger;
}
}
bool controlsLeftHanded = vr_control_scheme->integer >= 10;
if (controlsLeftHanded == vr.menu_right_handed) {
interactWithTouchScreen(menuYaw, vr.offhandangles[ANGLES_DEFAULT]);
@ -267,11 +321,43 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
if (!vr.weapon_stabilised && vr.item_selector == 0 &&
!vr.misc_camera && !vr.cgzoommode)
{
if (distance < STABILISATION_DISTANCE &&
vr_two_handed_weapons->integer &&
cl.frame.ps.weapon >= WP_SABER) {
vr.weapon_stabilised = true;
} else {
if (vr_two_handed_weapons->integer)
{
if (distance < STABILISATION_DISTANCE &&
cl.frame.ps.weapon == WP_SABER)
{
vr.weapon_stabilised = true;
}
else
{
vec3_t dir, weaponposition, offhandposition;
VectorSet(weaponposition, pWeapon->Pose.position.z,
pWeapon->Pose.position.x, pWeapon->Pose.position.y);
VectorSet(offhandposition, pOff->Pose.position.z, pOff->Pose.position.x,
pOff->Pose.position.y);
VectorSubtract(weaponposition, offhandposition, dir);
VectorNormalize(dir);
vec3_t weaponangles, weaponForward, rotation = {0};
rotation[PITCH] = vr_weapon_pitchadjust->value;
if (gAppState.controllersPresent == VIVE_CONTROLLERS)
{
rotation[PITCH] -= 33.6718750f;
}
QuatToYawPitchRoll(pWeapon->Pose.orientation, rotation, weaponangles);
AngleVectors(weaponangles, weaponForward, NULL, NULL);
VectorNormalize(weaponForward);
if (cl.frame.ps.weapon > WP_SABER &&
DotProduct(weaponForward, dir) > 0.6f)
{
vr.weapon_stabilised = true;
}
}
}
if (!vr.weapon_stabilised)
{
vr.item_selector = 2;
}
}
@ -377,12 +463,6 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
}
static int cinCameraTimestamp = -1;
if (vr.cin_camera && cinCameraTimestamp == -1) {
cinCameraTimestamp = Sys_Milliseconds();
} else if (!vr.cin_camera) {
cinCameraTimestamp = -1;
}
if (vr.cin_camera && cinCameraTimestamp + 1000 < Sys_Milliseconds())
{
// To skip cinematic use any thumb or trigger (but wait a while
@ -472,6 +552,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
//Switch movement speed
if (!vr.cgzoommode && !vr_always_run->integer)
{
static bool switched = false;
if (between(-0.2f, primaryJoystickX, 0.2f) &&
@ -623,22 +704,30 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
//Should we trigger the disruptor scope?
if ((cl.frame.ps.weapon == WP_DISRUPTOR ||
cl.frame.ps.weapon == WP_BLASTER) &&
cl.frame.ps.stats[STAT_HEALTH] > 0)
if (!vr.cin_camera)
{
if (vr.weapon_stabilised &&
VectorLength(vr.weaponoffset) < 0.24f &&
vr.cgzoommode == 0) {
sendButtonAction("enterscope", true);
} else if ((VectorLength(vr.weaponoffset) > 0.26f || !vr.weapon_stabilised) &&
(vr.cgzoommode == 2 || vr.cgzoommode == 4)) {
if ((cl.frame.ps.weapon == WP_DISRUPTOR ||
cl.frame.ps.weapon == WP_BLASTER) &&
cl.frame.ps.stats[STAT_HEALTH] > 0)
{
if (vr.weapon_stabilised &&
VectorLength(vr.weaponoffset) < vr_scope_engage_distance->value &&
vr.cgzoommode == 0)
{
sendButtonAction("enterscope", true);
}
else if ((VectorLength(vr.weaponoffset) > 0.26f || !vr.weapon_stabilised) &&
(vr.cgzoommode == 2 || vr.cgzoommode == 4))
{
sendButtonActionSimple("exitscope");
}
}
else if (vr.cgzoommode == 2 || vr.cgzoommode == 4)
{
// In case we were using weapon scope and weapon
// was changed due to out of ammo, exit scope
sendButtonActionSimple("exitscope");
}
} else if (vr.cgzoommode == 2 || vr.cgzoommode == 4) {
// In case we were using weapon scope and weapon
// was changed due to out of ammo, exit scope
sendButtonActionSimple("exitscope");
}
vec3_t offhandPositionAverage;
@ -721,7 +810,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
vr.offhandoffset[1] = pOff->Pose.position.y - vr.hmdposition[1];
vr.offhandoffset[2] = pOff->Pose.position.z - vr.hmdposition[2];
if (vr_walkdirection->value == 0) {
if (vr_walkdirection->value == 0 && !thirdPersonActive) {
controllerYawHeading = vr.offhandangles[ANGLES_ADJUSTED][YAW] - vr.hmdorientation[YAW];
} else {
controllerYawHeading = 0.0f;
@ -867,11 +956,38 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
vec2_t v;
rotateAboutOrigin(x, y, controllerYawHeading, v);
//Move a lot slower if scope is engaged
remote_movementSideways =
v[0] * (vr.move_speed == 0 ? 0.75f : (vr.move_speed == 1 ? 1.0f : 0.5f));
remote_movementForward =
v[1] * (vr.move_speed == 0 ? 0.75f : (vr.move_speed == 1 ? 1.0f : 0.5f));
// If in third person, use digital input (North, North-East, East, South-East etc)
// for movement as it allows execution of player special moves correctly in JKA
if (thirdPersonActive && vr_3rdperson_digital_direction->integer)
{
float angle = RAD2DEG(atan2f(v[1], v[0])) + 22.5;
int segment = angle / 45.0f;
angle = segment * 45.0f;
v[0] = nlf * cosf(DEG2RAD(angle));
v[1] = nlf * sinf(DEG2RAD(angle));
}
float move_speed_multiplier = 1.0f;
switch (vr.move_speed)
{
case 0:
move_speed_multiplier = 0.75f;
break;
case 1:
move_speed_multiplier = 1.0f;
break;
case 2:
move_speed_multiplier = 0.5f;
break;
}
if (vr_always_run->integer || vr_3rdperson_digital_direction->integer)
{
move_speed_multiplier = 1.0f;
}
remote_movementSideways = move_speed_multiplier * v[0];
remote_movementForward = move_speed_multiplier * v[1];
//X button invokes menu now
@ -969,7 +1085,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
if (!usingSnapTurn && fabs(primaryJoystickX) > 0.1f) //smooth turn
{
vr.snapTurn -= ((vr_turn_angle->value / 10.0f) *
vr.snapTurn -= ((vr_turn_angle->value / 25.0f) *
primaryJoystickX);
if (vr.snapTurn > 180.0f) {
vr.snapTurn -= 360.f;
@ -1055,7 +1171,6 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
// Process "use" gesture
if (vr_gesture_triggered_use->integer) {
bool thirdPersonActive = !!((int) Cvar_VariableValue("cg_thirdPerson"));
bool gestureUseAllowed = !vr.weapon_stabilised && !vr.cin_camera && !vr.misc_camera && !vr.remote_turret && !vr.emplaced_gun && !vr.in_vehicle && !thirdPersonActive;
// Off-hand gesture
float distanceToBody = sqrt(vr.offhandoffset[0]*vr.offhandoffset[0] + vr.offhandoffset[2]*vr.offhandoffset[2]);

View file

@ -45,12 +45,26 @@ void HandleInput_WeaponAlign( ovrInputStateTrackedRemote *pDominantTrackedRemote
//if we are in saber block debounce, don't update the saber angles
if (vr.saberBlockDebounce < cl.serverTime) {
rotation[PITCH] = 45;
QuatToYawPitchRoll(pDominantTracking->Pose.orientation, rotation, vr.weaponangles[ANGLES_SABER]);
QuatToYawPitchRoll(pOffTracking->Pose.orientation, rotation, vr.offhandangles[ANGLES_SABER]);
rotation[PITCH] = vr_saber_pitchadjust->value;
//Individual Controller offsets (so that they match quest)
if (gAppState.controllersPresent == INDEX_CONTROLLERS)
{
rotation[PITCH] += 10.938125f;
}
else if (gAppState.controllersPresent == PICO_CONTROLLERS)
{
rotation[PITCH] += 12.500625f;
}
QuatToYawPitchRoll(pDominantTracking->GripPose.orientation, rotation, vr.weaponangles[ANGLES_SABER]);
QuatToYawPitchRoll(pOffTracking->GripPose.orientation, rotation, vr.offhandangles[ANGLES_SABER]);
}
rotation[PITCH] = vr_weapon_pitchadjust->value;
if (gAppState.controllersPresent == VIVE_CONTROLLERS)
{
rotation[PITCH] -= 33.6718750f;
}
QuatToYawPitchRoll(pDominantTracking->Pose.orientation, rotation, vr.weaponangles[ANGLES_ADJUSTED]);
QuatToYawPitchRoll(pOffTracking->Pose.orientation, rotation, vr.offhandangles[ANGLES_ADJUSTED]);

View file

@ -37,8 +37,6 @@ extern float SS_MULTIPLIER ;
/* global arg_xxx structs */
struct arg_dbl *ss;
struct arg_int *cpu;
struct arg_int *gpu;
struct arg_int *msaa;
struct arg_end *end;
@ -59,6 +57,7 @@ bool VR_UseScreenLayer()
(bool)((vr.cin_camera && !vr.immersive_cinematics) ||
vr.misc_camera ||
(CL_IsRunningInGameCinematic() || CL_InGameCinematicOnStandBy()) ||
// (cls.state == CA_DISCONNECTED) ||
(cls.state == CA_CINEMATIC) ||
(cls.state == CA_LOADING) ||
( Key_GetCatcher( ) & KEYCATCH_UI ) ||
@ -151,7 +150,7 @@ void VR_SetHMDOrientation(float pitch, float yaw, float roll)
//Keep this for our records
VectorCopy(vr.hmdorientation, vr.hmdorientation_last);
if (!vr.third_person && !vr.remote_npc && !vr.remote_turret
if (!vr.third_person && !vr.remote_npc && !vr.remote_turret && !vr.cgzoommode
#ifndef JK2_MODE
&& !vr.in_vehicle
#endif
@ -160,7 +159,7 @@ void VR_SetHMDOrientation(float pitch, float yaw, float roll)
VectorCopy(vr.hmdorientation, vr.hmdorientation_first);
}
if (!vr.remote_turret)
if (!vr.remote_turret && !vr.cgzoommode)
{
VectorCopy(vr.weaponangles[ANGLES_ADJUSTED], vr.weaponangles_first[ANGLES_ADJUSTED]);
}
@ -233,12 +232,13 @@ void VR_GetMove(float *forward, float *side, float *pos_forward, float *pos_side
}
else if (vr.cgzoommode == 2 || vr.cgzoommode == 4)
{
*forward = 0.0f;
*forward = remote_movementForward / 3.0f;
*pos_forward = 0.0f;
*up = 0.0f;
*side = 0.0f;
*side = remote_movementSideways / 3.0f;
*pos_side = 0.0f;
*yaw = vr.snapTurn;
*yaw = vr.snapTurn + vr.hmdorientation_first[YAW] +
vr.weaponangles[ANGLES_ADJUSTED][YAW] - vr.weaponangles_first[ANGLES_ADJUSTED][YAW];
*pitch = vr.weaponangles[ANGLES_ADJUSTED][PITCH];
*roll = 0.0f;//vr.hmdorientation[ROLL];
}
@ -328,7 +328,9 @@ void VR_Init()
vr_turn_angle = Cvar_Get( "vr_turn_angle", "45", CVAR_ARCHIVE);
vr_positional_factor = Cvar_Get( "vr_positional_factor", "12", CVAR_ARCHIVE);
vr_walkdirection = Cvar_Get( "vr_walkdirection", "1", CVAR_ARCHIVE);
vr_3rdperson_digital_direction = Cvar_Get( "vr_3rdperson_digital_direction", "1", CVAR_ARCHIVE);
vr_weapon_pitchadjust = Cvar_Get( "vr_weapon_pitchadjust", "-20.0", CVAR_ARCHIVE);
vr_saber_pitchadjust = Cvar_Get( "vr_saber_pitchadjust", "-13.36", CVAR_ARCHIVE);
vr_virtual_stock = Cvar_Get( "vr_virtual_stock", "0", CVAR_ARCHIVE);
//Defaults
@ -338,6 +340,7 @@ void VR_Init()
vr_immersive_cinematics = Cvar_Get("vr_immersive_cinematics", "1", CVAR_ARCHIVE);
vr_screen_dist = Cvar_Get( "vr_screen_dist", "3.5", CVAR_ARCHIVE);
vr_weapon_velocity_trigger = Cvar_Get( "vr_weapon_velocity_trigger", "2.0", CVAR_ARCHIVE);
vr_scope_engage_distance = Cvar_Get( "vr_scope_engage_distance", "0.25", CVAR_ARCHIVE);
vr_force_velocity_trigger = Cvar_Get( "vr_force_velocity_trigger", "2.09", CVAR_ARCHIVE);
vr_force_distance_trigger = Cvar_Get( "vr_force_distance_trigger", "0.15", CVAR_ARCHIVE);
vr_two_handed_weapons = Cvar_Get ("vr_two_handed_weapons", "1", CVAR_ARCHIVE);
@ -345,6 +348,7 @@ void VR_Init()
vr_force_motion_push = Cvar_Get ("vr_force_motion_push", "3", CVAR_ARCHIVE);
vr_force_motion_pull = Cvar_Get ("vr_force_motion_pull", "4", CVAR_ARCHIVE);
vr_motion_enable_saber = Cvar_Get ("vr_motion_enable_saber", "0", CVAR_ARCHIVE);
vr_always_run = Cvar_Get ("vr_always_run", "1", CVAR_ARCHIVE);
vr_crouch_toggle = Cvar_Get ("vr_crouch_toggle", "0", CVAR_ARCHIVE);
vr_irl_crouch_enabled = Cvar_Get ("vr_irl_crouch_enabled", "0", CVAR_ARCHIVE);
vr_irl_crouch_to_stand_ratio = Cvar_Get ("vr_irl_crouch_to_stand_ratio", "0.65", CVAR_ARCHIVE);
@ -359,6 +363,11 @@ void VR_Init()
vr_use_gesture_boundary = Cvar_Get ("vr_use_gesture_boundary", "0.35", CVAR_ARCHIVE);
vr_align_weapons = Cvar_Get ("vr_align_weapons", "0", CVAR_ARCHIVE);
vr_refresh = Cvar_Get ("vr_refresh", "72", CVAR_ARCHIVE);
vr_super_sampling = Cvar_Get ("vr_super_sampling", "1.0", CVAR_ARCHIVE);
vr_engage_trigger = Cvar_Get("vr_engage_trigger", "0.7", CVAR_ARCHIVE);
vr_release_trigger = Cvar_Get("vr_release_trigger", "0.7", CVAR_ARCHIVE);
vr_engage_trigger_index = Cvar_Get("vr_engage_trigger_index", "0.7", CVAR_ARCHIVE);
vr_release_trigger_index = Cvar_Get("vr_release_trigger_index", "0.05", CVAR_ARCHIVE);
cvar_t *expanded_menu_enabled = Cvar_Get ("expanded_menu_enabled", "0", CVAR_ARCHIVE);
if (FS_FileExists("expanded_menu.pk3") || FS_BaseFileExists("expanded_menu.pk3")) {
@ -367,6 +376,13 @@ void VR_Init()
Cvar_Set( "expanded_menu_enabled", "0" );
}
cvar_t *mod_npcsp_enabled = Cvar_Get ("mod_npcsp_enabled", "0", CVAR_ARCHIVE);
if (FS_FileExists("NpcSP_v1.1.pk3") || FS_BaseFileExists("NpcSP_v1.1.pk3")) {
Cvar_Set( "mod_npcsp_enabled", "1" );
} else {
Cvar_Set( "mod_npcsp_enabled", "0" );
}
vr.menu_right_handed = vr_control_scheme->integer == 0;
Cvar_Get ("openXRHMD", gAppState.OpenXRHMD, CVAR_ARCHIVE);
@ -779,8 +795,6 @@ JNIEXPORT jlong JNICALL Java_com_drbeef_jkxr_GLES3JNILib_onCreate( JNIEnv * env,
/* the global arg_xxx structs are initialised within the argtable */
void *argtable[] = {
ss = arg_dbl0("s", "supersampling", "<double>", "super sampling value (default: Q1: 1.2, Q2: 1.35)"),
cpu = arg_int0("c", "cpu", "<int>", "CPU perf index 1-4 (default: 2)"),
gpu = arg_int0("g", "gpu", "<int>", "GPU perf index 1-4 (default: 3)"),
msaa = arg_int0("m", "msaa", "<int>", "MSAA (default: 1)"),
end = arg_end(20)
};

View file

@ -71,6 +71,9 @@ const float ZOOM_FOV_ADJUST = 1.05f;
GLboolean stageSupported = GL_FALSE;
float superSampling = 1.0f;
qboolean usingScreenLayer = qtrue;
qboolean resetScreenLayerRenderer = qfalse;
const char* const requiredExtensionNames_meta[] = {
XR_KHR_OPENGL_ES_ENABLE_EXTENSION_NAME,
@ -1218,8 +1221,15 @@ bool destroyed = qfalse;
void TBXR_GetScreenRes(int *width, int *height)
{
*width = gAppState.Width;
*height = gAppState.Height;
float configuredSuperSampling = Cvar_VariableValue("vr_super_sampling");
if (configuredSuperSampling != 0.0f && configuredSuperSampling != superSampling) {
superSampling = configuredSuperSampling;
resetScreenLayerRenderer = qtrue;
Cbuf_AddText( "vid_restart\n" );
}
*width = gAppState.Width * superSampling;
*height = gAppState.Height * superSampling;
}
XrInstance TBXR_GetXrInstance() {
@ -1570,11 +1580,14 @@ void TBXR_InitRenderer( ) {
pfnXrGetConfigPICO(gAppState.Session, GET_DISPLAY_RATE, &gAppState.currentDisplayRefreshRate);
}
int eyeW, eyeH;
TBXR_GetScreenRes(&eyeW, &eyeH);
ovrRenderer_Create(
gAppState.Session,
&gAppState.Renderer,
gAppState.ViewConfigurationView[0].recommendedImageRectWidth,
gAppState.ViewConfigurationView[0].recommendedImageRectHeight);
eyeW,
eyeH);
}
void VR_DestroyRenderer( )
@ -1583,6 +1596,13 @@ void VR_DestroyRenderer( )
free(gAppState.Views);
}
void VR_ResetRenderer()
{
VR_DestroyRenderer();
TBXR_InitialiseResolution();
TBXR_InitRenderer();
}
void TBXR_InitialiseOpenXR()
{
ovrApp_Clear(&gAppState);
@ -1828,6 +1848,7 @@ void TBXR_FrameSetup()
VR_FrameSetup();
//Get controller state here
TBXR_updateProjections();
TBXR_GetHMDOrientation();
VR_HandleControllerInput();
@ -1927,11 +1948,9 @@ void TBXR_submitFrame()
return;
}
TBXR_updateProjections();
//Calculate the maximum extent fov for use in culling in the engine (we won't want to cull inside this fov)
vr.fov_x = (fabs(gAppState.Views[0].fov.angleLeft) + fabs(gAppState.Views[1].fov.angleLeft)) * 180.0f / M_PI;
vr.fov_y = (fabs(gAppState.Views[0].fov.angleUp) + fabs(gAppState.Views[0].fov.angleUp)) * 180.0f / M_PI;
vr.fov_x = (fabs(gAppState.Views[0].fov.angleLeft) + fabs(gAppState.Views[1].fov.angleRight)) * 180.0f / M_PI;
vr.fov_y = (fabs(gAppState.Views[0].fov.angleUp) + fabs(gAppState.Views[0].fov.angleDown)) * 180.0f / M_PI;
XrFrameEndInfo endFrameInfo = {};
@ -1949,6 +1968,16 @@ void TBXR_submitFrame()
if (!VR_UseScreenLayer())
{
if (usingScreenLayer) {
usingScreenLayer = qfalse;
float configuredSuperSampling = Cvar_VariableValue("vr_super_sampling");
if (configuredSuperSampling != 0.0f && configuredSuperSampling != superSampling)
{
VR_ResetRenderer();
}
}
memset(&projection_layer, 0, sizeof(XrCompositionLayerProjection));
projection_layer.type = XR_TYPE_COMPOSITION_LAYER_PROJECTION;
projection_layer.layerFlags = XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT;
@ -1982,6 +2011,14 @@ void TBXR_submitFrame()
}
else
{
usingScreenLayer = qtrue;
if (resetScreenLayerRenderer) {
resetScreenLayerRenderer = qfalse;
VR_ResetRenderer();
}
#ifdef _WIN32
//Empty black projection for now
memset(&projection_layer, 0, sizeof(XrCompositionLayerProjection));
projection_layer.type = XR_TYPE_COMPOSITION_LAYER_PROJECTION;
@ -2003,7 +2040,7 @@ void TBXR_submitFrame()
// Compose the layers for this frame.
layers[layerCount++] = (const XrCompositionLayerBaseHeader*)&projection_layer;
#endif
memset(&quad_layer, 0, sizeof(XrCompositionLayerQuad));
// Build the quad layers

View file

@ -71,6 +71,7 @@ typedef struct {
typedef struct {
GLboolean Active;
XrPosef Pose;
XrPosef GripPose;
XrSpaceVelocity Velocity;
} ovrTrackedController;
@ -245,8 +246,8 @@ typedef struct
GLboolean SessionActive;
XrPosef xfStageFromHead;
XrView* Views;
int controllersPresent = -1;
float currentDisplayRefreshRate;
float* SupportedDisplayRefreshRates;
uint32_t RequestedDisplayRefreshRateIndex;
@ -336,4 +337,10 @@ void TBXR_prepareEyeBuffer(int eye );
void TBXR_finishEyeBuffer(int eye );
void TBXR_submitFrame();
#define VIVE_CONTROLLERS 10
#define INDEX_CONTROLLERS 11
#define PICO_CONTROLLERS 12
#define TOUCH_CONTROLLERS 13
//Anything else will emulate touch
#endif //vrcommon_h

View file

@ -33,8 +33,12 @@ bool VR_UseScreenLayer()
(bool)((vr.cin_camera && !vr.immersive_cinematics) ||
vr.misc_camera ||
(CL_IsRunningInGameCinematic() || CL_InGameCinematicOnStandBy()) ||
(cls.state == CA_DISCONNECTED) ||
(cls.state == CA_CHALLENGING) ||
(cls.state == CA_CONNECTING) ||
(cls.state == CA_CINEMATIC) ||
(cls.state == CA_LOADING) ||
(cls.state == CA_PRIMED) ||
( Key_GetCatcher( ) & KEYCATCH_UI ) ||
( Key_GetCatcher( ) & KEYCATCH_CONSOLE ));
@ -56,7 +60,7 @@ void VR_SetHMDOrientation(float pitch, float yaw, float roll)
//Keep this for our records
VectorCopy(vr.hmdorientation, vr.hmdorientation_last);
if (!vr.third_person && !vr.remote_npc && !vr.remote_turret
if (!vr.third_person && !vr.remote_npc && !vr.remote_turret && !vr.cgzoommode
#ifndef JK2_MODE
&& !vr.in_vehicle
#endif
@ -65,7 +69,7 @@ void VR_SetHMDOrientation(float pitch, float yaw, float roll)
VectorCopy(vr.hmdorientation, vr.hmdorientation_first);
}
if (!vr.remote_turret)
if (!vr.remote_turret && !vr.cgzoommode)
{
VectorCopy(vr.weaponangles[ANGLES_ADJUSTED], vr.weaponangles_first[ANGLES_ADJUSTED]);
}
@ -93,12 +97,13 @@ void VR_SetHMDOrientation(float pitch, float yaw, float roll)
void VR_SetHMDPosition(float x, float y, float z )
{
static bool s_useScreen = qfalse;
static int frame = 0;
VectorSet(vr.hmdposition, x, y, z);
//Can be set elsewhere
vr.take_snap |= s_useScreen != VR_UseScreenLayer();
if (vr.take_snap)
if (vr.take_snap || (frame++ < 100))
{
s_useScreen = VR_UseScreenLayer();
@ -138,12 +143,13 @@ void VR_GetMove(float *forward, float *side, float *pos_forward, float *pos_side
}
else if (vr.cgzoommode == 2 || vr.cgzoommode == 4)
{
*forward = 0.0f;
*forward = remote_movementForward / 3.0f;
*pos_forward = 0.0f;
*up = 0.0f;
*side = 0.0f;
*side = remote_movementSideways / 3.0f;
*pos_side = 0.0f;
*yaw = vr.snapTurn;
*yaw = vr.snapTurn + vr.hmdorientation_first[YAW] +
vr.weaponangles[ANGLES_ADJUSTED][YAW] - vr.weaponangles_first[ANGLES_ADJUSTED][YAW];
*pitch = vr.weaponangles[ANGLES_ADJUSTED][PITCH];
*roll = 0.0f;//vr.hmdorientation[ROLL];
}
@ -240,7 +246,9 @@ void VR_Init()
vr_turn_angle = Cvar_Get( "vr_turn_angle", "45", CVAR_ARCHIVE);
vr_positional_factor = Cvar_Get( "vr_positional_factor", "12", CVAR_ARCHIVE);
vr_walkdirection = Cvar_Get( "vr_walkdirection", "1", CVAR_ARCHIVE);
vr_3rdperson_digital_direction = Cvar_Get( "vr_3rdperson_digital_direction", "1", CVAR_ARCHIVE);
vr_weapon_pitchadjust = Cvar_Get( "vr_weapon_pitchadjust", "-20.0", CVAR_ARCHIVE);
vr_saber_pitchadjust = Cvar_Get( "vr_saber_pitchadjust", "-13.36", CVAR_ARCHIVE);
vr_virtual_stock = Cvar_Get( "vr_virtual_stock", "0", CVAR_ARCHIVE);
//Defaults
@ -250,6 +258,7 @@ void VR_Init()
vr_immersive_cinematics = Cvar_Get("vr_immersive_cinematics", "1", CVAR_ARCHIVE);
vr_screen_dist = Cvar_Get( "vr_screen_dist", "3.5", CVAR_ARCHIVE);
vr_weapon_velocity_trigger = Cvar_Get( "vr_weapon_velocity_trigger", "2.0", CVAR_ARCHIVE);
vr_scope_engage_distance = Cvar_Get( "vr_scope_engage_distance", "0.25", CVAR_ARCHIVE);
vr_force_velocity_trigger = Cvar_Get( "vr_force_velocity_trigger", "2.09", CVAR_ARCHIVE);
vr_force_distance_trigger = Cvar_Get( "vr_force_distance_trigger", "0.15", CVAR_ARCHIVE);
vr_two_handed_weapons = Cvar_Get ("vr_two_handed_weapons", "1", CVAR_ARCHIVE);
@ -257,6 +266,7 @@ void VR_Init()
vr_force_motion_push = Cvar_Get ("vr_force_motion_push", "3", CVAR_ARCHIVE);
vr_force_motion_pull = Cvar_Get ("vr_force_motion_pull", "4", CVAR_ARCHIVE);
vr_motion_enable_saber = Cvar_Get ("vr_motion_enable_saber", "0", CVAR_ARCHIVE);
vr_always_run = Cvar_Get ("vr_always_run", "1", CVAR_ARCHIVE);
vr_crouch_toggle = Cvar_Get ("vr_crouch_toggle", "0", CVAR_ARCHIVE);
vr_irl_crouch_enabled = Cvar_Get ("vr_irl_crouch_enabled", "0", CVAR_ARCHIVE);
vr_irl_crouch_to_stand_ratio = Cvar_Get ("vr_irl_crouch_to_stand_ratio", "0.65", CVAR_ARCHIVE);
@ -271,6 +281,10 @@ void VR_Init()
vr_use_gesture_boundary = Cvar_Get ("vr_use_gesture_boundary", "0.35", CVAR_ARCHIVE);
vr_align_weapons = Cvar_Get ("vr_align_weapons", "0", CVAR_ARCHIVE);
vr_refresh = Cvar_Get ("vr_refresh", "72", CVAR_ARCHIVE);
vr_engage_trigger = Cvar_Get("vr_engage_trigger", "0.7", CVAR_ARCHIVE);
vr_release_trigger = Cvar_Get("vr_release_trigger", "0.7", CVAR_ARCHIVE);
vr_engage_trigger_index = Cvar_Get("vr_engage_trigger_index", "0.7", CVAR_ARCHIVE);
vr_release_trigger_index = Cvar_Get("vr_release_trigger_index", "0.05", CVAR_ARCHIVE);
cvar_t *expanded_menu_enabled = Cvar_Get ("expanded_menu_enabled", "0", CVAR_ARCHIVE);
if (FS_FileExists("expanded_menu.pk3") || FS_BaseFileExists("expanded_menu.pk3")) {
@ -279,6 +293,13 @@ void VR_Init()
Cvar_Set( "expanded_menu_enabled", "0" );
}
cvar_t *mod_npcsp_enabled = Cvar_Get ("mod_npcsp_enabled", "0", CVAR_ARCHIVE);
if (FS_FileExists("NpcSP_v1.1.pk3") || FS_BaseFileExists("NpcSP_v1.1.pk3")) {
Cvar_Set( "mod_npcsp_enabled", "1" );
} else {
Cvar_Set( "mod_npcsp_enabled", "0" );
}
vr.menu_right_handed = vr_control_scheme->integer == 0;
}

View file

@ -212,35 +212,21 @@ void ovrFramebuffer_SetNone() {
GL(glBindFramebuffer(GL_FRAMEBUFFER, 0));
}
PFNGLBLITNAMEDFRAMEBUFFERPROC glBlitNamedFramebuffer = NULL;
extern cvar_t* r_mode;
qboolean R_GetModeInfo(int* width, int* height, int mode);
void ovrFramebuffer_Resolve(ovrFramebuffer* frameBuffer) {
if (glBlitNamedFramebuffer == NULL)
{
glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)SDL_GL_GetProcAddress("glBlitNamedFramebuffer");
}
const GLuint colorTexture = frameBuffer->ColorSwapChainImage[frameBuffer->TextureSwapChainIndex].image;
int width, height;
R_GetModeInfo(&width, &height, r_mode->integer);
glBlitNamedFramebuffer((GLuint)colorTexture, // readFramebuffer
(GLuint)0, // backbuffer // drawFramebuffer
(GLint)0, // srcX0
(GLint)0, // srcY0
(GLint)gAppState.Width, // srcX1
(GLint)gAppState.Height, // srcY1
(GLint)0, // dstX0
(GLint)0, // dstY0
(GLint)width, // dstX1
(GLint)height, // dstY1
(GLbitfield)GL_COLOR_BUFFER_BIT, // mask
(GLenum)GL_LINEAR); // filter
glBindFramebuffer(GL_READ_FRAMEBUFFER, frameBuffer->FrameBuffers[frameBuffer->TextureSwapChainIndex]);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBlitFramebuffer(0, 0, gAppState.Width, gAppState.Height,
0, 0, width, height,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
}
void ovrFramebuffer_Acquire(ovrFramebuffer* frameBuffer) {
@ -906,7 +892,10 @@ void TBXR_InitialiseOpenXR()
OXR(initResult = xrGetSystem(gAppState.Instance, &systemGetInfo, &gAppState.SystemId));
if (initResult != XR_SUCCESS) {
ALOGE("Failed to get system.");
if (initResult != XR_SUCCESS) {
Sys_Dialog(DT_ERROR, "Unable to create OpenXR System - Please ensure you headset is connected and powered on.", "No VR Headset Detected");
exit(1);
}
exit(1);
}
@ -1051,7 +1040,7 @@ void TBXR_FrameSetup()
//Game specific frame setup stuff called here
VR_FrameSetup();
//Get controller state here
TBXR_updateProjections();
TBXR_GetHMDOrientation();
VR_HandleControllerInput();
@ -1159,11 +1148,9 @@ void TBXR_submitFrame()
return;
}
TBXR_updateProjections();
//Calculate the maximum extent fov for use in culling in the engine (we won't want to cull inside this fov)
vr.fov_x = (fabs(gAppState.Views[0].fov.angleLeft) + fabs(gAppState.Views[1].fov.angleLeft)) * 180.0f / M_PI;
vr.fov_y = (fabs(gAppState.Views[0].fov.angleUp) + fabs(gAppState.Views[0].fov.angleUp)) * 180.0f / M_PI;
vr.fov_x = (fabs(gAppState.Views[0].fov.angleLeft) + fabs(gAppState.Views[1].fov.angleRight)) * 180.0f / M_PI;
vr.fov_y = (fabs(gAppState.Views[0].fov.angleUp) + fabs(gAppState.Views[0].fov.angleDown)) * 180.0f / M_PI;
XrFrameEndInfo endFrameInfo = {};

View file

@ -94,6 +94,7 @@ typedef struct {
typedef struct {
GLboolean Active;
XrPosef Pose;
XrPosef GripPose;
XrSpaceVelocity Velocity;
} ovrTrackedController;
@ -192,8 +193,8 @@ typedef struct
GLboolean SessionActive;
XrPosef xfStageFromHead;
XrView* Views;
int controllersPresent = -1;
float currentDisplayRefreshRate;
float* SupportedDisplayRefreshRates;
uint32_t RequestedDisplayRefreshRateIndex;
@ -266,4 +267,10 @@ void TBXR_prepareEyeBuffer(int eye );
void TBXR_finishEyeBuffer(int eye );
void TBXR_submitFrame();
#define VIVE_CONTROLLERS 10
#define INDEX_CONTROLLERS 11
#define PICO_CONTROLLERS 12
#define TOUCH_CONTROLLERS 13
//Anything else will emulate touch
#endif //vrcommon_h

View file

@ -56,7 +56,7 @@ if(BuildSPEngine OR BuildJK2SPEngine)
# Dependencies
# OpenAL (is optionally included for Windows)
if(MSVC AND NOT WIN64)
if(MSVC)
if(UseInternalOpenAL)
# There's a libs/OpenAL32.lib
# (mrw) TODO Is this actually required on windows? It is loaded at runtime, should not be linked?
@ -65,6 +65,7 @@ if(BuildSPEngine OR BuildJK2SPEngine)
message(FATAL_ERROR "UseInternalOpenAL enabled, but lib/OpenAL32.lib not found!")
endif(NOT OpenALLibrary)
set(SPEngineLibraries ${SPEngineLibraries} ${OpenALLibrary})
set(SPEngineIncludeDirectories ${SPEngineIncludeDirectories} ${OpenALIncludeDirectory})
else(UseInternalOpenAL)
find_package(OpenAL REQUIRED)
set(SPEngineIncludeDirectories ${SPEngineIncludeDirectories} ${OPENAL_INCLUDE_DIR})

View file

@ -37,6 +37,12 @@ char *Sys_Cwd( void ) {
return cwd;
}
//No support for this on Android atm
dialogResult_t Sys_Dialog(dialogType_t type, const char* message, const char* title)
{
return DR_OK;
}
/*
=================
Sys_ConsoleInput

View file

@ -335,7 +335,8 @@ static const char *gcmds[] = {
"use_lightamp_goggles",
"use_seeker",
"use_sentry",
"viewobjective"
"viewobjective",
"unlimitedpower"
};
static const size_t numgcmds = ARRAY_LEN( gcmds );

View file

@ -1634,26 +1634,20 @@ static void CG_DrawWeapReticle( void )
vec4_t light_color = {0.7, 0.7, 0.7, 1};
vec4_t black = {0.0, 0.0, 0.0, 1};
float indent = 0.16;
float indent = 0.12;
float X_WIDTH=640;
float Y_HEIGHT=480;
float STRETCH = 6;
float x = (X_WIDTH * indent), y = (Y_HEIGHT * indent), w = (X_WIDTH * (1-(2*indent))) / 2.0f, h = (Y_HEIGHT * (1-(2*indent))) / 2;
// sides
CG_FillRect( 0, 0, (X_WIDTH * indent), Y_HEIGHT, black );
CG_FillRect( X_WIDTH * (1 - indent), 0, (X_WIDTH * indent), Y_HEIGHT, black );
// top/bottom
CG_FillRect( X_WIDTH * indent, 0, X_WIDTH * (1-indent), Y_HEIGHT * indent, black );
CG_FillRect( X_WIDTH * indent, Y_HEIGHT * (1-indent), X_WIDTH * (1-indent), Y_HEIGHT * indent, black );
{
// center
if ( cgs.media.reticleShader ) {
cgi_R_DrawStretchPic( x, y, w, h, 0, 0, 1, 1, cgs.media.reticleShader ); // tl
cgi_R_DrawStretchPic( x + w, y, w, h, 1, 0, 0, 1, cgs.media.reticleShader ); // tr
cgi_R_DrawStretchPic( x, y + h, w, h, 0, 1, 1, 0, cgs.media.reticleShader ); // bl
cgi_R_DrawStretchPic( x + w, y + h, w, h, 1, 1, 0, 0, cgs.media.reticleShader ); // br
cgi_R_DrawStretchPic( x - STRETCH, y - STRETCH, w + STRETCH, h+STRETCH, 0, 0, 1, 1, cgs.media.reticleShader ); // tl
cgi_R_DrawStretchPic( x + w, y - STRETCH, w + STRETCH, h + STRETCH, 1, 0, 0, 1, cgs.media.reticleShader ); // tr
cgi_R_DrawStretchPic( x - STRETCH, y + h, w + STRETCH, h + STRETCH, 0, 1, 1, 0, cgs.media.reticleShader ); // bl
cgi_R_DrawStretchPic( x + w, y + h, w + STRETCH, h + STRETCH, 1, 1, 0, 0, cgs.media.reticleShader ); // br
}
// hairs
@ -1662,6 +1656,13 @@ static void CG_DrawWeapReticle( void )
CG_FillRect( 319, 300, 2, 178, black ); // center bot
CG_FillRect( 380, 239, 177, 2, black ); // right
}
// sides
CG_FillRect( 0, 0, (X_WIDTH * indent)+1, Y_HEIGHT, black );
CG_FillRect( X_WIDTH * (1 - indent) - 1, 0, (X_WIDTH * indent) + 2, Y_HEIGHT, black );
// top/bottom
CG_FillRect( X_WIDTH * indent, 0, X_WIDTH * (1-indent), Y_HEIGHT * indent + 1, black );
CG_FillRect( X_WIDTH * indent, Y_HEIGHT * (1-indent) - 1, X_WIDTH * (1-indent), Y_HEIGHT * indent + 2, black );
}
//--------------------------------------
@ -4117,15 +4118,24 @@ CG_DrawVignette
float currentComfortVignetteValue = 0.0f;
float filteredViewYawDelta = 0.0f;
static void CG_DrawVignette( void )
static void CG_DrawVignette( bool force )
{
playerState_t *ps;
ps = &cg.snap->ps;
float vignetteValue;
cvar_t *vr_comfort_vignette = gi.cvar("vr_comfort_vignette", "0.0", CVAR_ARCHIVE); // defined in VrCvars.h
if (vr_comfort_vignette->value <= 0.0f || vr_comfort_vignette->value > 1.0f || !cg.zoomMode == 0)
if (!force)
{
return;
if (vr_comfort_vignette->value <= 0.0f || vr_comfort_vignette->value > 1.0f || !cg.zoomMode == 0)
{
return;
}
vignetteValue = vr_comfort_vignette->value;
}
else
{
vignetteValue = 0.3f;
}
bool isMoving = VectorLength(cg.predicted_player_state.velocity) > 30.0;
@ -4144,17 +4154,17 @@ static void CG_DrawVignette( void )
isTurning = filteredViewYawDelta > 1;
}
if (isMoving || isInAir || isTurning)
if (isMoving || isInAir || isTurning || force)
{
if (currentComfortVignetteValue < vr_comfort_vignette->value)
if (currentComfortVignetteValue < vignetteValue)
{
currentComfortVignetteValue += vr_comfort_vignette->value * 0.05;
currentComfortVignetteValue += vignetteValue * 0.05;
if (currentComfortVignetteValue > 1.0f)
currentComfortVignetteValue = 1.0f;
}
} else{
if (currentComfortVignetteValue > 0.0f)
currentComfortVignetteValue -= vr_comfort_vignette->value * 0.05;
currentComfortVignetteValue -= vignetteValue * 0.05;
}
if (currentComfortVignetteValue > 0.0f && currentComfortVignetteValue <= 1.0f)
@ -4295,8 +4305,9 @@ static void CG_Draw2D( void )
if ( (cg.snap->ps.forcePowersActive&(1<<FP_SEE)) )
{//force sight is on
//indicate this with sight cone thingy
cg.drawingHUD = CG_HUD_NORMAL;
CG_DrawPic( 35, 50, 570, 400, cgi_R_RegisterShader( "gfx/2d/jsense" ));
cg.drawingHUD = CG_HUD_OTHER;
CG_DrawVignette(true);
CG_DrawPic( 50, 40, 540, 400, cgi_R_RegisterShader( "gfx/2d/jsense" ));
cg.drawingHUD = CG_HUD_SCALED;
CG_DrawHealthBars();
}
@ -4306,10 +4317,50 @@ static void CG_Draw2D( void )
}
if (cg.zoomMode || (cg.snap->ps.forcePowersActive & (1 << FP_SEE)))
{
cg.drawingHUD = CG_HUD_NORMAL;
const auto xOffset = (-vr->off_center_fov_x * 640);
const auto yOffset = (vr->off_center_fov_y * 480);
vec4_t color = { 0, 0, 0, 1 };
if (cg.stereoView == STEREO_LEFT)
{
//Left Gap
CG_FillRect(0, 0, -xOffset, 480, color);
if (yOffset < 0)
{
//Bottom Gap
CG_FillRect(0, 0, 640, yOffset, color);
}
else
{
//Top Gap
CG_FillRect(0, 480 - yOffset, 640, yOffset, color);
}
}
else
{
//Right Gap
CG_FillRect(640 - xOffset, 0, xOffset, 480, color);
if (yOffset < 0)
{
//Bottom Gap
CG_FillRect(0, 0, 640, yOffset, color);
}
else
{
//Top Gap
CG_FillRect(0, 480 - yOffset, 640, yOffset, color);
}
}
}
// don't draw any status if dead
if ( cg.snap->ps.stats[STAT_HEALTH] > 0 )
{
CG_DrawVignette();
CG_DrawVignette(false);
if ( !(cent->gent && cent->gent->s.eFlags & (EF_LOCKED_TO_WEAPON )))//|EF_IN_ATST
{
@ -4345,7 +4396,10 @@ static void CG_Draw2D( void )
CG_UseIcon();
}
cg.drawingHUD = CG_HUD_NORMAL;
CG_SaberClashFlare();
cg.drawingHUD = CG_HUD_SCALED;
float y = 0;
if (cg_drawSnapshot.integer) {

View file

@ -297,6 +297,7 @@ typedef struct {
#define CG_HUD_NORMAL 0x00
#define CG_HUD_SCALED 0x01
#define CG_HUD_ZOOM 0x02
#define CG_HUD_OTHER 0x03
typedef struct {
//NOTE: these probably get cleared in save/load!!!

View file

@ -1446,10 +1446,27 @@ static void CG_RegisterGraphics( void ) {
cgi_R_RegisterShader( "gfx/misc/ion_shield" );
//VR Hand models
cgs.media.handModel_relaxed = cgi_R_RegisterModel( "models/players/kyle/lhand_r.md3" );
cgs.media.handModel_fist = cgi_R_RegisterModel( "models/players/kyle/lhand_force_fisting.md3" );
cgs.media.handModel_force = cgi_R_RegisterModel( "models/players/kyle/lhand_f.md3" );
cgs.media.handModel_hm_a_relaxed = cgi_R_RegisterModel( "models/players/jedi_hm/lhand_r_skin_a.md3" );
cgs.media.handModel_hm_a_fist = cgi_R_RegisterModel( "models/players/jedi_hm/lhand_force_fisting_skin_a.md3" );
cgs.media.handModel_hm_a_force = cgi_R_RegisterModel( "models/players/jedi_hm/lhand_f_skin_a.md3" );
cgs.media.handModel_hm_b_relaxed = cgi_R_RegisterModel( "models/players/jedi_hm/lhand_r_skin_b.md3" );
cgs.media.handModel_hm_b_fist = cgi_R_RegisterModel( "models/players/jedi_hm/lhand_force_fisting_skin_b.md3" );
cgs.media.handModel_hm_b_force = cgi_R_RegisterModel( "models/players/jedi_hm/lhand_f_skin_b.md3" );
cgs.media.handModel_kdm_relaxed = cgi_R_RegisterModel( "models/players/jedi_kdm/lhand_r.md3" );
cgs.media.handModel_kdm_fist = cgi_R_RegisterModel( "models/players/jedi_kdm/lhand_force_fisting.md3" );
cgs.media.handModel_kdm_force = cgi_R_RegisterModel( "models/players/jedi_kdm/lhand_f.md3" );
cgs.media.handModel_rm_relaxed = cgi_R_RegisterModel( "models/players/jedi_rm/lhand_r.md3" );
cgs.media.handModel_rm_fist = cgi_R_RegisterModel( "models/players/jedi_rm/lhand_force_fisting.md3" );
cgs.media.handModel_rm_force = cgi_R_RegisterModel( "models/players/jedi_rm/lhand_f.md3" );
cgs.media.handModel_hf_relaxed = cgi_R_RegisterModel( "models/players/jedi_hf/lhand_r.md3" );
cgs.media.handModel_hf_fist = cgi_R_RegisterModel( "models/players/jedi_hf/lhand_force_fisting.md3" );
cgs.media.handModel_hf_force = cgi_R_RegisterModel( "models/players/jedi_hf/lhand_f.md3" );
cgs.media.handModel_tf_relaxed = cgi_R_RegisterModel( "models/players/jedi_tf/lhand_r.md3" );
cgs.media.handModel_tf_fist = cgi_R_RegisterModel( "models/players/jedi_tf/lhand_force_fisting.md3" );
cgs.media.handModel_tf_force = cgi_R_RegisterModel( "models/players/jedi_tf/lhand_f.md3" );
cgs.media.handModel_zf_relaxed = cgi_R_RegisterModel( "models/players/jedi_zf/lhand_r.md3" );
cgs.media.handModel_zf_fist = cgi_R_RegisterModel( "models/players/jedi_zf/lhand_force_fisting.md3" );
cgs.media.handModel_zf_force = cgi_R_RegisterModel( "models/players/jedi_zf/lhand_f.md3" );
cgs.media.boltShader = cgi_R_RegisterShader( "gfx/misc/blueLine" );

View file

@ -189,6 +189,28 @@ typedef struct {
qhandle_t handModel_fist;
qhandle_t handModel_force;
qhandle_t handModel_hm_a_relaxed;
qhandle_t handModel_hm_a_fist;
qhandle_t handModel_hm_a_force;
qhandle_t handModel_hm_b_relaxed;
qhandle_t handModel_hm_b_fist;
qhandle_t handModel_hm_b_force;
qhandle_t handModel_kdm_relaxed;
qhandle_t handModel_kdm_fist;
qhandle_t handModel_kdm_force;
qhandle_t handModel_rm_relaxed;
qhandle_t handModel_rm_fist;
qhandle_t handModel_rm_force;
qhandle_t handModel_hf_relaxed;
qhandle_t handModel_hf_fist;
qhandle_t handModel_hf_force;
qhandle_t handModel_tf_relaxed;
qhandle_t handModel_tf_fist;
qhandle_t handModel_tf_force;
qhandle_t handModel_zf_relaxed;
qhandle_t handModel_zf_fist;
qhandle_t handModel_zf_force;
qhandle_t halfShieldModel;
qhandle_t solidWhiteShader;

View file

@ -368,6 +368,7 @@ static void CG_RegisterCustomSounds(clientInfo_t *ci, int iSoundEntryBase,
//SB: Never render any player model if 1st person and using the saber
bool CG_getPlayer1stPersonSaber(const centity_t *cent) {
return (!cent->gent->NPC && !cg.renderingThirdPerson &&
cent->gent->client->ps.clientNum == 0 &&
cent->gent->client->ps.weapon == WP_SABER);
}
@ -6507,12 +6508,15 @@ Ghoul2 Insert End
{
if ( !noMarks )
{
if (saberNum == 1 || !cent->gent->client->ps.saberInFlight)
if (CG_getPlayer1stPersonSaber(cent))
{
int position = (vr->right_handed ?
((saberNum == 0) ? 2 : 1) :
((saberNum == 0) ? 1 : 2));
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
if (saberNum == 1 || !cent->gent->client->ps.saberInFlight)
{
int position = (vr->right_handed ?
((saberNum == 0) ? 2 : 1) :
((saberNum == 0) ? 1 : 2));
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
}
}
/*
@ -6540,12 +6544,15 @@ Ghoul2 Insert End
{
if ( !noMarks )
{
if (saberNum == 1 || !cent->gent->client->ps.saberInFlight)
if (CG_getPlayer1stPersonSaber(cent))
{
int position = (vr->right_handed ?
((saberNum == 0) ? 2 : 1) :
((saberNum == 0) ? 1 : 2));
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
if (saberNum == 1 || !cent->gent->client->ps.saberInFlight)
{
int position = (vr->right_handed ?
((saberNum == 0) ? 2 : 1) :
((saberNum == 0) ? 1 : 2));
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
}
}
if ( ( !WP_SaberBladeUseSecondBladeStyle( &client->ps.saber[saberNum], bladeNum ) && !(client->ps.saber[saberNum].saberFlags2&SFL2_NO_WALL_MARKS) )
@ -7003,8 +7010,37 @@ void CG_Player( centity_t *cent ) {
vr->velocitytriggered = (!cg.renderingThirdPerson &&
(cg.snap->ps.weapon == WP_SABER || cg.snap->ps.weapon == WP_MELEE || cg.snap->ps.weapon == WP_STUN_BATON));
cvar_t *vr_motion_enable_saber = gi.cvar("vr_motion_enable_saber", "0", CVAR_ARCHIVE);
vr->velocitytriggeractive = (cg.snap->ps.weapon == WP_SABER && (g_entities[0].client->ps.SaberActive() || vr_motion_enable_saber->integer)) ||
cg.snap->ps.weapon == WP_MELEE || cg.snap->ps.weapon == WP_STUN_BATON;
switch (cg.snap->ps.weapon)
{
case WP_SABER:
{
gentity_t *saberent = &g_entities[cent->gent->client->ps.saberEntityNum];
if (g_entities[0].client->ps.SaberActive() || vr_motion_enable_saber->integer)
{
vr->velocitytriggeractive = true;
}
//Should we allow player to pull saber back with motion?
else if (cent->gent->client->ps.saberInFlight &&
saberent->s.pos.trType != TR_LINEAR)
{
vr->velocitytriggeractive = true;
}
else
{
vr->velocitytriggeractive = false;
}
break;
}
case WP_MELEE:
case WP_STUN_BATON:
vr->velocitytriggeractive = true;
break;
default:
vr->velocitytriggeractive = false;
break;
}
}
G_RagDoll(cent->gent, cent->lerpAngles);

View file

@ -2261,8 +2261,7 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) {
{
cg.refdef.viewangles[ROLL] = vr->hmdorientation[ROLL];
cg.refdef.viewangles[PITCH] = vr->weaponangles[ANGLES_ADJUSTED][PITCH];
cg.refdef.viewangles[YAW] = vr->clientviewangles[YAW]
+ vr->weaponangles[ANGLES_ADJUSTED][YAW] + SHORT2ANGLE(cg.snap->ps.delta_angles[YAW]);
cg.refdef.viewangles[YAW] = vr->clientviewangles[YAW] + SHORT2ANGLE(cg.snap->ps.delta_angles[YAW]);
AnglesToAxis(cg.refdef.viewangles, cg.refdef.viewaxis);
}
@ -2390,6 +2389,40 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) {
handEnt.renderfx = RF_DEPTHHACK | RF_VRVIEWMODEL;
char *char_model = cgi_Cvar_Get("g_char_model");
if ( strstr( "jedi_kdm", char_model ) != NULL ) {
cgs.media.handModel_relaxed = cgs.media.handModel_kdm_relaxed;
cgs.media.handModel_fist = cgs.media.handModel_kdm_fist;
cgs.media.handModel_force = cgs.media.handModel_kdm_force;
} else if ( strstr( "jedi_rm", char_model ) != NULL ) {
cgs.media.handModel_relaxed = cgs.media.handModel_rm_relaxed;
cgs.media.handModel_fist = cgs.media.handModel_rm_fist;
cgs.media.handModel_force = cgs.media.handModel_rm_force;
} else if ( strstr( "jedi_hf", char_model ) != NULL ) {
cgs.media.handModel_relaxed = cgs.media.handModel_hf_relaxed;
cgs.media.handModel_fist = cgs.media.handModel_hf_fist;
cgs.media.handModel_force = cgs.media.handModel_hf_force;
} else if ( strstr( "jedi_tf", char_model ) != NULL ) {
cgs.media.handModel_relaxed = cgs.media.handModel_tf_relaxed;
cgs.media.handModel_fist = cgs.media.handModel_tf_fist;
cgs.media.handModel_force = cgs.media.handModel_tf_force;
} else if ( strstr( "jedi_zf", char_model ) != NULL ) {
cgs.media.handModel_relaxed = cgs.media.handModel_zf_relaxed;
cgs.media.handModel_fist = cgs.media.handModel_zf_fist;
cgs.media.handModel_force = cgs.media.handModel_zf_force;
} else {
char *char_skin_head = cgi_Cvar_Get("g_char_skin_head");
if ( strstr( "head_a1", char_skin_head ) != NULL ) {
cgs.media.handModel_relaxed = cgs.media.handModel_hm_b_relaxed;
cgs.media.handModel_fist = cgs.media.handModel_hm_b_fist;
cgs.media.handModel_force = cgs.media.handModel_hm_b_force;
} else {
cgs.media.handModel_relaxed = cgs.media.handModel_hm_a_relaxed;
cgs.media.handModel_fist = cgs.media.handModel_hm_a_fist;
cgs.media.handModel_force = cgs.media.handModel_hm_a_force;
}
}
if (!g_entities[cg.snap->ps.viewEntity].client->ps.dualSabers ||
cg.snap->ps.weapon != WP_SABER)
{

View file

@ -2952,7 +2952,7 @@ void CG_ItemSelectorSelect_f( void )
cg.forcepowerSelectTime = cg.time;
cg.forcepowerSelect = cg.itemSelectorSelection;
}
else if (cg.itemSelectorType == ST_QUICK_SAVE) {
else if (cg.itemSelectorType == ST_QUICK_MENU) {
if (cg.itemSelectorSelection == 0) {
cgi_SendConsoleCommand("save quick\n");
CG_CenterPrint("Quick Saved", 240);
@ -2969,7 +2969,7 @@ void CG_ItemSelectorNext_f( void )
{
if (cg.itemSelectorType >= ST_FORCE_POWER)
{
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_SAVE : ST_FORCE_POWER;
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_MENU : ST_FORCE_POWER;
return;
}
@ -2986,7 +2986,7 @@ void CG_ItemSelectorPrev_f( void )
{
if (cg.itemSelectorType >= ST_FORCE_POWER)
{
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_SAVE : ST_FORCE_POWER;
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_MENU : ST_FORCE_POWER;
return;
}
@ -3120,7 +3120,7 @@ void CG_DrawItemSelector( void )
sRGB[1] = 0.0f;
sRGB[2] = 1.0f;
break;
case ST_QUICK_SAVE:
case ST_QUICK_MENU:
count = 2;
sRGB[0] = 1.0f;
sRGB[1] = 1.0f;
@ -3252,7 +3252,7 @@ void CG_DrawItemSelector( void )
case ST_FORCE_POWER: // force powers
selectable = ForcePower_Valid(itemId);
break;
case ST_QUICK_SAVE:
case ST_QUICK_MENU:
selectable = true;
break;
}
@ -3339,7 +3339,7 @@ void CG_DrawItemSelector( void )
case ST_FORCE_POWER: // force powers
sprite.customShader = force_icons[showPowers[itemId]];
break;
case ST_QUICK_SAVE:
case ST_QUICK_MENU:
sprite.customShader = itemId == 0 ? cgs.media.iconSave : cgs.media.iconLoad;
break;
}
@ -3488,7 +3488,7 @@ void CG_FireWeapon( centity_t *cent, qboolean alt_fire )
}
//Are we the player?
if (cent->gent->client->ps.clientNum == 0)
if (cent->gent->client && cent->gent->client->ps.clientNum == 0)
{
/*
These are specific to external haptics vest/arms/face combinations
@ -3555,6 +3555,7 @@ void CG_FireWeapon( centity_t *cent, qboolean alt_fire )
break;
case WP_DEMP2:
case WP_EMPLACED_GUN:
case WP_CONCUSSION:
cgi_HapticEvent("bfg_fire", position, 0, 100, 0, 0);
break;
}

View file

@ -31,14 +31,14 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "snd_public.h"
#include "../mp3code/mp3struct.h"
#if defined(_MSC_VER) && !defined(WIN64)
#if defined(_MSC_VER)
#define USE_OPENAL
#endif
// Open AL Specific
#ifdef USE_OPENAL
#include "AL/al.h"
#include "AL/alc.h"
#include "al.h"
#include "alc.h"
#include "eax/eax.h"
#include "eax/EaxMan.h"
/*#elif defined MACOS_X

View file

@ -217,7 +217,7 @@ qboolean G_ParseLiteral( const char **data, const char *string )
//
// NPC parameters file : ext_data/NPCs/*.npc*
//
#define MAX_NPC_DATA_SIZE 0x80000
#define MAX_NPC_DATA_SIZE 0x400000
char NPCParms[MAX_NPC_DATA_SIZE];
/*
@ -4084,7 +4084,7 @@ void NPC_LoadParms( void )
{
int len, totallen, npcExtFNLen, fileCnt, i;
char *buffer, *holdChar, *marker;
char npcExtensionListBuf[2048]; // The list of file names read in
char npcExtensionListBuf[4096]; // The list of file names read in
//gi.Printf( "Parsing ext_data/npcs/*.npc definitions\n" );

View file

@ -725,7 +725,7 @@ float getHMDYawForCalc()
return vr->hmdorientation[YAW];
}
return 0.0f;
return vr->weaponangles[ANGLES_ADJUSTED][YAW];
}
void BG_ConvertFromVR(vec3_t in, vec3_t offset, vec3_t out)
@ -804,8 +804,10 @@ void BG_CalculateVRSaberPosition( int saberNum, vec3_t origin, vec3_t angles )
//Move position down a bit
vec3_t axis[3];
AnglesToAxis(angles, axis);
//The "forward" axis will be adjusted
//Small adjustments to make saber align better
VectorMA(origin, -3.0f, axis[0], origin);
VectorMA(origin, -0.5f, axis[1], origin);
VectorMA(origin, 1.2f, axis[2], origin);
}
bool BG_UseVRPosition( gentity_t *ent )

View file

@ -14586,10 +14586,7 @@ void PM_AdjustAttackStates( pmove_t *pm )
}
else if ( cg.zoomMode == 2 )
{
G_SoundOnEnt( pm->gent, CHAN_AUTO, "sound/weapons/disruptor/zoomend.wav" );
// already zooming, so must be wanting to turn it off
cg.zoomMode = 0;
cg.zoomTime = cg.time;
G_SoundOnEnt( pm->gent, CHAN_AUTO, "sound/weapons/disruptor/zoomstart.wav" );
cg.zoomLocked = qfalse;
}
}

View file

@ -4970,12 +4970,13 @@ extern cvar_t *g_skippingcin;
// ucmd->angles[PITCH] = 0;
// }
if ( cg.zoomMode == 2 )
//Allow movement when zoomed
/* if (cg.zoomMode == 2)
{
// Any kind of movement when the player is NOT ducked when the disruptor gun is zoomed will cause us to auto-magically un-zoom
if ( ( (ucmd->forwardmove||ucmd->rightmove)
&& ucmd->upmove >= 0 //crouching-moving is ok
&& !(ucmd->buttons&BUTTON_USE)/*leaning is ok*/
&& !(ucmd->buttons&BUTTON_USE)//leaning is ok
)
|| ucmd->upmove > 0 //jumping not allowed
)
@ -4986,7 +4987,8 @@ extern cvar_t *g_skippingcin;
cg.zoomTime = cg.time;
cg.zoomLocked = qfalse;
}
}
}*/
if ( (player_locked
|| (ent->client->ps.eFlags&EF_FORCE_GRIPPED)

View file

@ -903,7 +903,7 @@ qboolean G_StandardHumanoid( gentity_t *self )
return qfalse;
}
const char *GLAName = gi.G2API_GetGLAName( &self->ghoul2[self->playerModel] );
assert(GLAName);
//assert(GLAName);
if (GLAName)
{
if ( !Q_stricmpn( "models/players/_humanoid", GLAName, 24 ) )///_humanoid", GLAName, 36) )

View file

@ -175,7 +175,7 @@ void G_Give( gentity_t *ent, const char *name, const char *args, int argc )
if ( give_all || !Q_stricmp( name, "health") )
{
if ( argc == 3 )
ent->health = Com_Clampi( 1, ent->client->ps.stats[STAT_MAX_HEALTH], atoi( args ) );
ent->health = Com_Clampi( 1, 999, atoi( args ) );
else
ent->health = ent->client->ps.stats[STAT_MAX_HEALTH];
if ( !give_all )
@ -489,6 +489,32 @@ void Cmd_Undying_f (gentity_t *ent)
gi.SendServerCommand( ent-g_entities, "print \"%s\"", msg);
}
/*
==================
Cmd_UnlimitedPower_f
Grants unlimited power to client
argv(0) unlimitedpower
==================
*/
void Cmd_UnlimitedPower_f (gentity_t *ent)
{
const char *msg;
if ( !CheatsOk( ent ) ) {
return;
}
ent->flags ^= FL_UNLIMITEDPOWERMODE;
if (!(ent->flags & FL_UNLIMITEDPOWERMODE) )
msg = "unlimited power mode OFF\n";
else
msg = "unlimited power mode ON\n";
gi.SendServerCommand( ent-g_entities, "print \"%s\"", msg);
}
/*
==================
Cmd_Notarget_f
@ -1388,6 +1414,8 @@ void ClientCommand( int clientNum ) {
Cmd_God_f (ent);
else if (Q_stricmp (cmd, "undying") == 0)
Cmd_Undying_f (ent);
else if (Q_stricmp (cmd, "unlimitedpower") == 0)
Cmd_UnlimitedPower_f (ent);
else if (Q_stricmp (cmd, "notarget") == 0)
Cmd_Notarget_f (ent);
else if (Q_stricmp (cmd, "noclip") == 0)

View file

@ -75,7 +75,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#define FL_OVERCHARGED_HEALTH 0x00100000 // Reduce health back to max
#define FL_NO_ANGLES 0x00200000 // No bone angle overrides, no pitch or roll in full angles
#define FL_RED_CROSSHAIR 0x00400000 // Crosshair red on me
#define FL_UNLIMITEDPOWERMODE 0x10000000 // Unlimited power mode
//Pointer safety utilities
#define VALID( a ) ( a != NULL )

View file

@ -1452,7 +1452,7 @@ static inline qboolean G_RagWantsHumanoidsOnly( CGhoul2Info *ghlInfo )
{
char *GLAName;
GLAName = gi.G2API_GetGLAName( ghlInfo );
assert(GLAName);
//assert(GLAName);
if ( !Q_stricmp( "models/players/_humanoid/_humanoid", GLAName ) )
{//only _humanoid skeleton is expected to have these

View file

@ -9262,11 +9262,13 @@ void ForceThrowEx( gentity_t *self, qboolean pull, qboolean fake, qboolean aimBy
if ( pull )
{
cone = forcePullCone[self->client->ps.forcePowerLevel[FP_PULL]];
cone = forcePullCone[self->client->ps.forcePowerLevel[FP_PULL]] -
((aimByViewAngles != 0) ? 0.05f : 0.0f);
}
else
{
cone = forcePushCone[self->client->ps.forcePowerLevel[FP_PUSH]];
cone = forcePushCone[self->client->ps.forcePowerLevel[FP_PUSH]] -
((aimByViewAngles != 0) ? 0.05f : 0.0f);
}
// if ( cone >= 1.0f )
@ -12904,6 +12906,9 @@ void WP_ForcePowerDrain( gentity_t *self, forcePowers_t forcePower, int override
{//For now, NPCs have infinite force power
return;
}
if ( self->flags & FL_UNLIMITEDPOWERMODE) {
return;
}
//take away the power
int drain = overrideAmt;
if ( !drain )
@ -14724,24 +14729,24 @@ void WP_InitForcePowers( gentity_t *ent )
else
{
ent->client->ps.forcePowersKnown = ( 1 << FP_HEAL )|( 1 << FP_LEVITATION )|( 1 << FP_SPEED )|( 1 << FP_PUSH )|( 1 << FP_PULL )|( 1 << FP_TELEPATHY )|( 1 << FP_GRIP )|( 1 << FP_LIGHTNING)|( 1 << FP_SABERTHROW)|( 1 << FP_SABER_DEFENSE )|( 1 << FP_SABER_OFFENSE )|( 1<< FP_RAGE )|( 1<< FP_DRAIN )|( 1<< FP_PROTECT )|( 1<< FP_ABSORB )|( 1<< FP_SEE );
ent->client->ps.forcePowerLevel[FP_HEAL] = FORCE_LEVEL_2;
ent->client->ps.forcePowerLevel[FP_LEVITATION] = FORCE_LEVEL_2;
ent->client->ps.forcePowerLevel[FP_PUSH] = FORCE_LEVEL_1;
ent->client->ps.forcePowerLevel[FP_PULL] = FORCE_LEVEL_1;
ent->client->ps.forcePowerLevel[FP_HEAL] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_LEVITATION] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_PUSH] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_PULL] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_SABERTHROW] = FORCE_LEVEL_2;
ent->client->ps.forcePowerLevel[FP_SPEED] = FORCE_LEVEL_2;
ent->client->ps.forcePowerLevel[FP_LIGHTNING] = FORCE_LEVEL_1;
ent->client->ps.forcePowerLevel[FP_TELEPATHY] = FORCE_LEVEL_2;
ent->client->ps.forcePowerLevel[FP_SPEED] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_LIGHTNING] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_TELEPATHY] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_RAGE] = FORCE_LEVEL_1;
ent->client->ps.forcePowerLevel[FP_PROTECT] = FORCE_LEVEL_1;
ent->client->ps.forcePowerLevel[FP_ABSORB] = FORCE_LEVEL_1;
ent->client->ps.forcePowerLevel[FP_DRAIN] = FORCE_LEVEL_1;
ent->client->ps.forcePowerLevel[FP_SEE] = FORCE_LEVEL_1;
ent->client->ps.forcePowerLevel[FP_RAGE] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_PROTECT] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_ABSORB] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_DRAIN] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_SEE] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_SABER_DEFENSE] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_SABER_OFFENSE] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_GRIP] = FORCE_LEVEL_2;
ent->client->ps.forcePowerLevel[FP_GRIP] = FORCE_LEVEL_3;
}
}
}

View file

@ -1371,7 +1371,7 @@ void Com_Frame( void ) {
TBXR_FrameSetup();
// write config file if anything changed
Com_WriteConfiguration();
//Com_WriteConfiguration();
//
// main event loop
@ -1571,6 +1571,10 @@ Com_Shutdown
=================
*/
void Com_Shutdown (void) {
// write config file if anything changed
Com_WriteConfiguration();
CM_ClearMap();
if (logfile) {

View file

@ -68,7 +68,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#if JK2_MODE
#define PRODUCT_NAME "openjo_sp"
#define CLIENT_WINDOW_TITLE "OpenJO (SP)"
#define CLIENT_WINDOW_TITLE "JKXR Jedi Outcast"
#define CLIENT_CONSOLE_TITLE "OpenJO Console (SP)"
#define HOMEPATH_NAME_UNIX "openjo"
#define HOMEPATH_NAME_WIN "OpenJO"
@ -76,7 +76,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#else
#define PRODUCT_NAME "openjk_sp"
#define CLIENT_WINDOW_TITLE "OpenJK (SP)"
#define CLIENT_WINDOW_TITLE "JKXR Jedi Academy"
#define CLIENT_CONSOLE_TITLE "OpenJK Console (SP)"
#define HOMEPATH_NAME_UNIX "openjk"
#define HOMEPATH_NAME_WIN "OpenJK"
@ -769,7 +769,7 @@ typedef enum
ST_GADGET,
ST_FIGHTING_STYLE,
ST_FORCE_POWER,
ST_QUICK_SAVE
ST_QUICK_MENU
} selectorType_t;
typedef enum

View file

@ -66,6 +66,25 @@ void *MSG_GetSpace (msg_t *buf, int length);
void MSG_WriteData (msg_t *buf, const void *data, int length);
typedef enum
{
DR_YES = 0,
DR_NO = 1,
DR_OK = 0,
DR_CANCEL = 1
} dialogResult_t;
typedef enum
{
DT_INFO,
DT_WARNING,
DT_ERROR,
DT_YES_NO,
DT_OK_CANCEL
} dialogType_t;
dialogResult_t Sys_Dialog(dialogType_t type, const char* message, const char* title);
struct usercmd_s;
struct entityState_s;

View file

@ -23,7 +23,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
// Current version of the single player game
#include "../win32/AutoVersion.h"
#define JKXR_VERSION "1.1.16-ea"
#define JKXR_VERSION "1.1.28"
#ifdef _DEBUG
#define Q3_VERSION "(debug)OpenJK: v" VERSION_STRING_DOTTED " JKXR: " JKXR_VERSION

View file

@ -127,7 +127,7 @@ void GL_SelectTexture( int unit )
** GL_Cull
*/
void GL_Cull( int cullType ) {
if ( glState.faceCulling == cullType ) {
if ( glState.faceCulling == cullType && !backEnd.overrideCullFace ) {
return;
}
glState.faceCulling = cullType;
@ -135,9 +135,10 @@ void GL_Cull( int cullType ) {
return;
}
if ( cullType == CT_TWO_SIDED )
if ( cullType == CT_TWO_SIDED || backEnd.overrideCullFace )
{
qglDisable( GL_CULL_FACE );
glState.faceCulling = CT_TWO_SIDED;
}
else
{
@ -654,7 +655,6 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
int entityNum, oldEntityNum;
int dlighted, oldDlighted;
int depthRange, oldDepthRange;
int isVRViewModel, oldIsVRViewModel;
int i;
drawSurf_t *drawSurf;
unsigned int oldSort;
@ -680,14 +680,11 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
oldShader = NULL;
oldFogNum = -1;
oldDepthRange = qfalse;
isVRViewModel = qfalse;
oldIsVRViewModel = qfalse;
oldDlighted = qfalse;
oldSort = (unsigned int) -1;
depthRange = qfalse;
GLint oldFaceCullMode;
GLboolean oldFaceCullEnabled;
backEnd.overrideCullFace = qfalse;
backEnd.pc.c_surfaces += numDrawSurfs;
@ -764,6 +761,10 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
}
}
if (backEnd.currentEntity->e.renderfx & RF_VRVIEWMODEL) {
backEnd.overrideCullFace = qtrue;
}
if (shader != oldShader || fogNum != oldFogNum || dlighted != oldDlighted
|| ( entityNum != oldEntityNum && !shader->entityMergable ) )
{
@ -780,6 +781,7 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
oldShader = shader;
oldFogNum = fogNum;
oldDlighted = dlighted;
backEnd.overrideCullFace = qfalse;
}
//
@ -787,7 +789,6 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
//
if ( entityNum != oldEntityNum ) {
depthRange = qfalse;
isVRViewModel = qfalse;
if ( entityNum != REFENTITYNUM_WORLD ) {
backEnd.currentEntity = &backEnd.refdef.entities[entityNum];
@ -809,10 +810,6 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
// hack the depth range to prevent view model from poking into walls
depthRange = qtrue;
}
if (backEnd.currentEntity->e.renderfx & RF_VRVIEWMODEL) {
isVRViewModel = qtrue;
}
} else {
backEnd.currentEntity = &tr.worldEntity;
backEnd.refdef.floatTime = originalTime;
@ -844,25 +841,6 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
oldDepthRange = depthRange;
}
if (isVRViewModel != oldIsVRViewModel) {
if (isVRViewModel) {
qglGetBooleanv(GL_CULL_FACE, &oldFaceCullEnabled);
qglGetIntegerv(GL_CULL_FACE_MODE, &oldFaceCullMode);
//Draw all faces on weapons
qglDisable(GL_CULL_FACE);
} else{
if (!oldFaceCullEnabled)
{
qglDisable(GL_CULL_FACE);
} else{
qglEnable(GL_CULL_FACE);
}
qglCullFace( oldFaceCullMode );
}
oldIsVRViewModel = isVRViewModel;
}
oldEntityNum = entityNum;
}

View file

@ -1613,7 +1613,7 @@ void R_Register( void )
//
// archived variables that can change at any time
//
r_lodCurveError = ri.Cvar_Get( "r_lodCurveError", "1000", CVAR_ARCHIVE_ND );
r_lodCurveError = ri.Cvar_Get( "r_lodCurveError", "250", CVAR_ARCHIVE_ND );
r_lodbias = ri.Cvar_Get( "r_lodbias", "-2", CVAR_ARCHIVE_ND );
#ifndef JK2_MODE
r_flares = ri.Cvar_Get ("r_flares", "0", CVAR_ARCHIVE_ND );

View file

@ -941,6 +941,7 @@ typedef struct {
orientationr_t ori;
backEndCounters_t pc;
qboolean isHyperspace;
qboolean overrideCullFace; //If true then forcibly set face drawing to both sides - used for VR weapon/hand models
trRefEntity_t *currentEntity;
qboolean skyRenderedThisView; // flag for drawing sun

View file

@ -127,7 +127,7 @@ void GL_SelectTexture( int unit )
** GL_Cull
*/
void GL_Cull( int cullType ) {
if ( glState.faceCulling == cullType ) {
if ( glState.faceCulling == cullType && !backEnd.overrideCullFace) {
return;
}
glState.faceCulling = cullType;
@ -135,9 +135,10 @@ void GL_Cull( int cullType ) {
return;
}
if ( cullType == CT_TWO_SIDED )
if ( cullType == CT_TWO_SIDED || backEnd.overrideCullFace)
{
qglDisable( GL_CULL_FACE );
glState.faceCulling = CT_TWO_SIDED;
}
else
{
@ -648,7 +649,6 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
int entityNum, oldEntityNum;
int dlighted, oldDlighted;
int depthRange, oldDepthRange;
int isVRViewModel, oldIsVRViewModel;
int i;
drawSurf_t *drawSurf;
unsigned int oldSort;
@ -674,14 +674,11 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
oldShader = NULL;
oldFogNum = -1;
oldDepthRange = qfalse;
isVRViewModel = qfalse;
oldIsVRViewModel = qfalse;
oldDlighted = qfalse;
oldSort = (unsigned int) -1;
depthRange = qfalse;
GLint oldFaceCullMode;
GLboolean oldFaceCullEnabled;
backEnd.overrideCullFace = qfalse;
backEnd.pc.c_surfaces += numDrawSurfs;
@ -758,6 +755,10 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
}
}
if (backEnd.currentEntity->e.renderfx & RF_VRVIEWMODEL) {
backEnd.overrideCullFace = qtrue;
}
if (shader != oldShader || fogNum != oldFogNum || dlighted != oldDlighted
|| ( entityNum != oldEntityNum && !shader->entityMergable ) )
{
@ -774,6 +775,7 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
oldShader = shader;
oldFogNum = fogNum;
oldDlighted = dlighted;
backEnd.overrideCullFace = qfalse;
}
//
@ -781,7 +783,6 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
//
if ( entityNum != oldEntityNum ) {
depthRange = qfalse;
isVRViewModel = qfalse;
if ( entityNum != REFENTITYNUM_WORLD ) {
backEnd.currentEntity = &backEnd.refdef.entities[entityNum];
@ -803,10 +804,6 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
// hack the depth range to prevent view model from poking into walls
depthRange = qtrue;
}
if (backEnd.currentEntity->e.renderfx & RF_VRVIEWMODEL) {
isVRViewModel = qtrue;
}
} else {
backEnd.currentEntity = &tr.worldEntity;
backEnd.refdef.floatTime = originalTime;
@ -838,25 +835,6 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
oldDepthRange = depthRange;
}
if (isVRViewModel != oldIsVRViewModel) {
if (isVRViewModel) {
qglGetBooleanv(GL_CULL_FACE, &oldFaceCullEnabled);
qglGetIntegerv(GL_CULL_FACE_MODE, &oldFaceCullMode);
//Draw all faces on weapons
qglDisable(GL_CULL_FACE);
} else{
if (!oldFaceCullEnabled)
{
qglDisable(GL_CULL_FACE);
} else{
qglEnable(GL_CULL_FACE);
}
qglCullFace( oldFaceCullMode );
}
oldIsVRViewModel = isVRViewModel;
}
oldEntityNum = entityNum;
}

View file

@ -1540,7 +1540,7 @@ void R_Register( void )
r_mapOverBrightBits = ri.Cvar_Get( "r_mapOverBrightBits", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
r_simpleMipMaps = ri.Cvar_Get( "r_simpleMipMaps", "1", CVAR_ARCHIVE_ND | CVAR_LATCH );
r_vertexLight = ri.Cvar_Get( "r_vertexLight", "0", CVAR_ARCHIVE | CVAR_LATCH );
r_subdivisions = ri.Cvar_Get ("r_subdivisions", "4", CVAR_ARCHIVE_ND | CVAR_LATCH);
r_subdivisions = ri.Cvar_Get ("r_subdivisions", "0", CVAR_ARCHIVE_ND | CVAR_LATCH);
ri.Cvar_CheckRange( r_subdivisions, 0, 80, qfalse );
r_intensity = ri.Cvar_Get ("r_intensity", "1.07", CVAR_LATCH|CVAR_ARCHIVE );
@ -1553,7 +1553,7 @@ void R_Register( void )
//
// archived variables that can change at any time
//
r_lodCurveError = ri.Cvar_Get( "r_lodCurveError", "250", CVAR_ARCHIVE_ND );
r_lodCurveError = ri.Cvar_Get( "r_lodCurveError", "1000", CVAR_ARCHIVE_ND );
r_lodbias = ri.Cvar_Get( "r_lodbias", "-2", CVAR_ARCHIVE_ND );
r_flares = ri.Cvar_Get ("r_flares", "1", CVAR_ARCHIVE_ND );
r_lodscale = ri.Cvar_Get( "r_lodscale", "10", CVAR_ARCHIVE_ND );

View file

@ -936,6 +936,7 @@ typedef struct {
orientationr_t ori;
backEndCounters_t pc;
qboolean isHyperspace;
qboolean overrideCullFace; //If true then forcibly set face drawing to both sides - used for VR weapon/hand models
trRefEntity_t *currentEntity;
qboolean skyRenderedThisView; // flag for drawing sun

View file

@ -2069,7 +2069,7 @@ void RB_StageIteratorGeneric( void )
//
// set face culling appropriately
//
GL_Cull( input->shader->cullType );
GL_Cull(input->shader->cullType);
// set polygon offset if necessary
if ( input->shader->polygonOffset )

View file

@ -311,7 +311,8 @@ void SV_SpawnServer( const char *server, ForceReload_e eForceReload, qboolean bA
SV_InitGameProgs();
// run a few frames to allow everything to settle
for ( i = 0 ;i < 3 ; i++ ) {
cvar_t *frameDelay = Cvar_Get("s_spawnFrameDelay", "4", CVAR_TEMP);
for ( i = 0 ;i < frameDelay->integer ; i++ ) {
ge->RunFrame( sv.time );
sv.time += 100;
re.G2API_SetTime(sv.time,G2T_SV_TIME);

View file

@ -114,6 +114,7 @@ static void UI_GetSaberCvars ( void );
static void UI_ResetSaberCvars ( void );
static void UI_InitAllocForcePowers ( const char *forceName );
static void UI_AffectForcePowerLevel ( const char *forceName );
static void UI_RotateForcePowerLevel ( const char *forceName );
static void UI_ShowForceLevelDesc ( const char *forceName );
static void UI_ResetForceLevels ( void );
static void UI_ClearWeapons ( void );
@ -1289,6 +1290,13 @@ static qboolean UI_RunMenuScript ( const char **args )
UI_AffectForcePowerLevel(forceName);
}
else if (Q_stricmp(name, "rotateforcepowerlevel") == 0)
{
const char *forceName;
String_Parse(args, &forceName);
UI_RotateForcePowerLevel(forceName);
}
else if (Q_stricmp(name, "decrementcurrentforcepower") == 0)
{
UI_DecrementCurrentForcePower();
@ -4333,7 +4341,8 @@ void UI_UpdateVideoSetup ( void )
// Cvar_Set ( "cg_shadows", Cvar_VariableString ( "ui_cg_shadows" ) );
Cvar_Set ( "ui_r_modified", "0" );
Cbuf_ExecuteText( EXEC_APPEND, "vid_restart;" );
//Don't do this - expect user to restart themselves
//Cbuf_ExecuteText( EXEC_APPEND, "vid_restart;" );
}
/*
@ -4769,6 +4778,38 @@ static void UI_ForcePowerWeaponsButton(qboolean activeFlag)
if(trap_Cvar_VariableValue("helpUsObi") != 0)
activeFlag = qtrue;
if (!activeFlag) {
// If updatable force powers are maxed, let us pass
int *forcePowerLevel;
short forcePowerIndex = 0;
client_t* cl = &svs.clients[0];
if (cl) {
playerState_t* pState = cl->gentity->client;
forcePowerLevel = pState->forcePowerLevel;
} else {
forcePowerLevel = uiInfo.forcePowerLevel;
}
qboolean allForcesMaxed = qtrue;
if (UI_GetForcePowerIndex ( "absorb", &forcePowerIndex ) && forcePowerLevel[powerEnums[forcePowerIndex].powerEnum] < 3 ) {
allForcesMaxed = qfalse;
} else if (UI_GetForcePowerIndex ( "heal", &forcePowerIndex ) && forcePowerLevel[powerEnums[forcePowerIndex].powerEnum] < 3 ) {
allForcesMaxed = qfalse;
} else if (UI_GetForcePowerIndex ( "mindtrick", &forcePowerIndex ) && forcePowerLevel[powerEnums[forcePowerIndex].powerEnum] < 3 ) {
allForcesMaxed = qfalse;
} else if (UI_GetForcePowerIndex ( "protect", &forcePowerIndex ) && forcePowerLevel[powerEnums[forcePowerIndex].powerEnum] < 3 ) {
allForcesMaxed = qfalse;
} else if (UI_GetForcePowerIndex ( "drain", &forcePowerIndex ) && forcePowerLevel[powerEnums[forcePowerIndex].powerEnum] < 3 ) {
allForcesMaxed = qfalse;
} else if (UI_GetForcePowerIndex ( "grip", &forcePowerIndex ) && forcePowerLevel[powerEnums[forcePowerIndex].powerEnum] < 3 ) {
allForcesMaxed = qfalse;
} else if (UI_GetForcePowerIndex ( "lightning", &forcePowerIndex ) && forcePowerLevel[powerEnums[forcePowerIndex].powerEnum] < 3 ) {
allForcesMaxed = qfalse;
} else if (UI_GetForcePowerIndex ( "rage", &forcePowerIndex ) && forcePowerLevel[powerEnums[forcePowerIndex].powerEnum] < 3 ) {
allForcesMaxed = qfalse;
}
activeFlag = allForcesMaxed;
}
// Find weaponsbutton
itemDef_t *item;
item = (itemDef_s *) Menu_FindItemByName(menu, "weaponbutton");
@ -5298,6 +5339,64 @@ static void UI_AffectForcePowerLevel ( const char *forceName )
}
static void UI_RotateForcePowerLevel ( const char *forceName )
{
short forcePowerI=0,i;
menuDef_t *menu;
itemDef_t *item;
menu = Menu_GetFocused(); // Get current menu
if (!menu)
{
return;
}
if (!UI_GetForcePowerIndex ( forceName, &forcePowerI ))
{
return;
}
// Get player state
client_t* cl = &svs.clients[0]; // 0 because only ever us as a player
playerState_t* pState = NULL;
int forcelevel;
if( cl )
{
pState = cl->gentity->client;
forcelevel = pState->forcePowerLevel[powerEnums[forcePowerI].powerEnum];
}
else
{
forcelevel = uiInfo.forcePowerLevel[powerEnums[forcePowerI].powerEnum];
}
if (forcelevel < 3) {
forcelevel++;
} else {
forcelevel = 0;
}
// Increment power level.
DC->startLocalSound(uiInfo.uiDC.Assets.forceChosenSound, CHAN_AUTO );
uiInfo.forcePowerUpdated = forcePowerI; // Remember which power was updated
if( pState )
{
pState->forcePowerLevel[powerEnums[forcePowerI].powerEnum] = forcelevel;
pState->forcePowersKnown |= ( 1 << powerEnums[forcePowerI].powerEnum );
forcelevel = pState->forcePowerLevel[powerEnums[forcePowerI].powerEnum];
}
else
{
uiInfo.forcePowerLevel[powerEnums[forcePowerI].powerEnum] = forcelevel;
forcelevel = uiInfo.forcePowerLevel[powerEnums[forcePowerI].powerEnum];
}
UI_SetHexPicLevel( menu, uiInfo.forcePowerUpdated,forcelevel, qfalse );
}
static void UI_DecrementForcePowerLevel( void )
{
int forcePowerI = Cvar_VariableIntegerValue( "ui_forcepower_inc" );

View file

@ -310,7 +310,8 @@ static const char *gcmds[] = {
"use_lightamp_goggles",
"use_seeker",
"use_sentry",
"viewobjective"
"viewobjective",
"unlimitedpower"
};
static const size_t numgcmds = ARRAY_LEN( gcmds );

View file

@ -725,37 +725,38 @@ CG_DrawWeapReticle
*/
static void CG_DrawWeapReticle( void )
{
vec4_t light_color = {0.7, 0.7, 0.7, 1};
vec4_t black = {0.0, 0.0, 0.0, 1};
vec4_t light_color = {0.7, 0.7, 0.7, 1};
vec4_t black = {0.0, 0.0, 0.0, 1};
float indent = 0.16;
float X_WIDTH=640;
float Y_HEIGHT=480;
float indent = 0.12;
float X_WIDTH=640;
float Y_HEIGHT=480;
float STRETCH = 6;
float x = (X_WIDTH * indent), y = (Y_HEIGHT * indent), w = (X_WIDTH * (1-(2*indent))) / 2.0f, h = (Y_HEIGHT * (1-(2*indent))) / 2;
float x = (X_WIDTH * indent), y = (Y_HEIGHT * indent), w = (X_WIDTH * (1-(2*indent))) / 2.0f, h = (Y_HEIGHT * (1-(2*indent))) / 2;
// sides
CG_FillRect( 0, 0, (X_WIDTH * indent), Y_HEIGHT, black );
CG_FillRect( X_WIDTH * (1 - indent), 0, (X_WIDTH * indent), Y_HEIGHT, black );
// top/bottom
CG_FillRect( X_WIDTH * indent, 0, X_WIDTH * (1-indent), Y_HEIGHT * indent, black );
CG_FillRect( X_WIDTH * indent, Y_HEIGHT * (1-indent), X_WIDTH * (1-indent), Y_HEIGHT * indent, black );
{
// center
if ( cgs.media.reticleShader ) {
cgi_R_DrawStretchPic( x - STRETCH, y - STRETCH, w + STRETCH, h+STRETCH, 0, 0, 1, 1, cgs.media.reticleShader ); // tl
cgi_R_DrawStretchPic( x + w, y - STRETCH, w + STRETCH, h + STRETCH, 1, 0, 0, 1, cgs.media.reticleShader ); // tr
cgi_R_DrawStretchPic( x - STRETCH, y + h, w + STRETCH, h + STRETCH, 0, 1, 1, 0, cgs.media.reticleShader ); // bl
cgi_R_DrawStretchPic( x + w, y + h, w + STRETCH, h + STRETCH, 1, 1, 0, 0, cgs.media.reticleShader ); // br
}
{
// center
if ( cgs.media.reticleShader ) {
cgi_R_DrawStretchPic( x, y, w, h, 0, 0, 1, 1, cgs.media.reticleShader ); // tl
cgi_R_DrawStretchPic( x + w, y, w, h, 1, 0, 0, 1, cgs.media.reticleShader ); // tr
cgi_R_DrawStretchPic( x, y + h, w, h, 0, 1, 1, 0, cgs.media.reticleShader ); // bl
cgi_R_DrawStretchPic( x + w, y + h, w, h, 1, 1, 0, 0, cgs.media.reticleShader ); // br
}
// hairs
CG_FillRect( 84, 239, 177, 2, black ); // left
CG_FillRect( 320, 242, 1, 58, black ); // center top
CG_FillRect( 319, 300, 2, 178, black ); // center bot
CG_FillRect( 380, 239, 177, 2, black ); // right
}
// hairs
CG_FillRect( 84, 239, 177, 2, black ); // left
CG_FillRect( 320, 242, 1, 58, black ); // center top
CG_FillRect( 319, 300, 2, 178, black ); // center bot
CG_FillRect( 380, 239, 177, 2, black ); // right
}
// sides
CG_FillRect( 0, 0, (X_WIDTH * indent)+1, Y_HEIGHT, black );
CG_FillRect( X_WIDTH * (1 - indent) - 1, 0, (X_WIDTH * indent) + 2, Y_HEIGHT, black );
// top/bottom
CG_FillRect( X_WIDTH * indent, 0, X_WIDTH * (1-indent), Y_HEIGHT * indent + 1, black );
CG_FillRect( X_WIDTH * indent, Y_HEIGHT * (1-indent) - 1, X_WIDTH * (1-indent), Y_HEIGHT * indent + 2, black );
}
//--------------------------------------
@ -2729,6 +2730,45 @@ static void CG_Draw2D( void )
CG_DrawZoomBorders();
}
if (cg.zoomMode)
{
cg.drawingHUD = CG_HUD_NORMAL;
const auto xOffset = (-vr->off_center_fov_x * 640);
const auto yOffset = (vr->off_center_fov_y * 480);
vec4_t color = { 0, 0, 0, 1 };
if (cg.stereoView == STEREO_LEFT)
{
//Left Gap
CG_FillRect(0, 0, -xOffset, 480, color);
if (yOffset < 0)
{
//Bottom Gap
CG_FillRect(0, 0, 640, yOffset, color);
}
else
{
//Top Gap
CG_FillRect(0, 480 - yOffset, 640, yOffset, color);
}
}
else
{
//Right Gap
CG_FillRect(640 - xOffset, 0, xOffset, 480, color);
if (yOffset < 0)
{
//Bottom Gap
CG_FillRect(0, 0, 640, yOffset, color);
}
else
{
//Top Gap
CG_FillRect(0, 480 - yOffset, 640, yOffset, color);
}
}
}
cg.drawingHUD = CG_HUD_SCALED;
CG_DrawBatteryCharge();
@ -2802,7 +2842,10 @@ static void CG_Draw2D( void )
CG_UseIcon();
}
cg.drawingHUD = CG_HUD_NORMAL;
CG_SaberClashFlare();
cg.drawingHUD = CG_HUD_SCALED;
float y = 0;
if (cg_drawSnapshot.integer) {
@ -3032,8 +3075,7 @@ void CG_DrawActive( stereoFrame_t stereoView ) {
{
cg.refdef.viewangles[ROLL] = vr->hmdorientation[ROLL];
cg.refdef.viewangles[PITCH] = vr->weaponangles[ANGLES_ADJUSTED][PITCH];
cg.refdef.viewangles[YAW] = vr->clientviewangles[YAW]
+ vr->weaponangles[ANGLES_ADJUSTED][YAW] + SHORT2ANGLE(cg.snap->ps.delta_angles[YAW]);
cg.refdef.viewangles[YAW] = vr->clientviewangles[YAW] + SHORT2ANGLE(cg.snap->ps.delta_angles[YAW]);
AnglesToAxis(cg.refdef.viewangles, cg.refdef.viewaxis);
}

View file

@ -4588,10 +4588,13 @@ Ghoul2 Insert End
{
if ( (trace.contents&CONTENTS_WATER) || (trace.contents&CONTENTS_SLIME) )
{
if (!cent->gent->client->ps.saberInFlight)
if (cent->gent->client->ps.clientNum == 0)
{
int position = (vr->right_handed ? 2 : 1);
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
if (!cent->gent->client->ps.saberInFlight)
{
int position = (vr->right_handed ? 2 : 1);
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
}
}
/*
@ -4613,10 +4616,13 @@ Ghoul2 Insert End
}
else
{
if (!cent->gent->client->ps.saberInFlight)
if (cent->gent->client->ps.clientNum == 0)
{
int position = (vr->right_handed ? 2 : 1);
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
if (!cent->gent->client->ps.saberInFlight)
{
int position = (vr->right_handed ? 2 : 1);
cgi_HapticEvent("chainsaw_fire", position, 0, 25, 0, 0);
}
}
theFxScheduler.PlayEffect( "spark", trace.endpos, trace.plane.normal );
@ -4908,8 +4914,37 @@ void CG_Player(centity_t *cent ) {
vr->velocitytriggered = (!cg.renderingThirdPerson &&
(cg.snap->ps.weapon == WP_SABER || cg.snap->ps.weapon == WP_MELEE || cg.snap->ps.weapon == WP_STUN_BATON));
cvar_t *vr_motion_enable_saber = gi.cvar("vr_motion_enable_saber", "0", CVAR_ARCHIVE);
vr->velocitytriggeractive = ((cg.snap->ps.weapon == WP_SABER && (cent->gent->client->ps.saberActive || vr_motion_enable_saber->integer)) ||
cg.snap->ps.weapon == WP_MELEE || cg.snap->ps.weapon == WP_STUN_BATON);
switch (cg.snap->ps.weapon)
{
case WP_SABER:
{
gentity_t *saberent = &g_entities[cent->gent->client->ps.saberEntityNum];
if (cent->gent->client->ps.saberActive || vr_motion_enable_saber->integer)
{
vr->velocitytriggeractive = true;
}
//Should we allow player to pull saber back with motion?
else if (cent->gent->client->ps.saberInFlight &&
saberent->s.pos.trType != TR_LINEAR)
{
vr->velocitytriggeractive = true;
}
else
{
vr->velocitytriggeractive = false;
}
break;
}
case WP_MELEE:
case WP_STUN_BATON:
vr->velocitytriggeractive = true;
break;
default:
vr->velocitytriggeractive = false;
break;
}
}
//Get the player's light level for stealth calculations

View file

@ -2109,7 +2109,7 @@ wasForceSpeed=isForceSpeed;
VectorScale( handEnt.axis[i], (!vr->right_handed || i != 1) ? 1.0f : -1.0f, handEnt.axis[i] );
}
CG_AddRefEntityWithPowerups(&handEnt, cent->currentState.powerups, cent);
CG_AddRefEntityWithPowerups(&handEnt, cent->currentState.powerups, cent, true);
}
}
}

View file

@ -2775,7 +2775,7 @@ void CG_ItemSelectorSelect_f( void )
cg.forcepowerSelectTime = cg.time;
cg.forcepowerSelect = cg.itemSelectorSelection;
}
else if (cg.itemSelectorType == ST_QUICK_SAVE) {
else if (cg.itemSelectorType == ST_QUICK_MENU) {
if (cg.itemSelectorSelection == 0) {
cgi_SendConsoleCommand("save quik*\n");
CG_CenterPrint("Quick Saved", 240);
@ -2792,7 +2792,7 @@ void CG_ItemSelectorNext_f( void )
{
if (cg.itemSelectorType >= ST_FORCE_POWER)
{
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_SAVE : ST_FORCE_POWER;
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_MENU : ST_FORCE_POWER;
return;
}
@ -2809,7 +2809,7 @@ void CG_ItemSelectorPrev_f( void )
{
if (cg.itemSelectorType >= ST_FORCE_POWER)
{
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_SAVE : ST_FORCE_POWER;
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_MENU : ST_FORCE_POWER;
return;
}
@ -2938,7 +2938,7 @@ void CG_DrawItemSelector( void )
sRGB[1] = 0.0f;
sRGB[2] = 1.0f;
break;
case ST_QUICK_SAVE:
case ST_QUICK_MENU:
count = 2;
sRGB[0] = 1.0f;
sRGB[1] = 1.0f;
@ -3068,7 +3068,7 @@ void CG_DrawItemSelector( void )
case ST_FORCE_POWER: // force powers
selectable = ForcePower_Valid(itemId);
break;
case ST_QUICK_SAVE:
case ST_QUICK_MENU:
selectable = true;
break;
}
@ -3155,7 +3155,7 @@ void CG_DrawItemSelector( void )
case ST_FORCE_POWER: // force powers
sprite.customShader = force_icons[showPowers[itemId]];
break;
case ST_QUICK_SAVE:
case ST_QUICK_MENU:
sprite.customShader = itemId == 0 ? cgs.media.iconSave : cgs.media.iconLoad;
break;
}
@ -3293,7 +3293,7 @@ void CG_FireWeapon( centity_t *cent, qboolean alt_fire )
}
//Are we the player?
if (cent->gent->client->ps.clientNum == 0)
if (cent->gent->client && cent->gent->client->ps.clientNum == 0)
{
/*
These are specific to external haptics vest/arms/face combinations

View file

@ -135,7 +135,7 @@ qboolean G_ParseLiteral( const char **data, const char *string )
//
// NPC parameters file : scripts/NPCs.cfg
//
#define MAX_NPC_DATA_SIZE 0x40000
#define MAX_NPC_DATA_SIZE 0x400000
char NPCParms[MAX_NPC_DATA_SIZE];
team_t TranslateTeamName( const char *name )
@ -2322,7 +2322,7 @@ void NPC_LoadParms( void )
g_TeamBeefDirectorsCut->integer != 0 ? "npcs" : "npcs_og");
char *buffer, *holdChar, *marker;
char npcExtensionListBuf[2048]; // The list of file names read in
char npcExtensionListBuf[4096]; // The list of file names read in
//First, load in the npcs.cfg
len = gi.FS_ReadFile( npcs_filename, (void **) &buffer );

View file

@ -658,7 +658,8 @@ float getHMDYawForCalc()
if (!vr->third_person && vr->cgzoommode != 2 && vr->cgzoommode != 4 ) {
return vr->hmdorientation[YAW];
}
return 0.0f;
return vr->weaponangles[ANGLES_ADJUSTED][YAW];
}
void BG_ConvertFromVR(vec3_t in, vec3_t offset, vec3_t out)

View file

@ -2248,12 +2248,13 @@ extern cvar_t *g_skippingcin;
// ucmd->angles[PITCH] = 0;
// }
if ( cg.zoomMode == 2 )
//Allow movement when zoomed
/* if ( cg.zoomMode == 2 )
{
// Any kind of movement when the player is NOT ducked when the disruptor gun is zoomed will cause us to auto-magically un-zoom
if ( ( (ucmd->forwardmove||ucmd->rightmove)
&& ucmd->upmove >= 0 //crouching-moving is ok
&& !(ucmd->buttons&BUTTON_USE)/*leaning is ok*/
&& !(ucmd->buttons&BUTTON_USE)//leaning is ok
)
|| ucmd->upmove > 0 //jumping not allowed
)
@ -2265,7 +2266,7 @@ extern cvar_t *g_skippingcin;
cg.zoomLocked = qfalse;
}
}
*/
if ( (player_locked || (ent->client->ps.eFlags&EF_FORCE_GRIPPED)) && ent->client->ps.pm_type < PM_DEAD ) // unless dead
{//lock out player control
if ( !player_locked )

View file

@ -174,7 +174,7 @@ void G_Give( gentity_t *ent, const char *name, const char *args, int argc )
if ( give_all || !Q_stricmp( name, "health") )
{
if ( argc == 3 )
ent->health = Com_Clampi( 1, ent->client->ps.stats[STAT_MAX_HEALTH], atoi( args ) );
ent->health = Com_Clampi( 1, 999, atoi( args ) );
else
ent->health = ent->client->ps.stats[STAT_MAX_HEALTH];
if ( !give_all )
@ -510,6 +510,32 @@ void Cmd_Undying_f (gentity_t *ent)
gi.SendServerCommand( ent-g_entities, "print \"%s\"", msg);
}
/*
==================
Cmd_UnlimitedPower_f
Grants unlimited power to client
argv(0) unlimitedpower
==================
*/
void Cmd_UnlimitedPower_f (gentity_t *ent)
{
const char *msg;
if ( !CheatsOk( ent ) ) {
return;
}
ent->flags ^= FL_UNLIMITEDPOWERMODE;
if (!(ent->flags & FL_UNLIMITEDPOWERMODE) )
msg = "unlimited power mode OFF\n";
else
msg = "unlimited power mode ON\n";
gi.SendServerCommand( ent-g_entities, "print \"%s\"", msg);
}
/*
==================
Cmd_Notarget_f
@ -1031,6 +1057,8 @@ void ClientCommand( int clientNum ) {
Cmd_God_f (ent);
else if (Q_stricmp (cmd, "undying") == 0)
Cmd_Undying_f (ent);
else if (Q_stricmp (cmd, "unlimitedpower") == 0)
Cmd_UnlimitedPower_f (ent);
else if (Q_stricmp (cmd, "notarget") == 0)
Cmd_Notarget_f (ent);
else if (Q_stricmp (cmd, "noclip") == 0)

View file

@ -73,6 +73,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#define FL_DISINTEGRATED 0x00020000 // marks that the corpse has already been disintegrated
#define FL_FORCE_PULLABLE_ONLY 0x00040000 // cannot be force pushed
#define FL_NO_IMPACT_DMG 0x00080000 // Will not take impact damage
#define FL_UNLIMITEDPOWERMODE 0x10000000 // Unlimited power mode
//Pointer safety utilities
#define VALID( a ) ( a != NULL )

View file

@ -5765,11 +5765,13 @@ void ForceThrowEx( gentity_t *self, qboolean pull, qboolean aimByViewAngles )
if ( pull )
{
cone = forcePullCone[self->client->ps.forcePowerLevel[FP_PULL]];
cone = forcePullCone[self->client->ps.forcePowerLevel[FP_PULL]] -
((aimByViewAngles != 0) ? 0.05f : 0.0f);
}
else
{
cone = forcePushCone[self->client->ps.forcePowerLevel[FP_PUSH]];
cone = forcePushCone[self->client->ps.forcePowerLevel[FP_PUSH]] -
((aimByViewAngles != 0) ? 0.05f : 0.0f);
}
if ( cone >= 1.0f )
@ -7717,6 +7719,9 @@ void WP_ForcePowerDrain( gentity_t *self, forcePowers_t forcePower, int override
{//For now, NPCs have infinite force power
return;
}
if ( self->flags & FL_UNLIMITEDPOWERMODE) {
return;
}
//take away the power
int drain = overrideAmt;
if ( !drain )
@ -8674,14 +8679,14 @@ void WP_InitForcePowers( gentity_t *ent )
ent->client->ps.forcePowersKnown = ( 1 << FP_HEAL )|( 1 << FP_LEVITATION )|( 1 << FP_SPEED )|( 1 << FP_PUSH )|( 1 << FP_PULL )|( 1 << FP_TELEPATHY )|( 1 << FP_GRIP )|( 1 << FP_LIGHTNING)|( 1 << FP_SABERTHROW)|( 1 << FP_SABER_DEFENSE )|( 1 << FP_SABER_OFFENSE );
ent->client->ps.forcePower = ent->client->ps.forcePowerMax = FORCE_POWER_MAX;
ent->client->ps.forcePowerRegenDebounceTime = 0;
ent->client->ps.forcePowerLevel[FP_HEAL] = FORCE_LEVEL_2;
ent->client->ps.forcePowerLevel[FP_LEVITATION] = FORCE_LEVEL_2;
ent->client->ps.forcePowerLevel[FP_PUSH] = FORCE_LEVEL_1;
ent->client->ps.forcePowerLevel[FP_PULL] = FORCE_LEVEL_1;
ent->client->ps.forcePowerLevel[FP_HEAL] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_LEVITATION] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_PUSH] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_PULL] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_SABERTHROW] = FORCE_LEVEL_2;
ent->client->ps.forcePowerLevel[FP_SPEED] = FORCE_LEVEL_2;
ent->client->ps.forcePowerLevel[FP_LIGHTNING] = FORCE_LEVEL_1;
ent->client->ps.forcePowerLevel[FP_TELEPATHY] = FORCE_LEVEL_2;
ent->client->ps.forcePowerLevel[FP_SPEED] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_LIGHTNING] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_TELEPATHY] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_SABER_DEFENSE] = FORCE_LEVEL_3;
ent->client->ps.forcePowerLevel[FP_SABER_OFFENSE] = FORCE_LEVEL_3;
if ( ent->NPC )
@ -8690,7 +8695,7 @@ void WP_InitForcePowers( gentity_t *ent )
}
else
{
ent->client->ps.forcePowerLevel[FP_GRIP] = FORCE_LEVEL_2;
ent->client->ps.forcePowerLevel[FP_GRIP] = FORCE_LEVEL_3;
}
ent->client->ps.forceGripEntityNum = ENTITYNUM_NONE;
ent->client->ps.forceGripEntityInitialDist = ENTITYNUM_NONE;

View file

@ -376,7 +376,8 @@ static const char *gcmds[] = {
"voice_cmd",
"vote",
"where",
"zoom"
"zoom",
"unlimitedpower"
};
static const size_t numgcmds = ARRAY_LEN( gcmds );

View file

@ -83,6 +83,7 @@ extern vec3_t gPainPoint;
#define FL_DONT_SHOOT 0x00040000
#define FL_SHIELDED 0x00080000
#define FL_UNDYING 0x00100000 // takes damage down to 1, but never dies
#define FL_UNLIMITEDPOWERMODE 0x10000000 // Unlimited power mode
//ex-eFlags -rww
#define FL_BOUNCE 0x00100000 // for missiles

View file

@ -4895,7 +4895,8 @@ void UI_UpdateVideoSetup ( void )
trap->Cvar_Set ( "cg_shadows", UI_Cvar_VariableString ( "ui_cg_shadows" ) );
trap->Cvar_Set ( "ui_r_modified", "0" );
trap->Cmd_ExecuteText( EXEC_APPEND, "vid_restart;" );
//Don't do this - expect user to restart themselves
//trap->Cmd_ExecuteText( EXEC_APPEND, "vid_restart;" );
}
/*

View file

@ -571,6 +571,7 @@ void *Sys_LoadSPGameDll( const char *name, GetGameAPIProc **GetGameAPI )
char *apppath = Cvar_VariableString( "fs_apppath" );
#endif
const char* binarypath = Sys_BinaryPath();
const char* current_dir = Sys_CurrentDirname();
const char *searchPaths[] = {
homepath,
@ -579,6 +580,7 @@ void *Sys_LoadSPGameDll( const char *name, GetGameAPIProc **GetGameAPI )
#endif
basepath,
binarypath,
current_dir,
cdpath,
};
size_t numPaths = ARRAY_LEN( searchPaths );
@ -646,7 +648,10 @@ void *Sys_LoadGameDll( const char *name, GetModuleAPIProc **moduleAPI )
char *apppath = Cvar_VariableString( "fs_apppath" );
#endif
const char* current_dir = Sys_CurrentDirname();
const char *searchPaths[] = {
current_dir,
homepath,
#ifdef MACOS_X
apppath,

View file

@ -143,6 +143,7 @@ char *Sys_DefaultAppPath(void);
char *Sys_DefaultHomePath(void);
const char *Sys_Dirname( char *path );
const char *Sys_Basename( char *path );
const char * Sys_CurrentDirname();
bool Sys_PathCmp( const char *path1, const char *path2 );

View file

@ -25,6 +25,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include <io.h>
#include <shlobj.h>
#include <windows.h>
#include <winbase.h>
#define MEM_THRESHOLD (128*1024*1024)
@ -33,6 +34,40 @@ static char homePath[ MAX_OSPATH ] = { 0 };
static UINT timerResolution = 0;
/*
==============
Sys_Dialog
Display a win32 dialog box
==============
*/
dialogResult_t Sys_Dialog(dialogType_t type, const char* message, const char* title)
{
UINT uType;
switch (type)
{
default:
case DT_INFO: uType = MB_ICONINFORMATION | MB_OK; break;
case DT_WARNING: uType = MB_ICONWARNING | MB_OK; break;
case DT_ERROR: uType = MB_ICONERROR | MB_OK; break;
case DT_YES_NO: uType = MB_ICONQUESTION | MB_YESNO; break;
case DT_OK_CANCEL: uType = MB_ICONWARNING | MB_OKCANCEL; break;
}
switch (MessageBox(NULL, message, title, uType))
{
default:
case IDOK: return DR_OK;
case IDCANCEL: return DR_CANCEL;
case IDYES: return DR_YES;
case IDNO: return DR_NO;
}
}
/*
==============
Sys_Basename
@ -84,6 +119,23 @@ const char *Sys_Dirname( char *path )
return dir;
}
/*
==============
Sys_Dirname
==============
*/
const char *Sys_CurrentDirname( )
{
static char dir[ MAX_OSPATH ] = { 0 };
GetCurrentDirectory(
MAX_OSPATH,
dir
);
return dir;
}
/*
================
Sys_Milliseconds

View file

@ -0,0 +1,5 @@
openxr.h
openxr_platform.h
openxr_reflection.h
openxr_reflection_structs.h
openxr_reflection_parent_structs.h

View file

@ -1,4 +1,4 @@
Copyright (c) 2017-2022, The Khronos Group Inc.
Copyright (c) 2017-2023, The Khronos Group Inc.
SPDX-License-Identifier: Apache-2.0

View file

@ -1,4 +1,4 @@
# Copyright (c) 2017-2022, The Khronos Group Inc.
# Copyright (c) 2017-2023, The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
#

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
#define OPENXR_PLATFORM_H_ 1
/*
** Copyright 2017-2022 The Khronos Group Inc.
** Copyright 2017-2023 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0 OR MIT
*/
@ -454,9 +454,9 @@ typedef XrSwapchainImageVulkanKHR XrSwapchainImageVulkan2KHR;
typedef XrGraphicsRequirementsVulkanKHR XrGraphicsRequirementsVulkan2KHR;
typedef XrResult (XRAPI_PTR *PFN_xrCreateVulkanInstanceKHR)(XrInstance instance, const XrVulkanInstanceCreateInfoKHR* createInfo, VkInstance* vulkanInstance, VkResult* vulkanResult);
typedef XrResult (XRAPI_PTR *PFN_xrCreateVulkanDeviceKHR)(XrInstance instance, const XrVulkanDeviceCreateInfoKHR* createInfo, VkDevice* vulkanDevice, VkResult* vulkanResult);
typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsDevice2KHR)(XrInstance instance, const XrVulkanGraphicsDeviceGetInfoKHR* getInfo, VkPhysicalDevice* vulkanPhysicalDevice);
typedef XrResult (XRAPI_PTR *PFN_xrCreateVulkanInstanceKHR)(XrInstance instance, const XrVulkanInstanceCreateInfoKHR* createInfo, VkInstance* vulkanInstance, VkResult* vulkanResult);
typedef XrResult (XRAPI_PTR *PFN_xrCreateVulkanDeviceKHR)(XrInstance instance, const XrVulkanDeviceCreateInfoKHR* createInfo, VkDevice* vulkanDevice, VkResult* vulkanResult);
typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsDevice2KHR)(XrInstance instance, const XrVulkanGraphicsDeviceGetInfoKHR* getInfo, VkPhysicalDevice* vulkanPhysicalDevice);
typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsRequirements2KHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsVulkanKHR* graphicsRequirements);
#ifndef XR_NO_PROTOTYPES
@ -491,14 +491,15 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsRequirements2KHR(
#define XR_MNDX_egl_enable 1
#define XR_MNDX_egl_enable_SPEC_VERSION 1
#define XR_MNDX_EGL_ENABLE_EXTENSION_NAME "XR_MNDX_egl_enable"
typedef void *(*PFN_xrEglGetProcAddressMNDX)(const char *name);
// XrGraphicsBindingEGLMNDX extends XrSessionCreateInfo
typedef struct XrGraphicsBindingEGLMNDX {
XrStructureType type;
const void* XR_MAY_ALIAS next;
PFNEGLGETPROCADDRESSPROC getProcAddress;
EGLDisplay display;
EGLConfig config;
EGLContext context;
XrStructureType type;
const void* XR_MAY_ALIAS next;
PFN_xrEglGetProcAddressMNDX getProcAddress;
EGLDisplay display;
EGLConfig config;
EGLContext context;
} XrGraphicsBindingEGLMNDX;
#endif /* XR_USE_PLATFORM_EGL */
@ -565,6 +566,30 @@ typedef struct XrAndroidSurfaceSwapchainCreateInfoFB {
#endif /* XR_USE_PLATFORM_ANDROID */
#ifdef XR_USE_PLATFORM_ML
#define XR_ML_compat 1
#define XR_ML_compat_SPEC_VERSION 1
#define XR_ML_COMPAT_EXTENSION_NAME "XR_ML_compat"
typedef struct XrCoordinateSpaceCreateInfoML {
XrStructureType type;
const void* XR_MAY_ALIAS next;
MLCoordinateFrameUID cfuid;
XrPosef poseInCoordinateSpace;
} XrCoordinateSpaceCreateInfoML;
typedef XrResult (XRAPI_PTR *PFN_xrCreateSpaceFromCoordinateFrameUIDML)(XrSession session, const XrCoordinateSpaceCreateInfoML *createInfo, XrSpace* space);
#ifndef XR_NO_PROTOTYPES
#ifdef XR_EXTENSION_PROTOTYPES
XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpaceFromCoordinateFrameUIDML(
XrSession session,
const XrCoordinateSpaceCreateInfoML * createInfo,
XrSpace* space);
#endif /* XR_EXTENSION_PROTOTYPES */
#endif /* !XR_NO_PROTOTYPES */
#endif /* XR_USE_PLATFORM_ML */
#ifdef XR_USE_PLATFORM_WIN32
#define XR_OCULUS_audio_device_guid 1

View file

@ -1,5 +1,5 @@
/*
** Copyright (c) 2017-2022, The Khronos Group Inc.
** Copyright (c) 2017-2023, The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0 OR MIT
*/
@ -65,7 +65,7 @@ typedef unsigned __int64 uint64_t;
#endif // !defined( XR_NO_STDINT_H )
// XR_PTR_SIZE (in bytes)
#if (defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__))
#if (defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__))
#define XR_PTR_SIZE 8
#else
#define XR_PTR_SIZE 4
@ -103,6 +103,10 @@ typedef unsigned __int64 uint64_t;
#endif
#endif
#if !defined(XR_CPP_NULLPTR_SUPPORTED)
#define XR_CPP_NULLPTR_SUPPORTED 0
#endif // !defined(XR_CPP_NULLPTR_SUPPORTED)
#ifdef __cplusplus
}
#endif

View file

@ -2,7 +2,7 @@
#define OPENXR_REFLECTION_PARENT_STRUCTS_H_ 1
/*
** Copyright (c) 2017-2022, The Khronos Group Inc.
** Copyright (c) 2017-2023, The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0 OR MIT
*/
@ -62,6 +62,8 @@ This file contains expansion macros (X Macros) for OpenXR structures that have a
_avail(XrEventDataSpaceQueryCompleteFB, XR_TYPE_EVENT_DATA_SPACE_QUERY_COMPLETE_FB) \
_avail(XrEventDataSpaceSaveCompleteFB, XR_TYPE_EVENT_DATA_SPACE_SAVE_COMPLETE_FB) \
_avail(XrEventDataSpaceEraseCompleteFB, XR_TYPE_EVENT_DATA_SPACE_ERASE_COMPLETE_FB) \
_avail(XrEventDataSpaceShareCompleteFB, XR_TYPE_EVENT_DATA_SPACE_SHARE_COMPLETE_FB) \
_avail(XrEventDataSpaceListSaveCompleteFB, XR_TYPE_EVENT_DATA_SPACE_LIST_SAVE_COMPLETE_FB) \
@ -75,6 +77,8 @@ This file contains expansion macros (X Macros) for OpenXR structures that have a
// Implementation detail of XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrHapticBaseHeader()
#define _impl_XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrHapticBaseHeader_CORE(_avail, _unavail) \
_avail(XrHapticVibration, XR_TYPE_HAPTIC_VIBRATION) \
_avail(XrHapticAmplitudeEnvelopeVibrationFB, XR_TYPE_HAPTIC_AMPLITUDE_ENVELOPE_VIBRATION_FB) \
_avail(XrHapticPcmVibrationFB, XR_TYPE_HAPTIC_PCM_VIBRATION_FB) \

View file

@ -2,7 +2,7 @@
#define OPENXR_REFLECTION_STRUCTS_H_ 1
/*
** Copyright (c) 2017-2022, The Khronos Group Inc.
** Copyright (c) 2017-2023, The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0 OR MIT
*/
@ -37,6 +37,7 @@ This file contains expansion macros (X Macros) for OpenXR structures.
_impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_VULKAN(_avail, _unavail) \
_impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_PLATFORM_ANDROID(_avail, _unavail) \
_impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_PLATFORM_EGL(_avail, _unavail) \
_impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_PLATFORM_ML(_avail, _unavail) \
_impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_PLATFORM_WIN32(_avail, _unavail) \
@ -143,6 +144,11 @@ This file contains expansion macros (X Macros) for OpenXR structures.
_avail(XrCompositionLayerReprojectionInfoMSFT, XR_TYPE_COMPOSITION_LAYER_REPROJECTION_INFO_MSFT) \
_avail(XrCompositionLayerReprojectionPlaneOverrideMSFT, XR_TYPE_COMPOSITION_LAYER_REPROJECTION_PLANE_OVERRIDE_MSFT) \
_avail(XrCompositionLayerSecureContentFB, XR_TYPE_COMPOSITION_LAYER_SECURE_CONTENT_FB) \
_avail(XrSystemBodyTrackingPropertiesFB, XR_TYPE_SYSTEM_BODY_TRACKING_PROPERTIES_FB) \
_avail(XrBodyTrackerCreateInfoFB, XR_TYPE_BODY_TRACKER_CREATE_INFO_FB) \
_avail(XrBodySkeletonFB, XR_TYPE_BODY_SKELETON_FB) \
_avail(XrBodyJointsLocateInfoFB, XR_TYPE_BODY_JOINTS_LOCATE_INFO_FB) \
_avail(XrBodyJointLocationsFB, XR_TYPE_BODY_JOINT_LOCATIONS_FB) \
_avail(XrInteractionProfileDpadBindingEXT, XR_TYPE_INTERACTION_PROFILE_DPAD_BINDING_EXT) \
_avail(XrInteractionProfileAnalogThresholdVALVE, XR_TYPE_INTERACTION_PROFILE_ANALOG_THRESHOLD_VALVE) \
_avail(XrHandJointsMotionRangeInfoEXT, XR_TYPE_HAND_JOINTS_MOTION_RANGE_INFO_EXT) \
@ -217,6 +223,8 @@ This file contains expansion macros (X Macros) for OpenXR structures.
_avail(XrSystemMarkerTrackingPropertiesVARJO, XR_TYPE_SYSTEM_MARKER_TRACKING_PROPERTIES_VARJO) \
_avail(XrEventDataMarkerTrackingUpdateVARJO, XR_TYPE_EVENT_DATA_MARKER_TRACKING_UPDATE_VARJO) \
_avail(XrMarkerSpaceCreateInfoVARJO, XR_TYPE_MARKER_SPACE_CREATE_INFO_VARJO) \
_avail(XrFrameEndInfoML, XR_TYPE_FRAME_END_INFO_ML) \
_avail(XrGlobalDimmerFrameEndInfoML, XR_TYPE_GLOBAL_DIMMER_FRAME_END_INFO_ML) \
_avail(XrSpatialAnchorPersistenceInfoMSFT, XR_TYPE_SPATIAL_ANCHOR_PERSISTENCE_INFO_MSFT) \
_avail(XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT, XR_TYPE_SPATIAL_ANCHOR_FROM_PERSISTED_ANCHOR_CREATE_INFO_MSFT) \
_avail(XrSpaceQueryInfoFB, XR_TYPE_SPACE_QUERY_INFO_FB) \
@ -230,18 +238,64 @@ This file contains expansion macros (X Macros) for OpenXR structures.
_avail(XrSpaceEraseInfoFB, XR_TYPE_SPACE_ERASE_INFO_FB) \
_avail(XrEventDataSpaceSaveCompleteFB, XR_TYPE_EVENT_DATA_SPACE_SAVE_COMPLETE_FB) \
_avail(XrEventDataSpaceEraseCompleteFB, XR_TYPE_EVENT_DATA_SPACE_ERASE_COMPLETE_FB) \
_avail(XrSpaceShareInfoFB, XR_TYPE_SPACE_SHARE_INFO_FB) \
_avail(XrEventDataSpaceShareCompleteFB, XR_TYPE_EVENT_DATA_SPACE_SHARE_COMPLETE_FB) \
_avail(XrCompositionLayerSpaceWarpInfoFB, XR_TYPE_COMPOSITION_LAYER_SPACE_WARP_INFO_FB) \
_avail(XrSystemSpaceWarpPropertiesFB, XR_TYPE_SYSTEM_SPACE_WARP_PROPERTIES_FB) \
_avail(XrHapticAmplitudeEnvelopeVibrationFB, XR_TYPE_HAPTIC_AMPLITUDE_ENVELOPE_VIBRATION_FB) \
_avail(XrSemanticLabelsFB, XR_TYPE_SEMANTIC_LABELS_FB) \
_avail(XrRoomLayoutFB, XR_TYPE_ROOM_LAYOUT_FB) \
_avail(XrBoundary2DFB, XR_TYPE_BOUNDARY_2D_FB) \
_avail(XrSemanticLabelsSupportInfoFB, XR_TYPE_SEMANTIC_LABELS_SUPPORT_INFO_FB) \
_avail(XrDigitalLensControlALMALENCE, XR_TYPE_DIGITAL_LENS_CONTROL_ALMALENCE) \
_avail(XrEventDataSceneCaptureCompleteFB, XR_TYPE_EVENT_DATA_SCENE_CAPTURE_COMPLETE_FB) \
_avail(XrSceneCaptureRequestInfoFB, XR_TYPE_SCENE_CAPTURE_REQUEST_INFO_FB) \
_avail(XrSpaceContainerFB, XR_TYPE_SPACE_CONTAINER_FB) \
_avail(XrFoveationEyeTrackedProfileCreateInfoMETA, XR_TYPE_FOVEATION_EYE_TRACKED_PROFILE_CREATE_INFO_META) \
_avail(XrFoveationEyeTrackedStateMETA, XR_TYPE_FOVEATION_EYE_TRACKED_STATE_META) \
_avail(XrSystemFoveationEyeTrackedPropertiesMETA, XR_TYPE_SYSTEM_FOVEATION_EYE_TRACKED_PROPERTIES_META) \
_avail(XrSystemFaceTrackingPropertiesFB, XR_TYPE_SYSTEM_FACE_TRACKING_PROPERTIES_FB) \
_avail(XrFaceTrackerCreateInfoFB, XR_TYPE_FACE_TRACKER_CREATE_INFO_FB) \
_avail(XrFaceExpressionInfoFB, XR_TYPE_FACE_EXPRESSION_INFO_FB) \
_avail(XrFaceExpressionWeightsFB, XR_TYPE_FACE_EXPRESSION_WEIGHTS_FB) \
_avail(XrEyeTrackerCreateInfoFB, XR_TYPE_EYE_TRACKER_CREATE_INFO_FB) \
_avail(XrEyeGazesInfoFB, XR_TYPE_EYE_GAZES_INFO_FB) \
_avail(XrSystemEyeTrackingPropertiesFB, XR_TYPE_SYSTEM_EYE_TRACKING_PROPERTIES_FB) \
_avail(XrEyeGazesFB, XR_TYPE_EYE_GAZES_FB) \
_avail(XrPassthroughKeyboardHandsIntensityFB, XR_TYPE_PASSTHROUGH_KEYBOARD_HANDS_INTENSITY_FB) \
_avail(XrCompositionLayerSettingsFB, XR_TYPE_COMPOSITION_LAYER_SETTINGS_FB) \
_avail(XrHapticPcmVibrationFB, XR_TYPE_HAPTIC_PCM_VIBRATION_FB) \
_avail(XrDevicePcmSampleRateStateFB, XR_TYPE_DEVICE_PCM_SAMPLE_RATE_STATE_FB) \
_avail(XrCompositionLayerDepthTestFB, XR_TYPE_COMPOSITION_LAYER_DEPTH_TEST_FB) \
_avail(XrLocalDimmingFrameEndInfoMETA, XR_TYPE_LOCAL_DIMMING_FRAME_END_INFO_META) \
_avail(XrPassthroughPreferencesMETA, XR_TYPE_PASSTHROUGH_PREFERENCES_META) \
_avail(XrSystemVirtualKeyboardPropertiesMETA, XR_TYPE_SYSTEM_VIRTUAL_KEYBOARD_PROPERTIES_META) \
_avail(XrVirtualKeyboardCreateInfoMETA, XR_TYPE_VIRTUAL_KEYBOARD_CREATE_INFO_META) \
_avail(XrVirtualKeyboardSpaceCreateInfoMETA, XR_TYPE_VIRTUAL_KEYBOARD_SPACE_CREATE_INFO_META) \
_avail(XrVirtualKeyboardLocationInfoMETA, XR_TYPE_VIRTUAL_KEYBOARD_LOCATION_INFO_META) \
_avail(XrVirtualKeyboardModelVisibilitySetInfoMETA, XR_TYPE_VIRTUAL_KEYBOARD_MODEL_VISIBILITY_SET_INFO_META) \
_avail(XrVirtualKeyboardAnimationStateMETA, XR_TYPE_VIRTUAL_KEYBOARD_ANIMATION_STATE_META) \
_avail(XrVirtualKeyboardModelAnimationStatesMETA, XR_TYPE_VIRTUAL_KEYBOARD_MODEL_ANIMATION_STATES_META) \
_avail(XrVirtualKeyboardTextureDataMETA, XR_TYPE_VIRTUAL_KEYBOARD_TEXTURE_DATA_META) \
_avail(XrVirtualKeyboardInputInfoMETA, XR_TYPE_VIRTUAL_KEYBOARD_INPUT_INFO_META) \
_avail(XrVirtualKeyboardTextContextChangeInfoMETA, XR_TYPE_VIRTUAL_KEYBOARD_TEXT_CONTEXT_CHANGE_INFO_META) \
_avail(XrEventDataVirtualKeyboardCommitTextMETA, XR_TYPE_EVENT_DATA_VIRTUAL_KEYBOARD_COMMIT_TEXT_META) \
_avail(XrEventDataVirtualKeyboardBackspaceMETA, XR_TYPE_EVENT_DATA_VIRTUAL_KEYBOARD_BACKSPACE_META) \
_avail(XrEventDataVirtualKeyboardEnterMETA, XR_TYPE_EVENT_DATA_VIRTUAL_KEYBOARD_ENTER_META) \
_avail(XrEventDataVirtualKeyboardShownMETA, XR_TYPE_EVENT_DATA_VIRTUAL_KEYBOARD_SHOWN_META) \
_avail(XrEventDataVirtualKeyboardHiddenMETA, XR_TYPE_EVENT_DATA_VIRTUAL_KEYBOARD_HIDDEN_META) \
_avail(XrExternalCameraOCULUS, XR_TYPE_EXTERNAL_CAMERA_OCULUS) \
_avail(XrPerformanceMetricsStateMETA, XR_TYPE_PERFORMANCE_METRICS_STATE_META) \
_avail(XrPerformanceMetricsCounterMETA, XR_TYPE_PERFORMANCE_METRICS_COUNTER_META) \
_avail(XrSpaceListSaveInfoFB, XR_TYPE_SPACE_LIST_SAVE_INFO_FB) \
_avail(XrEventDataSpaceListSaveCompleteFB, XR_TYPE_EVENT_DATA_SPACE_LIST_SAVE_COMPLETE_FB) \
_avail(XrSpaceUserCreateInfoFB, XR_TYPE_SPACE_USER_CREATE_INFO_FB) \
_avail(XrSystemHeadsetIdPropertiesMETA, XR_TYPE_SYSTEM_HEADSET_ID_PROPERTIES_META) \
_avail(XrPassthroughColorLutCreateInfoMETA, XR_TYPE_PASSTHROUGH_COLOR_LUT_CREATE_INFO_META) \
_avail(XrPassthroughColorLutUpdateInfoMETA, XR_TYPE_PASSTHROUGH_COLOR_LUT_UPDATE_INFO_META) \
_avail(XrPassthroughColorMapLutMETA, XR_TYPE_PASSTHROUGH_COLOR_MAP_LUT_META) \
_avail(XrPassthroughColorMapInterpolatedLutMETA, XR_TYPE_PASSTHROUGH_COLOR_MAP_INTERPOLATED_LUT_META) \
_avail(XrSystemPassthroughColorLutPropertiesMETA, XR_TYPE_SYSTEM_PASSTHROUGH_COLOR_LUT_PROPERTIES_META) \
_avail(XrPassthroughCreateInfoHTC, XR_TYPE_PASSTHROUGH_CREATE_INFO_HTC) \
_avail(XrPassthroughColorHTC, XR_TYPE_PASSTHROUGH_COLOR_HTC) \
_avail(XrPassthroughMeshTransformInfoHTC, XR_TYPE_PASSTHROUGH_MESH_TRANSFORM_INFO_HTC) \
@ -250,6 +304,17 @@ This file contains expansion macros (X Macros) for OpenXR structures.
_avail(XrFoveationDynamicModeInfoHTC, XR_TYPE_FOVEATION_DYNAMIC_MODE_INFO_HTC) \
_avail(XrFoveationCustomModeInfoHTC, XR_TYPE_FOVEATION_CUSTOM_MODE_INFO_HTC) \
_avail(XrActiveActionSetPrioritiesEXT, XR_TYPE_ACTIVE_ACTION_SET_PRIORITIES_EXT) \
_avail(XrSystemForceFeedbackCurlPropertiesMNDX, XR_TYPE_SYSTEM_FORCE_FEEDBACK_CURL_PROPERTIES_MNDX) \
_avail(XrForceFeedbackCurlApplyLocationsMNDX, XR_TYPE_FORCE_FEEDBACK_CURL_APPLY_LOCATIONS_MNDX) \
_avail(XrHandTrackingDataSourceInfoEXT, XR_TYPE_HAND_TRACKING_DATA_SOURCE_INFO_EXT) \
_avail(XrHandTrackingDataSourceStateEXT, XR_TYPE_HAND_TRACKING_DATA_SOURCE_STATE_EXT) \
_avail(XrSystemPlaneDetectionPropertiesEXT, XR_TYPE_SYSTEM_PLANE_DETECTION_PROPERTIES_EXT) \
_avail(XrPlaneDetectorCreateInfoEXT, XR_TYPE_PLANE_DETECTOR_CREATE_INFO_EXT) \
_avail(XrPlaneDetectorBeginInfoEXT, XR_TYPE_PLANE_DETECTOR_BEGIN_INFO_EXT) \
_avail(XrPlaneDetectorGetInfoEXT, XR_TYPE_PLANE_DETECTOR_GET_INFO_EXT) \
_avail(XrPlaneDetectorLocationEXT, XR_TYPE_PLANE_DETECTOR_LOCATION_EXT) \
_avail(XrPlaneDetectorLocationsEXT, XR_TYPE_PLANE_DETECTOR_LOCATIONS_EXT) \
_avail(XrPlaneDetectorPolygonBufferEXT, XR_TYPE_PLANE_DETECTOR_POLYGON_BUFFER_EXT) \
#if defined(XR_USE_GRAPHICS_API_D3D11)
@ -410,6 +475,16 @@ This file contains expansion macros (X Macros) for OpenXR structures.
#endif
#if defined(XR_USE_PLATFORM_ML)
#define _impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_PLATFORM_ML(_avail, _unavail) \
_avail(XrCoordinateSpaceCreateInfoML, XR_TYPE_COORDINATE_SPACE_CREATE_INFO_ML) \
#else
#define _impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_PLATFORM_ML(_avail, _unavail) \
_unavail(XrCoordinateSpaceCreateInfoML, XR_TYPE_COORDINATE_SPACE_CREATE_INFO_ML) \
#endif
#if defined(XR_USE_PLATFORM_WIN32)
#define _impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_PLATFORM_WIN32(_avail, _unavail) \
_avail(XrHolographicWindowAttachmentMSFT, XR_TYPE_HOLOGRAPHIC_WINDOW_ATTACHMENT_MSFT) \

View file

@ -1,5 +1,5 @@
// Copyright (c) 2017 The Khronos Group Inc.
// Copyright (c) 2016 Oculus VR, LLC.
// Copyright (c) 2017-2023, The Khronos Group Inc.
// Copyright (c) 2016, Oculus VR, LLC.
//
// SPDX-License-Identifier: Apache-2.0
//
@ -21,22 +21,19 @@
#ifndef XR_LINEAR_H_
#define XR_LINEAR_H_
#if defined(OS_LINUX_XCB) || defined(OS_LINUX_XCB_GLX) || defined(OS_LINUX_WAYLAND)
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma clang diagnostic ignored "-Wunused-function"
#endif
#include <openxr/openxr.h>
/* REUSE-IgnoreStart */
/* The following has copyright notices that duplicate the header above */
/*
================================================================================================
Description : Vector, matrix and quaternion math.
Author : J.M.P. van Waveren
Date : 12/10/2016
Language : C99
Format : Indent 4 spaces - no tabs.
Copyright : Copyright (c) 2016 Oculus VR, LLC. All Rights reserved.
Description : Vector, matrix and quaternion math.
Orig. Author : J.M.P. van Waveren
Orig. Date : 12/10/2016
Language : C99
Copyright : Copyright (c) 2016 Oculus VR, LLC. All Rights reserved.
DESCRIPTION
@ -51,6 +48,7 @@ XrVector2f
XrVector3f
XrVector4f
XrQuaternionf
XrPosef
XrMatrix4x4f
inline static void XrVector3f_Set(XrVector3f* v, const float value);
@ -64,8 +62,18 @@ inline static void XrVector3f_Scale(XrVector3f* result, const XrVector3f* a, con
inline static void XrVector3f_Normalize(XrVector3f* v);
inline static float XrVector3f_Length(const XrVector3f* v);
inline static void XrQuaternionf_CreateIdentity(XrQuaternionf* q);
inline static void XrQuaternionf_CreateFromAxisAngle(XrQuaternionf* result, const XrVector3f* axis, const float angleInRadians);
inline static void XrQuaternionf_Lerp(XrQuaternionf* result, const XrQuaternionf* a, const XrQuaternionf* b, const float fraction);
inline static void XrQuaternionf_Multiply(XrQuaternionf* result, const XrQuaternionf* a, const XrQuaternionf* b;
inline static void XrQuaternionf_Multiply(XrQuaternionf* result, const XrQuaternionf* a, const XrQuaternionf* b);
inline static void XrQuaternionf_Invert(XrQuaternionf* result, const XrQuaternionf* q);
inline static void XrQuaternionf_Normalize(XrQuaternionf* q);
inline static void XrQuaternionf_RotateVector3f(XrVector3f* result, const XrQuaternionf* a, const XrVector3f* v);
inline static void XrPosef_CreateIdentity(XrPosef* result);
inline static void XrPosef_TransformVector3f(XrVector3f* result, const XrPosef* a, const XrVector3f* v);
inline static void XrPosef_Multiply(XrPosef* result, const XrPosef* a, const XrPosef* b);
inline static void XrPosef_Invert(XrPosef* result, const XrPosef* a);
inline static void XrMatrix4x4f_CreateIdentity(XrMatrix4x4f* result);
inline static void XrMatrix4x4f_CreateTranslation(XrMatrix4x4f* result, const float x, const float y, const float z);
@ -74,13 +82,13 @@ inline static void XrMatrix4x4f_CreateRotation(XrMatrix4x4f* result, const float
inline static void XrMatrix4x4f_CreateScale(XrMatrix4x4f* result, const float x, const float y, const float z);
inline static void XrMatrix4x4f_CreateTranslationRotationScale(XrMatrix4x4f* result, const XrVector3f* translation,
const XrQuaternionf* rotation, const XrVector3f* scale);
inline static void XrMatrix4x4f_CreateProjection(XrMatrix4x4f* result, const float tanAngleLeft, const float tanAngleRight,
const float tanAngleUp, float const tanAngleDown, const float nearZ,
const float farZ);
inline static void XrMatrix4x4f_CreateProjectionFov(XrMatrix4x4f* result, const float fovDegreesLeft, const float fovDegreesRight,
const float fovDegreeUp, const float fovDegreesDown, const float nearZ,
const float farZ);
inline static void XrMatrix4x4f_CreateFromQuaternion(XrMatrix4x4f* result, const XrQuaternionf* src);
inline static void XrMatrix4x4f_CreateFromRigidTransform(XrMatrix4x4f* result, const XrPosef* s);
inline static void XrMatrix4x4f_CreateProjection(XrMatrix4x4f* result, GraphicsAPI graphicsApi, const float tanAngleLeft,
const float tanAngleRight, const float tanAngleUp, float const tanAngleDown,
const float nearZ, const float farZ);
inline static void XrMatrix4x4f_CreateProjectionFov(XrMatrix4x4f* result, GraphicsAPI graphicsApi, const XrFovf fov,
const float nearZ, const float farZ);
inline static void XrMatrix4x4f_CreateFromQuaternion(XrMatrix4x4f* result, const XrQuaternionf* quat);
inline static void XrMatrix4x4f_CreateOffsetScaleForBounds(XrMatrix4x4f* result, const XrMatrix4x4f* matrix, const XrVector3f* mins,
const XrVector3f* maxs);
@ -139,6 +147,8 @@ inline static float XrRcpSqrt(const float x) {
return rcp;
}
inline static float XrVector2f_Length(const XrVector2f* v) { return sqrtf(v->x * v->x + v->y * v->y); }
inline static void XrVector3f_Set(XrVector3f* v, const float value) {
v->x = value;
v->y = value;
@ -207,6 +217,13 @@ inline static void XrVector3f_Normalize(XrVector3f* v) {
inline static float XrVector3f_Length(const XrVector3f* v) { return sqrtf(v->x * v->x + v->y * v->y + v->z * v->z); }
inline static void XrQuaternionf_CreateIdentity(XrQuaternionf* q) {
q->x = 0.0f;
q->y = 0.0f;
q->z = 0.0f;
q->w = 1.0f;
}
inline static void XrQuaternionf_CreateFromAxisAngle(XrQuaternionf* result, const XrVector3f* axis, const float angleInRadians) {
float s = sinf(angleInRadians / 2.0f);
float lengthRcp = XrRcpSqrt(axis->x * axis->x + axis->y * axis->y + axis->z * axis->z);
@ -238,6 +255,58 @@ inline static void XrQuaternionf_Multiply(XrQuaternionf* result, const XrQuatern
result->w = (b->w * a->w) - (b->x * a->x) - (b->y * a->y) - (b->z * a->z);
}
inline static void XrQuaternionf_Invert(XrQuaternionf* result, const XrQuaternionf* q) {
result->x = -q->x;
result->y = -q->y;
result->z = -q->z;
result->w = q->w;
}
inline static void XrQuaternionf_Normalize(XrQuaternionf* q) {
const float lengthRcp = XrRcpSqrt(q->x * q->x + q->y * q->y + q->z * q->z + q->w * q->w);
q->x *= lengthRcp;
q->y *= lengthRcp;
q->z *= lengthRcp;
q->w *= lengthRcp;
}
inline static void XrQuaternionf_RotateVector3f(XrVector3f* result, const XrQuaternionf* a, const XrVector3f* v) {
XrQuaternionf q = {v->x, v->y, v->z, 0.0f};
XrQuaternionf aq;
XrQuaternionf_Multiply(&aq, &q, a);
XrQuaternionf aInv;
XrQuaternionf_Invert(&aInv, a);
XrQuaternionf aqaInv;
XrQuaternionf_Multiply(&aqaInv, &aInv, &aq);
result->x = aqaInv.x;
result->y = aqaInv.y;
result->z = aqaInv.z;
}
inline static void XrPosef_CreateIdentity(XrPosef* result) {
XrQuaternionf_CreateIdentity(&result->orientation);
XrVector3f_Set(&result->position, 0);
}
inline static void XrPosef_TransformVector3f(XrVector3f* result, const XrPosef* a, const XrVector3f* v) {
XrVector3f r0;
XrQuaternionf_RotateVector3f(&r0, &a->orientation, v);
XrVector3f_Add(result, &r0, &a->position);
}
inline static void XrPosef_Multiply(XrPosef* result, const XrPosef* a, const XrPosef* b) {
XrQuaternionf_Multiply(&result->orientation, &b->orientation, &a->orientation);
XrPosef_TransformVector3f(&result->position, a, &b->position);
}
inline static void XrPosef_Invert(XrPosef* result, const XrPosef* a) {
XrQuaternionf_Invert(&result->orientation, &a->orientation);
XrVector3f aPosNeg;
XrVector3f_Scale(&aPosNeg, &a->position, -1.0f);
XrQuaternionf_RotateVector3f(&result->position, &result->orientation, &aPosNeg);
}
// Use left-multiplication to accumulate transformations.
inline static void XrMatrix4x4f_Multiply(XrMatrix4x4f* result, const XrMatrix4x4f* a, const XrMatrix4x4f* b) {
result->m[0] = a->m[0] * b->m[0] + a->m[4] * b->m[1] + a->m[8] * b->m[2] + a->m[12] * b->m[3];
@ -379,23 +448,31 @@ inline static void XrMatrix4x4f_CreateTranslation(XrMatrix4x4f* result, const fl
}
// Creates a rotation matrix.
// If -Z=forward, +Y=up, +X=right, then degreesX=pitch, degreesY=yaw, degreesZ=roll.
inline static void XrMatrix4x4f_CreateRotation(XrMatrix4x4f* result, const float degreesX, const float degreesY,
const float degreesZ) {
const float sinX = sinf(degreesX * (MATH_PI / 180.0f));
const float cosX = cosf(degreesX * (MATH_PI / 180.0f));
// If -Z=forward, +Y=up, +X=right, then radiansX=pitch, radiansY=yaw, radiansZ=roll.
inline static void XrMatrix4x4f_CreateRotationRadians(XrMatrix4x4f* result, const float radiansX, const float radiansY,
const float radiansZ) {
const float sinX = sinf(radiansX);
const float cosX = cosf(radiansX);
const XrMatrix4x4f rotationX = {{1, 0, 0, 0, 0, cosX, sinX, 0, 0, -sinX, cosX, 0, 0, 0, 0, 1}};
const float sinY = sinf(degreesY * (MATH_PI / 180.0f));
const float cosY = cosf(degreesY * (MATH_PI / 180.0f));
const float sinY = sinf(radiansY);
const float cosY = cosf(radiansY);
const XrMatrix4x4f rotationY = {{cosY, 0, -sinY, 0, 0, 1, 0, 0, sinY, 0, cosY, 0, 0, 0, 0, 1}};
const float sinZ = sinf(degreesZ * (MATH_PI / 180.0f));
const float cosZ = cosf(degreesZ * (MATH_PI / 180.0f));
const float sinZ = sinf(radiansZ);
const float cosZ = cosf(radiansZ);
const XrMatrix4x4f rotationZ = {{cosZ, sinZ, 0, 0, -sinZ, cosZ, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}};
XrMatrix4x4f rotationXY;
XrMatrix4x4f_Multiply(&rotationXY, &rotationY, &rotationX);
XrMatrix4x4f_Multiply(result, &rotationZ, &rotationXY);
}
// Creates a rotation matrix.
// If -Z=forward, +Y=up, +X=right, then degreesX=pitch, degreesY=yaw, degreesZ=roll.
inline static void XrMatrix4x4f_CreateRotation(XrMatrix4x4f* result, const float degreesX, const float degreesY,
const float degreesZ) {
XrMatrix4x4f_CreateRotationRadians(result, degreesX * (MATH_PI / 180.0f), degreesY * (MATH_PI / 180.0f),
degreesZ * (MATH_PI / 180.0f));
}
// Creates a scale matrix.
inline static void XrMatrix4x4f_CreateScale(XrMatrix4x4f* result, const float x, const float y, const float z) {
result->m[0] = x;
@ -471,6 +548,11 @@ inline static void XrMatrix4x4f_CreateTranslationRotationScale(XrMatrix4x4f* res
XrMatrix4x4f_Multiply(result, &translationMatrix, &combinedMatrix);
}
inline static void XrMatrix4x4f_CreateFromRigidTransform(XrMatrix4x4f* result, const XrPosef* s) {
const XrVector3f identityScale = {1.0f, 1.0f, 1.0f};
XrMatrix4x4f_CreateTranslationRotationScale(result, &s->position, &s->orientation, &identityScale);
}
// Creates a projection matrix based on the specified dimensions.
// The projection matrix transforms -Z=forward, +Y=up, +X=right to the appropriate clip space for the graphics API.
// The far plane is placed at infinity if farZ <= nearZ.

View file

@ -5,5 +5,4 @@
# For customization when using a Version Control System, please read the
# header note.
#Thu Dec 12 20:21:11 GMT 2019
ndk.dir=C\:\\Users\\Simon\\AppData\\Local\\Android\\Sdk\\ndk\\21.1.6352462
sdk.dir=C\:\\Users\\Simon\\AppData\\Local\\Android\\Sdk

View file

@ -1,4 +1,2 @@
rootProject.projectDir = new File(settingsDir, '../..')
//rootProject.projectDir = settingsDir
rootProject.name = "JKXR"
include ':', 'Projects:Android'

View file

@ -7,25 +7,24 @@
[SideQuest Latest Version (Pico Headsets)](https://sidequestvr.com/app/15541)
[PCVR Installers (found on the latest release here)](https://github.com/DrBeef/JKXR/releases)
JK XR is a VR port of the Jedi Knight games using OpenXR (the open standard for virtual and augmented reality devices) and is based on the excellent OpenJK port, originally forked from: https://github.com/JACoders/OpenJK
This is currently built for standalone VR HMDs (see the Building section below) and will currently **not** run on any other device, the list of supported devices is: Meta Quest (1, 2, Pro) and Pico (3 & 4).
Support for PCVR based devices will hopefully come in the future.
The easiest way to install this on your device is using SideQuest. Download SideQuest here:
https://sidequestvr.com/setup-howto
### Jedi Knight: Jedi Outcast
### Jedi Knight: Jedi Outcast / Jedi Academy
The public release of JK XR currently supports the game Jedi Outcast; access to the Jedi Academy early-access build can be found on the Team Beef patreon (link below). However there are lots of mods and access to the free demo level available through the accomapnying JK XR Companion App, which is also installed alongside JK XR on SideQuest.
The public release of JK XR now supports the games Jedi Outcast and Jedi Academy.
## Team Beef Patreon
[![Team Beef Patreon](https://github.com/DrBeef/JKXR/blob/main/assets/PatreonBanner.jpg)](https://www.patreon.com/teambeef)
The Team Beef Patreon where you can find all the in-development early-access builds for JK XR with Jedi Academy support, as well as other active projects can be found.
The Team Beef Patreon where you can find all the in-development early-access builds other active Team Beef projects.
## Gameplay and VR Features
@ -68,22 +67,51 @@ The companion app will be installed at the same time when using the SideQuest of
You can find the latest version, which also includes the Companion App hosted on Sidequest. Use the links at the top of the page (separated by headset). Before installing via SideQuest you must have enabled "Developer Mode" on your headset. You can find the details on how to do that below:
Pico 3/4 Instructions
---------------------
https://trello.com/c/Idb627uv/47-pico-4-installation-instructions
Meta Quest Install Instructions
-------------------------------
https://trello.com/c/C0YTFpvX/48-quest-quest-2-installation-instructions
## Copying the Full Game files to your Oculus Quest
PCVR
----
Download the PCVR installers from the release page and use them to install to the game location.
### OpenXR runtimes information for PCVR Headsets
We recommend the following combinations to get the optimal experience while playing JKXR on PCVR:
**Valve Index** -> Via SteamVR (SteamVR OpenXR Runtime)
**HTC Vive** -> Via SteamVR (SteamVR OpenXR Runtime)
**Meta Headsets** -> Link / Airlink (Oculus OpenXR Runtime) / SteamLink / Virtual Desktop (VDXR or SteamVR)
**Windows Mixed Reality (WMR) Devices** (I.e. HP G2) -> Make sure you set the SteamVR to be the default OpenXR runtime.
**Pimax** -> Currently unplayable. We have been in discussions with Pimax and there is a new PimaxPlay that fixes the issues (upside down screens).
When released the game must be played via unofficial PimaxXR OpenXR runtime (https://github.com/mbucchia/Pimax-OpenXR). Do not play via SteamVR OpenXR runtime
**Pico** - Virtual Desktop (VDXR or SteamVR) / Streaming Assistant (Currently Untested)
## Copying the Full Game files to your Meta Quest / Pico
Before you are able to run the full game of Jedi Knight: Jedi Outcast in VR you will need to:
- Install JK XR thought SideQuest (this will also install the companion app)
- Start JK XR for the first time, it will ask for appropriate permissions (which you must allow), create the necessary folders and then close down
- You can now run the Companion App. This will check that it has the files for the full game.
- (optional) Copy only the assets files (assets0.pk3, assets1.pk3, assets2.pk3, assets5.pk3) from your PC install of JKO (Jedi Outcast\GameData\base) into the following folder on your device:
- Copy only the assets files (assets0.pk3, assets1.pk3, assets2.pk3, assets5.pk3) from your PC install of JKO (Jedi Outcast\GameData\base) into the following folder on your device:
\JKXR\JK2\base
or
\JKXR\JK3\base
- You must then use the Companion App to download any mods and start the game. It is possible to play the JK Demo without having copied across the full game assets. All other mods require the full game.
@ -108,6 +136,9 @@ This control scheme on how to play can also be found in the Controls -> JKXR HEL
![Control Scheme](https://github.com/DrBeef/JKXR/blob/main/z_vr_assets_base/gfx/menus/control_scheme.jpg)
## Building from Source
If you wish to build JK XR from source, then you need the following:
@ -121,6 +152,9 @@ There is no dependency on any specific headset native libraries, as this port us
JKXR\Projects\Android\libs\arm64-v8a
PCVR instructions will follow in the future (when I get round to adding them),
## Credits
* Team Beef are DrBeef, Baggyg, Bummser
@ -128,7 +162,9 @@ JKXR\Projects\Android\libs\arm64-v8a
* JKXR Companion App: BaggyG
* Additional Development Contributions: MuadDib, BaggyG
* VR Compatible Weapon Models: Vince Crusty and Elin
* With Special Thanks to: Team Beef patrons, all Team Beef discord members,
* VR Compatible Hand Models: LennyGuy20
With Special Thanks to: Team Beef patrons, all Team Beef discord members,
the OpenJK Development Team and Raven Software for
creating and open-sourcing these wonderful games

Some files were not shown because too many files have changed in this diff Show more