Watch
2
0
Fork
You've already forked raylib-cs
0

Fixed VR issue

- Fixed werid graphical bug with VR. Issue was with the struct for VrDeviceInfo.
This commit is contained in:
Rgebee 2018-11-22 15:00:25 +00:00
commit 2e6a583193
8 changed files with 62 additions and 131 deletions

View file

@ -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");
}
}
}
}
}

View file

@ -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 );

View file

@ -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 * * This example has been created using raylib 1.8 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * * Copyright (c) 2017 Ramon Santamaria (@raysan5) * ********************************************************************************************/
public const int CUBEMAP_SIZE = 512;
@ -124,7 +111,6 @@ public partial class models_material_pbr
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0; }
// Load PBR material (Supports: ALBEDO, NORMAL, METALNESS, ROUGHNESS, AO, EMMISIVE, HEIGHT maps)
// NOTE: PBR shader is loaded inside this function
unsafe public static Material LoadMaterialPBR(Color albedo, float metalness, float roughness)
@ -262,5 +248,3 @@ public partial class models_material_pbr
SetShaderValue(shader, light.colorLoc, diff, 4);
}
}