mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-06-30 19:03:42 -04:00
Fixed VR issue
- Fixed werid graphical bug with VR. Issue was with the struct for VrDeviceInfo.
This commit is contained in:
@ -34,7 +34,7 @@ namespace Examples
|
||||
var filePath = Console.ReadLine();
|
||||
var name = Path.GetFileNameWithoutExtension(filePath);
|
||||
var dir = examples + filePath + ".cs";
|
||||
|
||||
|
||||
// run example if it exists
|
||||
if (File.Exists(dir))
|
||||
{
|
||||
@ -46,14 +46,14 @@ namespace Examples
|
||||
catch(TargetInvocationException e)
|
||||
{
|
||||
Console.WriteLine(e.InnerException.Message);
|
||||
Console.WriteLine(e.InnerException.StackTrace);
|
||||
Console.WriteLine(e.InnerException.StackTrace);
|
||||
}
|
||||
Console.WriteLine();
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine(filePath + " is not a valid example");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,19 +26,18 @@ public partial class core_vr_simulator
|
||||
int screenHeight = 600;
|
||||
|
||||
// NOTE: screenWidth/screenHeight should match VR device aspect ratio
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - vr simulator");
|
||||
|
||||
// Init VR simulator (Oculus Rift CV1 parameters)
|
||||
InitVrSimulator(GetVrDeviceInfo(HMD_OCULUS_RIFT_CV1));
|
||||
InitVrSimulator(GetVrDeviceInfo((int)HMD_OCULUS_RIFT_CV1));
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera3D camera;
|
||||
camera.position = new Vector3( 5.0f, 2.0f, 5.0f ); // Camera3D position
|
||||
camera.target = new Vector3( 0.0f, 2.0f, 0.0f ); // Camera3D looking at point
|
||||
camera.up = new Vector3( 0.0f, 1.0f, 0.0f ); // Camera3D up vector (rotation towards target)
|
||||
camera.fovy = 60.0f; // Camera3D field-of-view Y
|
||||
camera.type = (int)CAMERA_PERSPECTIVE; // Camera3D type
|
||||
camera.fovy = 60.0f; // Camera3D field-of-view Y
|
||||
camera.type = (int)CAMERA_PERSPECTIVE; // Camera3D type
|
||||
|
||||
Vector3 cubePosition = new Vector3( 0.0f, 0.0f, 0.0f );
|
||||
|
||||
|
@ -1,8 +1,5 @@
|
||||
using Raylib;
|
||||
using static Raylib.Raylib;
|
||||
using static Raylib.Model;
|
||||
using static Raylib.CameraMode;
|
||||
using System;
|
||||
|
||||
public enum LightType
|
||||
{
|
||||
@ -26,18 +23,8 @@ public struct Light
|
||||
public int colorLoc;
|
||||
}
|
||||
|
||||
|
||||
public partial class models_material_pbr
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [models] example - PBR material
|
||||
@ -124,7 +111,6 @@ public partial class models_material_pbr
|
||||
DrawFPS(10, 10);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@ -262,5 +248,3 @@ public partial class models_material_pbr
|
||||
|
||||
UpdateLightValues(shader, light);
|
||||
lightsCount++;
|
||||
}
|
||||
return light;
|
||||
|
Reference in New Issue
Block a user