HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to Get TargetZ of Camera Object?

05-13-2009, 02:53 AM#1
teal
I need to find the target height of a camera object (actually many camera objects). There doesn't seem to be a native that does it (is there?). GetLocationZ() doesn't produce the same result (albeit it is quite close at times), which leaves me with the option of panning the camera to the object and using GetCameraTargetZ(). This method sucks hard, so is there any other way?
05-13-2009, 01:18 PM#2
Opossum
native CameraSetupGetDestPositionX takes camerasetup whichSetup returns real
native CameraSetupGetDestPositionY takes camerasetup whichSetup returns real
sounds pretty much like what you want.
edit: Z oh... well you don't necessarily have to pan the camera there. Just check the terrain's height there and add the camera object's z-offset to that value.
05-13-2009, 10:33 PM#3
teal
Quote:
Originally Posted by Opossum
edit: Z oh... well you don't necessarily have to pan the camera there. Just check the terrain's height there and add the camera object's z-offset to that value.
Quote:
Originally Posted by teal
GetLocationZ() doesn't produce the same result (albeit it is quite close at times)
05-14-2009, 09:47 AM#4
Toadcop
Quote:
// These return values for the local players camera only...
constant native GetCameraBoundMinX takes nothing returns real
constant native GetCameraBoundMinY takes nothing returns real
constant native GetCameraBoundMaxX takes nothing returns real
constant native GetCameraBoundMaxY takes nothing returns real
constant native GetCameraField takes camerafield whichField returns real
constant native GetCameraTargetPositionX takes nothing returns real
constant native GetCameraTargetPositionY takes nothing returns real
constant native GetCameraTargetPositionZ takes nothing returns real
constant native GetCameraTargetPositionLoc takes nothing returns location
constant native GetCameraEyePositionX takes nothing returns real
constant native GetCameraEyePositionY takes nothing returns real
constant native GetCameraEyePositionZ takes nothing returns real
constant native GetCameraEyePositionLoc takes nothing returns location
05-16-2009, 10:02 PM#5
teal
Those values pertain only to the camera currently in place for the player. What I need is a method of finding the target Z at an arbitrary point on the map.I guess I could possibly take an average of terrain heights over an area (unless someone knows how the smoothing is actually calculated).

My current solution is: pan camera to camera object and take its Z reading. Then for a moving camera, for small increments in distance, the Z of the next location will be ~ Z of the previous location. With the only issue being here that pan camera is not instant, a wait is required, which increases time to take the readings.