View previous topic :: View next topic |
Author |
Message |
Quake Matt

Joined: 05 Jun 2005 Posts: 129
|
Posted: Mon Oct 30, 2006 7:54 pm Post subject: 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! |
|
Back to top |
|
 |
FrikaC Site Admin

Joined: 08 Oct 2004 Posts: 947
|
Posted: Wed Nov 01, 2006 10:35 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
Quake Matt

Joined: 05 Jun 2005 Posts: 129
|
Posted: Sun Nov 05, 2006 12:08 pm Post subject: |
|
|
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? |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Mon Nov 06, 2006 11:53 pm Post subject: |
|
|
If you are making your own physics then you can prevent the player from going through walls whatever their movetype is. _________________ What's a signature? |
|
Back to top |
|
 |
Quake Matt

Joined: 05 Jun 2005 Posts: 129
|
Posted: Tue Nov 07, 2006 1:23 pm Post subject: |
|
|
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...
Last edited by Quake Matt on Tue Nov 07, 2006 11:26 pm; edited 1 time in total |
|
Back to top |
|
 |
FrikaC Site Admin

Joined: 08 Oct 2004 Posts: 947
|
Posted: Tue Nov 07, 2006 9:23 pm Post subject: |
|
|
I think you may have misunderstood me, but I don't have enough energy to sort it out.
Anywho, MOVETYPE_FLY works perfectly well on the player except in umodified QuakeWorld. |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Wed Nov 08, 2006 2:22 am Post subject: |
|
|
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'.  _________________ What's a signature? |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Wed Nov 08, 2006 2:42 am Post subject: |
|
|
I don't think noclip does pitch. Maybe in QW... _________________ F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe. |
|
Back to top |
|
 |
|