HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Camera Collisions

01-16-2008, 10:05 PM#1
bomber7
Ok. I'm making an FPS. All the other fps I've seen (in war3) have actually used third person view. I'm planning on using first person. (thus there is no unit)

I've got all the camera movements completed. However, I have no way of making it collide with things. (trees, walls, units) I know that no camera has collisions. However I need a method of emulating collisions. Does anyone have any good ideas?

I've tried setting a unit's X and Y to the cameras X and Y then quickly setting the camera's X and Y to the unit's X and Y. (Because as long as the unit has collisions, it should move out of the way of objects. Thus if the camera is on an object it will be reset to an object free position.) This doesn't work at all. The unit just goes through everything as if I had disabled its collisions.
01-16-2008, 10:24 PM#2
xombie
Check to see where the camera eye position is and if there are any destructables (would be a rect enum) or objects and such in the way (or other cameras) then you would follow through with the appropriate actions, like stopping the camera's ability to move in that direction and such.

Check The System Request Thread I have a camera in there called FPCamera that pretty much zooms in to the view of the unit. You would just have to tweak a few things to make the camera's eye position update with the unit. Setting the unit's x and y values to something that ignores collision is not very wise - just try to go off of what my first comment was.
01-16-2008, 10:32 PM#3
Ammorth
Try using Vexorian's Pathing check method. Create an item at the point and check to see if it still there.
01-17-2008, 08:41 PM#4
Toadcop
Quote:
Ok. I'm making an FPS. All the other fps I've seen (in war3) have actually used third person view. I'm planning on using first person. (thus there is no unit)
o rly ? xD

forget better it imho... war3 isnt designed for FPS... but well you will see it self. but yes it's fun to make something like this in war3.

btw if you wna to do something "normal" so you would have problems with synchronization...