• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Camera Zoffset

Status
Not open for further replies.
Level 11
Joined
Apr 6, 2008
Messages
760
I have some problems seting up the camera correct for my map

i have these 2 variables for that

JASS:
real Zoffset = (GetLocationZ(Data.Loc)*zOffsetMultiplyer+GetUnitFlyHeight(Data[index].LockedTo)
real CameraEyeZ = GetCameraEyePositionZ()

Now the problem is that i want the camera to have the same height allways even if the terrain change(the same "height" as the unit have + Zoffset). I have a problem when the unit walking on flying platforms the camera go thru the platforms.

Edit: added 2 screenshots of the problem

Edit 2: Another problem is that GetLocationZ() return the height on the "platforms" and no on the acctual ground which is the problem in this case
 

Attachments

  • CameraProb1.jpg
    CameraProb1.jpg
    203.5 KB · Views: 99
  • CameraProb2.jpg
    CameraProb2.jpg
    226.4 KB · Views: 86
Level 16
Joined
Feb 22, 2006
Messages
960
hm I found this function: GetDestructableOccluderHeight try to use it on the platform found it in:
JASS:
function GetElevatorHeight takes destructable d returns integer
    local integer height

    set height = 1 + R2I(GetDestructableOccluderHeight(d) / bj_CLIFFHEIGHT)
    if (height < 1) or (height > 3) then
        set height = 1
    endif
    return height
endfunction

edit: oh ok this function GetDestructableOccluderHeight works... it returns the right height, tested it with a plattform now
 
Status
Not open for further replies.
Top