How to check programmatically if WP8 device has front facing camera - c#

I am creating an app with multiple functionalities one of those needs access to front facing camera. I do not set it as a necessity to install the app in the manifest because I want the user to have access to the other functionalities even if front facing camera is not present. I do need however to notify the user whenever he starts said functionality that front facing camera is needed and it cannot run. How can that be done programmatically?
I have searched around the web and only found ways to exclude devices that do not have a front facing camera. That is not what I need however and I am wondering if it is even possible to do so....

The Microsoft.Devices.Camera class offers information like
Camera.IsCameraTypeSupported(CameraType.FrontFacing)
I've found more info about creating and manipulating cameras here on MSDN.

Related

How to open chrome and display as texture in game c# / unity

Ok, so my client wants a feature where the person should be able to find an image through google during their game. I'm not sure, the only idea I've had would be to basically screen record the specific application then apply it as a texture to a cube. It is also in VR so the Chrome searching has to be done specifically in application. Any suggestions?
you could do a screen capture kind of thing -
i stumbled upon a video when i was trying to get some embeded browser functionality going:
https://www.youtube.com/watch?v=lMLSACaaOjU
as the above shows you could take a capture based off of a certain click then whatever texture coding would come after that capture
also on the asset store there are assets which are costly that already contain embedded web browser depending on the platform.
https://assetstore.unity.com/packages/tools/gui/embedded-browser-55459
https://assetstore.unity.com/packages/tools/gui/3d-webview-for-android-137030
aside from that you would have to program the results returned from the google web search request made (unitywebrequest) and allow your client to select the image

Placing objects at set locations in a pre-scanned room

Objective:
I have a pre-scanned spatial map of a room. (Carried out through an onboarding process.)
We take that map and add holographic locations/markers/digital twins to it in Unity, at pre-defined static locations. E.g wallspace, fittings, etc.
The app is then launched and contains all the holographic data in the correct location, irrespective of the users physical start location.
In short, I want an app to start, with pre-defined holograms at set locations in the real world, irrespective of where the app is started within that room.
I have read lots of tutorials and walkthroughs etc on Spatial Mapping, Spatial Understanding etc. but they do not seem to solve my problem.
I have already downloaded the 3D spatial map of the room using the hololens web browser interface, and placed holograms using Unity, with their respective scripts etc.
Now, when I start the app, all of the holograms are created correct relative to eachother, but they are only in the right place if I start the app stood at a set point, looking in a set direction.
The main idea has been to find the spatial anchors for the room, (I don't know where I get these from in the created spatial map!) and then once they are found, rotate/translate the holographic world to match the live scanned spatial anchors.
Other methods include:
- placing all the objects manually in some config first-run of the app
- creating qr codes and placing them in set locations to act in the same way as the spatial anchors in the main idea above.
Has anyone done this, and is there a better way of spawning pre-defined holograms at real-world locations every app run?
Other questions looking for similar answers, but not solving my use-case:
https://forums.hololens.com/discussion/2938/position-independent-object-placement
https://forum.unity.com/threads/how-do-i-refer-to-a-specific-space-in-a-spatial-mapped-room.425525/
You will need to setup World anchors to let Hololens remember the position of holograms in your scanned space. (More info)
I tried it and this works pretty well.
placing all the objects manually in some config first-run of the app
This is the easiest course of action you could take. Basically I would add a TapToPlace script to all of your Holograms that you want to anchor. When you first launch the app they will be in whatever place you have them in Unity. However, once you close the application and open it back up it will be in the same spot in which you put them. If you don't want the user to be able to move them so easily I would add some type of method that disables the TapToPlace with a button click or speech command.
You can find the TapToPlace script in the MRTK. This is a very easy way because you don't have to learn about Attaching and Removing World Anchors because it is done for you already.

c# directshow multiple windows handling

I have problem with handling multiple video windows in directshow.
I have app in c# that captures video stream of my webcam and sends it through infinite pin tree to 2 separate renderers. When I run the app each of the renderers gets its own VideoWindow. Now when I set VideoWindow Style I can see changes only on one of them (looks like it is 2nd renderer window). Secound window is not effected at all. What should I do to access both of them? There is only one graph to build entire thing. Is there a way to reference videowindow by the renderer not by the graph? I was looking around web but there is nothing thats was able to point me in to good direction.

Unity adding the host as a player when starting the server

Currently im trying to make a lobby system for my game, the lobby system seems to have quite a few issues but im slowly working my way through them. I cannot however, find out a way to make the host automatically get added as a player in the game, when he starts a server. There will never be a situation where the host will only act as the server, so i need him to automatically get added to the game.
I have tried a bunch of different things with ClientScene.AddPlayer() But i cannot make this work.
Further, i cannot find any documentation on what functions the different buttons on the standard unity network lobby hud actually do, so i have a hard time replicating the behaviour.
Anyone has any good sources /ideas on the issue?
There is a method in the given NetworkManager called StartHost(). Try this for starting the server.
See the Scripting API for NetworkManager.StartHost() and all the methods from the NetworkManager
You have to write a custom UI and network manager to eliminate the Start Server GUI option which is by default provide by the Unity Networking GUI component. You can view this simple tutorial (UI & Custom Net Manager) to understand it.

WP7 Mango - navigation inside buildings

I'm currently working on a app that should be able to navigate you inside a building - the basic idea is to have the building schematics, floor by floor and on every floor it tells you where to go to get to the next one. Once you are on the next floor, you press a button and its schema appears.
While this works fine, I came across and idea to automatize it - use the buildings WiFi access points, meassure the strength of the signal and triangulate your position. However, I read that in WP7 there is no way to access available WiFi networks. Does it still apply in Mango? Or is there some workaround?
Or any other idea how to automatize navigation inside building?
There's no API for WiFi (neither with Mango), and as such, you can't triangulate any positions from it.
And there's no workaround.

Categories

Resources