New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera Implementation #29
Comments
|
Nice research! When this will be out, maybe I will do some kind of advanced Vehicle-Spawner with a vehicle preview |
|
Okay, so all the basic features are done. I decided not to wait on CameraShake and added that in as well Here's an example: I wasn't sure whether to make it necessary for users to set
For the scripted camera, I wrapped up the shaking functions in properties, and keep track of state internally. The For GameplayCamera shaking, I couldn't do the same thing, as the game can change these values, and there's no way of querying the current CameraShake/amplitude. |
|
This is really a very good research and job to say the least. |
|
Nice work woz, I couldn't find out how to use the camera functions. It's a pain when they have misnomer function names like SET_CAM_ACTIVE, when by definition it doesn't (Well at least not what you think it means) |
|
Thanks everyone. I agree, I think the potential of what can be done is petty cool. I'm thinking about maybe making something like Rockstar Editor, which I found to be a great idea, but still a little limiting. I'm also seeing some |
|
Suggestion: Make World.RenderingCamera writable and in the setter make the passed camera active and enable script camera rendering. If assigning null disable script camera rendering. |
|
Ya, that sounds good. World.IsScriptCameraRendering seemed a little messy to me. I'll make the changes |
|
Okay, so World.IsScriptCameraRendering is gone. Now, |
|
Implemented long time ago in #33 :) |
I've been working on Camera functions, trying figuring out what they all do, and I thought I'd share what I've found, before I submit a pull request in a day or so when it's ready.
It seems there are at least 2 different types of cameras, the GameplayCamera, and scripted cameras created by scripts. Each have there own set of natives assosciated with them, and the ones for the GameplayCamera are pretty limited. It isn't possible to get a handle to the GameplayCamera, there are only a few functions that access and modify certain properties (
GET_GAMEPLAY_CAM_COORD,GET_GAMEPLAY_CAM_ROT, etc).There is a lot more control over scripted cameras. They can be created with
CREATE_CAMor more oftenCREATE_CAM_WITH_PARAMS, which return an ID, it's possible to get/set most of their properties, interpolate between them, attach/lookAt targets, etc. Each creation function takes a string name, ie"DEFAULT_SCRIPTED_CAMERA","DEFAULT_SPLINE_CAMERA", and a few others. I've only tested using"DEFAULT_SCRIPTED_CAMERA"so far, as it's the most commonly used oneCreating a camera sets it as active, but that's not enough for it to render.
RENDER_SCRIPT_CAMSmust be called. I'm not sure what all the params are, only that the first is a bool that sets whether to render scripted cameras or the GameplayCamera. Using the common values from the scripts for the others seems to workThere seems to be a hard limit of 26 scripted cameras that can be created at a time. After that, calling
CREATE_CAMwill return an invalid ID, until other cameras are destroyed withDESTROY_CAMSo far, I've wrapped most of the scripted camera functions into a Camera class. I made a static factory method,
World.CreateCamera, as well as a few other static methods (eg,DESTROY_ALL_CAMS). I've also made a World::IsScriptCameraRendering property, that sets theRENDER_SCRIPT_CAMSnative I mentionedUnless someone objects, I'm going to make GameplayCamera an abstract class, similar to Game and World, as it only has a few static methods. I thought about making it a static property of Game, similar to Player, ie using it as Game.Camera, but I think that would be confusing for users, as it won't actually be a Camera object
Once I wrap the GameplayCamera, probably tomorrow, I'll make the pull request. After that, the remaining things that I see now would be:
-CameraShake
-CameraAnimation
-Special types of scripted cameras, ie spline, cinematic, I'm not sure at all how these work yet
-Any other natives I may have missed, as well as the unknown ones that are still hashed
Once this is in a release, I can share the Top Down mod I've been working on while researching all this =)
I'd be happy to hear any thoughts/suggestions anyone has about any of this
The text was updated successfully, but these errors were encountered: