Quote: "I had earlier tried to incorporate the AGK VR Plugin code with your GGLoader code without any success. But this was only because I was diving headfirst without actually knowing what I was doing. "
for anyone wondering, yes you can use the VR DLC with GG Loader but you will need to know how to use the VR DLC first to setup the headset etc and then to track the player (it's really quite simple but needs a bit of getting used to).
the basics looks like this (note you must copy over the required dll files to your project for the VR DLC to work (this is same with or without GG Loader).
one time setup code (best to place this below Prebens code but just before the main DO - Loop so his world will generate first).
#import_plugin AGKVR
RightEyeImg As Integer = 500
LeftEyeImg As Integer = 501
headobj = CreateObjectBox(0.03,0.06,0.03)
SetObjectVisible(headobj,0)
AGKVR.Init(RightEyeImg, LeftEyeImg)
AGKVR.SetTrackingSpace(1) //standing mode
AGKVR.SetCameraRange( 0.01, 1000.0 ) //how far camera can draw
AGKVR.SetPlayerPosition(getcamerax(1), getcameray(1), getcameraz(1)) //place the player
AGKVR.LockPlayerTurn( 0 )
AGKVR.LockPlayerPitch( 0 )
AGKVR.UpdatePlayer()
note the above code doesn't check for errors and will always assume VR mode so add your own checks etc.
now in the DO - LOOP add
SetCameraPosition( 1, AGKVR.GetHMDX(), AGKVR.GetHMDY(), AGKVR.GetHMDZ())
SetCameraRotation( 1, AGKVR.GetHMDAngleX(), AGKVR.GetHMDAngleY(), AGKVR.GetHMDAngleZ())
SetObjectPosition(headobj,AGKVR.GetHMDX(), AGKVR.GetHMDY(), AGKVR.GetHMDZ())
SetObjectRotation(headobj,AGKVR.GetHMDAngleX(), AGKVR.GetHMDAngleY(), AGKVR.GetHMDAngleZ())
AGKVR.UpdatePlayer( )
AGKVR.Render()
sync()
for testing i just added an IF to ignore all of the code already in the DO LOOP so it only updates the VR DLC (you can add parts back as you need them).
note this only adds and updates the head but the hands are pretty much the same code, just replace headobj with the desired handobj (you don't even really need the headobj for testing but it's useful for collision purposes later).