Inside3D!
     

Floating Camera

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Quake Matt



Joined: 05 Jun 2005
Posts: 129

PostPosted: Mon Oct 30, 2006 7:54 pm    Post subject: Floating Camera Reply with quote

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
View user's profile Send private message
FrikaC
Site Admin


Joined: 08 Oct 2004
Posts: 947

PostPosted: Wed Nov 01, 2006 10:35 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Quake Matt



Joined: 05 Jun 2005
Posts: 129

PostPosted: Sun Nov 05, 2006 12:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Mon Nov 06, 2006 11:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Quake Matt



Joined: 05 Jun 2005
Posts: 129

PostPosted: Tue Nov 07, 2006 1:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
FrikaC
Site Admin


Joined: 08 Oct 2004
Posts: 947

PostPosted: Tue Nov 07, 2006 9:23 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Wed Nov 08, 2006 2:22 am    Post subject: Reply with quote

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'. Smile
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Wed Nov 08, 2006 2:42 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group