So, hi there people of earth. And if you have modded dawn of war then you should already know who i am
This is my first post and I thought it would be something helpful. I know there is many ways to do cameras and this may not be the type of camera you need for your project.
But as i looked around, I didn’t see any that really did what i wanted it to. And what better way to learn things by making your own?
So, what this camera does:
It allows you to toggle between 1st person and 3rd person views using only one camera.
You can also zoom in and out to each view with just the mouse wheel.
You can limit how far the zoom goes in and out.
In 1st person view, it uses the Field of view, while in 3rd person uses the camera spring arm component.
This camera is ideal for similar games to World of tanks and most shooters or RPG’s. (Morrowind camera for example)
How this camera interacts with your character, such as 1st person view changing how your character mesh (Like rotating the turret and camera against the tank) is something i haven’t implemented yet, but may try to do in the future.
Toggling the camera:
This checks what camera state it is, and then resets the field of view and position.
this checks what state the camera is in and what to use when zooming. It also checks whether the camera is in its neutral position and whether to toggle its state that way.
Min camera distance: 20.0
max camera distance: 320.0
Min Field of View: 30.0
Max Field of View: 90.0
Zoom Increment: 10
The string values shown in the pics are debugs so i can see where the actual camera position or field of view is and make adjustments. You should bypass them once you don’t need them or make a debug bool for them.
Hope this helps somebody.