Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

69 camera endpoint #77

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open

69 camera endpoint #77

wants to merge 61 commits into from

Conversation

tcannonfodder
Copy link
Member

This adds the Camera Endpoint, along with support for .mp4, .json, and .txt files.

This closes #69

Thomas Cannon added 30 commits July 27, 2016 09:44
* Still working on rendering scenes completely without a broken clipping
frame
Remove unused properties
Rename containers for Camera objects
Since different flight modes have different camera configurations,
CameraCapture should be more flexible. A blacklist selection of cameras
to render should make the mod more resilient to changes to the core
game.
There will be more code surrounding camera snapshots, so it should be
moved into its own namespace for readability
Abstracting the logic to take a snapshot from a set of cameras into its
own class makes rendering other camera types easier in the future.
This is the progress I've made on an internal IVA camera. I'm tabling
this work for now to work on RPM cameras, because it's a "nice to have"
and I can't figure out how to render the internal scene constantly
without disrupting gameplay.
This is a first stab at hooking up a custom module to
JSIPrimitiveExternalCameras and grabbing info from the RasterPropMonitor
module
This is a WIP that fleshes out the RasterPropMonitorCamera class to
include details from RasterPropMonitor, and register the camera with a
singleton manager that will be used to get the active list of RPM
cameras, and a Capture class responsible for taking a screenshot from
the camera.
Moving the logic for duplicating cameras and rendering a screenshot into
a base class gives a common ground for the different camera types and
makes it easier to write a single class to manage them.
using CameraCapture as the base class for cameras in the manager makes
the manager general so it can be used by the responsibility.
Managed to get RPM cameras to point at the right location, but need to
tweak more settings and camera effects
* Made the camera naming prefix dynamic to prevent naming collisions
with multiple RPM cameras
* Fixed the FOV of near-field cameras, based on:
https://github.com/Mihara/RasterPropMonitor/blob/ba5348e7b3716206e404ec937e59ea626fc5030e/RasterPropMonitor/Core/FlyingCamera.cs#L240
* Improved debugging for camera details
* Fix the update loop to skip transforming far-away cameras
* Fix the update loop to translate camera positions
This list of cameras includes the camera names, types, and hypermedia
URLs. The idea is that clients check this endpoint, then follow the
hypermedia URL to the camera they'd like to view
`telemachus/cameras` returns the list of cameras, and
`telemachus/cameras/X` returns the camera with that name, if the camera
is present.
* Rendering images as JPEGs drastically reduces file size
* Also bumped up the resolution to 640px to give the user a better view.
…thod

This makes it possible for actual camera prop modules to use the method
to build the camera string.
* Fix removeCamera to lowercase the key
* Keep a mapping of the cameras a vessel has assigned to it so we don't
accidentally remove a camera on the vessel with that name when switching
to the vessel.
This makes sure the CameraManager always has an accurate list of
cameras.
Thomas Cannon and others added 25 commits August 7, 2016 17:07
Also re-enable raster prop monitor cameras
* The methods to duplicate and reposition a camera will not be called
until the mutex has been removed
The new yield structure will have us waiting until the frame is finished
rendering, then capturing the image. We'll also wait a few seconds
before releasing the mutex to improve performance.
By disabling the unity cameras behind a cameracapture until we need them
we can improve the framerate on the off-frames where a camera snapshot
is not being rendered.
This actually renders the image to be stored in the cache
The Camera Manager should be responsible for the flight camera, not the
camera responsibility server. This hopefully will fix a memory issue
when switching from flight mode to the editor.
Offsetting the camera snapshot rendering by an odd number appears to
improve the overall perceived performance by spreading out the cost of
copying data from the GPU to the CPU. incrementing by .3 gives us a
reasonsable chance of avoiding stacking changes while making sure the
updates happen quickly.
When rendering a camera snapshot we need to make sure to copy the
settings from the current game camera. This ensures we grab subtle
changes like the galaxy camera transforms.
The reposition camera method should have called the base method to
reposition the camera to make sure the translation is maintained.
Hook into additionalCameraUpdates instead of redefining repositionCamera
to improve performance.
Attempting this to see if it improves performance and camera jittering,
it appears to.
Adding .mp4, .json, and .txt for add-on mod support (ie. KSP PAO). Allows for mp4 video files, json data and txt files to used internally or externally with Telemachus interface.
Update IOPageResponsibility.cs (adding .mp4,.json and .txt MIME types/support)
Should use the TextContent
Certain ngrok configurations pass an "X-Original-Host" header as part of
the request if the host header is rewritten. This adds support for
detecting and using that header to make the Camera listing endpoint
seamless for clients using an ngrok URL
@zachmayer
Copy link

Are you planning to merge this?

@tcannonfodder
Copy link
Member Author

Hey Zach! I'd like to soon, but first I have to get the mod running with the latest version of Kerala, which introduced some breaking changes. Life's been pretty hectic, so I haven't had time to rewrite the broken parts of the code base.

@zachmayer
Copy link

Ahh, good to hear! What's Kerala ?

@tcannonfodder
Copy link
Member Author

Apparently that's what autocorrect decided "Kerbal" meant! 😜

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add API endpoint for getting camera image from KSP
3 participants