|
本帖最后由 dx89 于 2012-11-27 20:10 编辑
private function Camera_Actions takes nothing returns nothing
local integer i = 0
local real Z1
local real Z2
local real Angle1
local real Angle2
loop
exitwhen i >= COUNT_OF_PLAYERS
if (Units != null) and (ApplyCam) then
call MoveLocation(l,GetUnitX(Units),GetUnitY(Units))
set Z1 = GetLocationZ(l)
call MoveLocation(l,GetUnitX(Units)-angle*Cos(GetUnitFacing(Units)*bj_DEGTORAD),GetUnitY(Units)-angle*Sin(GetUnitFacing(Units)*bj_DEGTORAD))
set Z2 = GetLocationZ(l)
if(Z1+100>=Z2)then
set offset=GetCameraField(CAMERA_FIELD_ZOFFSET)+GetUnitFlyHeight(Units)+240+Z1-GetCameraEyePositionZ()
set Angle1 = -10
else
set offset=R2I(GetCameraField(CAMERA_FIELD_ZOFFSET))+240+GetUnitFlyHeight(Units)+Z2-R2I(GetCameraEyePositionZ())
set Angle1 = -65
endif
set Angle2 = GetUnitFacing(Units)
if (Down)and(not Up)and(Arround)then
set Angle2 = Angle2 + 180
endif
if(GetLocalPlayer()==Player(i))then
call SetCameraField(CAMERA_FIELD_ZOFFSET,offset,0.25)
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE,distance,0.25)
call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK,Angle1,0.25)
call SetCameraField(CAMERA_FIELD_FIELD_OF_VIEW,150,0.1)
call SetCameraField(CAMERA_FIELD_FARZ,bj_CAMERA_DEFAULT_FARZ,0.25)
call SetCameraField(CAMERA_FIELD_ROTATION,Angle2,0.25)
endif
endif
set i = i + 1
endloop
endfunction
看不懂 用JASS翻译出来很糟糕. 完整的在附件里头
Demonic Paradise_fxd_again.w3x
(6.83 MB, 下载次数: 23)
望高手指教 最好有个演示
来张效果图 镜头不会随地形Z高度偏离角色~~!
|
|