Dreamball:Creating Camera Collision

From Valve Developer Community
Revision as of 14:55, 14 July 2009 by Craziestdan (talk | contribs)
Jump to: navigation, search

Creating a collision for the camera (the player's screen) is done by using the db camera collision entity. This is a brush-based entity. The player's camera won't collide with anything in the world, so you must place these brushes around in the places where you want the camera to collide.

Example usage of the camera collision

You should place them in your map carefully, not everything needs to collide in the world. You should only make your main world geometry collide. The screenshot on the right is a good example of placing your collision, only the geometry textured in red will collide. It isn't necessary to make things such as the checkpoint model or the little blue poles collide.

Creating the collision

To create them simply create your brush were you want the collision to be, then select the brush and press Ctrl + T to tie it to an entity. Tie it to the db_camera_collision. Texture your brush in the toolscameracollision texture.

Dreamball toolscameracollision.jpg

Note; this texture is just a nodraw texture, you can really use nodraw if you want. We use this blue one simply to make it stand out from the world, so it is recommended you use it too. Just place your camera collision brush right over your real geometry. So in the screenshot, the brush with the red texture is actually 2 brushes, the normal world brush (the red brush) and the invisible (the blue one in hammer) collision brush lapped over it. So it's best you leave your collision till your map is finished, then copy / duplicate your world brush and paste them into the same spot and tie it to the collision.

When you create your brushes you should add them to a custom VisGroup so you can filter them easily. Do note that you cannot use textures with transparency in them, so the camera collision (or nodraw) texture might make it harder to see your real world geometry, this is why you should use VisGroups. So you can easily turn of the collision so you can see and select your main world geometry.

Camera collision for Displacements

In Dreamball the camera is set to collide with all Displacements by default. If you want to make a displacement not collide with the camera then simply select your displacement and in the Hammer Face Edit Dialog under the Displacement tab there's a check box called 'No Hull Collision', by default for you this should be unchecked. Simply select your displacement brushes and check that box and the displacement will become not solid to the player's camera. Otherwise if it is left unchecked then it will collide, giving the same camera collision behaviour as the db_camera_collision entity.

See also