Welcome, Guest. Please login or register.

Login with username, password and session length
   Home   Help Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: MouseWheel Zoom  (Read 386 times)
RoCkInG
Newbie
*
Posts: 3


View Profile
« on: December 29, 2009, 12:59:12 AM »
Reply with quoteQuote

can someone post me SMOKEZ ZBOT mousewheel zoom so i can try convert it to C++ please?
id get it myself but having problems downloading the source
Logged
NetzTeil
Guest


Email
« Reply #1 on: January 01, 2010, 04:58:35 PM »
Reply with quoteQuote Modify messageModify

Code:
--MouseWheelUp
if (Key == 0xEC) and (Action == 1) then

if (iBehindview == 1) then

fCurCameraDist = MyPC.FMax((fCurCameraDist + 1.00), 2.00)
MyPC.CameraDist = fCurCameraDist

else if bMouseWheelZoom then

MyPC.DesiredFOV = MyPC.Max(MyPC.FovAngle - 15, 3)

end
end
end
Logged
smokez
Administrator
Senior Member
*****
Posts: 266


167413143 smoke@smokez.de Boss2001001001
View Profile WWW Email
« Reply #2 on: January 26, 2010, 04:54:24 AM »
Reply with quoteQuote

here you go.. untested, but i guess you should be able to get it working..

Code:
/*
plc = local player controller ptr
behind_view = guess what :p
FMax() = uscript func 'UObject_execFMax_Parms'
Max() = uscript func 'UObject_execMax_Parms'
Min() = uscript func 'UObject_execMin_Parms'

*/

int KeyEvent(DWORD key, DWORD action, float Value) {

static float cam_dist = 0;

if (action == 0x01) {
if (key == 0xEC) {
if (behind_view) {
cam_dist = FMax((cam_dist + 1.00), 2.00);
plc.CameraDist = cam_dist;
} else {
plc.DesiredFOV = Max(plc.FovAngle - 15, 3);
};
} else if (key == 0xED)
if (behind_view) {
cam_dist = FMax((cam_dist - 1.00), 2.00);
plc.CameraDist = cam_dist;
} else {
plc.DesiredFOV = Min(plc.FovAngle + 15, plc.DefaultFOV);
};
};
};

return 0;/* or call original keyevent*/
};

NetzTeil: you forgot half of the code :p
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Forum Software: SMF
Template by SmokeZ
Page created in 0.056 seconds with 19 queries.