Floating Camera
Moderator: InsideQC Admins
8 posts
• Page 1 of 1
Floating Camera
Hi, guys!
I'm going to write a tutorial for a friend about making a floating camera, like you'd get in a spectator mode, but I'm not sure if my way is the right way.
The most obvious way to fly would be to use movetype_fly, but I never got it to work properly. Instead, I left the player on the regular walking movetype and just offset gravity every prethink, making sure to keep fl_onground in check. It works nicely as far as I can tell, but I'm a bit concerned about the effect it'd have on some engines and also how well it'd behave in multiplayer.
As for controls, I hijacked the player's velocity vector every frame to 'read' keypresses. This is handy because I can then write my own movement system but, again, is it the best way?
Thanks in advance!
I'm going to write a tutorial for a friend about making a floating camera, like you'd get in a spectator mode, but I'm not sure if my way is the right way.
The most obvious way to fly would be to use movetype_fly, but I never got it to work properly. Instead, I left the player on the regular walking movetype and just offset gravity every prethink, making sure to keep fl_onground in check. It works nicely as far as I can tell, but I'm a bit concerned about the effect it'd have on some engines and also how well it'd behave in multiplayer.
As for controls, I hijacked the player's velocity vector every frame to 'read' keypresses. This is handy because I can then write my own movement system but, again, is it the best way?
Thanks in advance!
-

Quake Matt - Posts: 129
- Joined: Sun Jun 05, 2005 9:59 pm
I'd say go with movetype_noclip - the benefit is that if the camera is near a wall or floor the velocity measurement taken won't be truncated by a collision and you don't really need to worry about FL_ONGROUND ever appearing/disappearing. As far as keypresses, yeah, that's probably the best method.
- FrikaC
- Site Admin
- Posts: 1026
- Joined: Fri Oct 08, 2004 11:19 pm
I think I'd rather not let the player go through walls, though. Is it possible to use movetype_fly at all, or is that restricted only to non-player entities?
-

Quake Matt - Posts: 129
- Joined: Sun Jun 05, 2005 9:59 pm
If you are making your own physics then you can prevent the player from going through walls whatever their movetype is.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Hmm, true. Moving brushes may prove problematic, however, but solving it's probably beyond the scope of the tutorial anyway.
I'll play around and see what I can come up with, I guess.
Edit: Silly typo...
I'll play around and see what I can come up with, I guess.
Edit: Silly typo...
Last edited by Quake Matt on Tue Nov 07, 2006 11:26 pm, edited 1 time in total.
-

Quake Matt - Posts: 129
- Joined: Sun Jun 05, 2005 9:59 pm
MOVETYPE_FLY has flat movement direction while noclip has more consistant directions (noclip responds to pitch).
I think...
you could always make a second entity for the camera to represent the solidity. If using noclip the player will harmlessly clip straight through it. Just make it invisible and everything is fine. (with quakeworld, make sure you move the solid ent yourself without relying on movetypes, or make sure you set the 'newmis' entity appropriatly).
Just to clarify FrikaC's comment... Unmodified QuakeWorld is really sucky, and totally ignores the movetype field on player entities, so movetype_fly is no worse than movetype_noclip in this respect.
If you are making a QW mod, just get the user to use zquake / fte and type 'observe'.
I think...
you could always make a second entity for the camera to represent the solidity. If using noclip the player will harmlessly clip straight through it. Just make it invisible and everything is fine. (with quakeworld, make sure you move the solid ent yourself without relying on movetypes, or make sure you set the 'newmis' entity appropriatly).
Just to clarify FrikaC's comment... Unmodified QuakeWorld is really sucky, and totally ignores the movetype field on player entities, so movetype_fly is no worse than movetype_noclip in this respect.
If you are making a QW mod, just get the user to use zquake / fte and type 'observe'.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest