View previous topic :: View next topic |
Author |
Message |
hondobondo
Joined: 26 Sep 2006 Posts: 102
|
Posted: Fri Feb 06, 2009 12:33 am Post subject: top down camera |
|
|
I am working on a gauntlet style mod. i can make the camera look down, but mouse look breaks that. if i disable mouselook, i still can't get aim to work. he just shoots at the ground. is there a way to fix the aim to just shoot straight ahead? i use normalize((self.origin+v_forward*500) - self.origin) but that makes him shoot however the mouse is aiming. how do i get him to just shoot from the origin+view_ofs to a point say 100 units straight ahead? |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Fri Feb 06, 2009 4:22 am Post subject: |
|
|
m_pitch 0
Evil, I know, but it stops mouselook from doing anything in pretty much all engines.
Clear out self.v_angle_x on the server before doing makevectors. This will set their angles as pure yaw (and a bit of roll, but that doesn't affect forwards), meaning that forward really is forward, even if their client ignored the m_pitch thing, and will always be properly normalised too.
The alternative is to 'tweek' the v_forward vector and set v_forward_z=0, but that's ugly, and breaks in certain clients/settings. And it needs normalising as well.
Clearing out their pitch is the more correct way to do it.
normalize((self.origin+v_forward*500) - self.origin)
is more simply written as:
v_forward
just so you know. :)
So yeah...
self.v_angle_x = 0;
makevectors(self.v_angle);
source = self.origin + self.view_ofs;
target = source + v_forward*500;
you prolly want a traceline here
impact would then be at trace_endpos but then you knew that already. mneh _________________ What's a signature? |
|
Back to top |
|
 |
MauveBib

Joined: 04 Nov 2004 Posts: 602
|
Posted: Fri Feb 06, 2009 4:28 am Post subject: |
|
|
WriteByte (MSG_ONE, 10); // 10 = SVC_SETVIEWANGLES
WriteAngle(MSG_ONE, vec_x); // tilt
WriteAngle(MSG_ONE, vec_y); // yaw
WriteAngle(MSG_ONE, vec_z); // flip _________________ Apathy Now! |
|
Back to top |
|
 |
hondobondo
Joined: 26 Sep 2006 Posts: 102
|
Posted: Fri Feb 06, 2009 4:14 pm Post subject: thanks dudes |
|
|
totally owe you both. graces |
|
Back to top |
|
 |
hondobondo
Joined: 26 Sep 2006 Posts: 102
|
Posted: Fri Feb 06, 2009 6:05 pm Post subject: thanks spike |
|
|
Spike wrote: | m_pitch 0
Evil, I know, but it stops mouselook from doing anything in pretty much all engines.
Clear out self.v_angle_x on the server before doing makevectors. This will set their angles as pure yaw (and a bit of roll, but that doesn't affect forwards), meaning that forward really is forward, even if their client ignored the m_pitch thing, and will always be properly normalised too.
The alternative is to 'tweek' the v_forward vector and set v_forward_z=0, but that's ugly, and breaks in certain clients/settings. And it needs normalising as well.
Clearing out their pitch is the more correct way to do it.
normalize((self.origin+v_forward*500) - self.origin)
is more simply written as:
v_forward
just so you know.
So yeah...
self.v_angle_x = 0;
makevectors(self.v_angle);
source = self.origin + self.view_ofs;
target = source + v_forward*500;
you prolly want a traceline here
impact would then be at trace_endpos but then you knew that already. mneh |
that works. now for the fun stuff. i can probably have a working beta with monsters and a map or two by monday |
|
Back to top |
|
 |
Boss429
Joined: 03 Dec 2006 Posts: 22
|
Posted: Tue Feb 10, 2009 6:04 pm Post subject: |
|
|
slightly off topic, but is m_pitch a cvar? |
|
Back to top |
|
 |
mh

Joined: 12 Jan 2008 Posts: 910
|
Posted: Tue Feb 10, 2009 6:08 pm Post subject: |
|
|
Yup, but don't even think about setting it's value through QC unless you're doing something like this that has a specific requirement, OK?  _________________ DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines |
|
Back to top |
|
 |
|