Building a universal collision system in 3D games

Source: Internet
Author: User

The construction of 3D Game collision systems varies greatly from game type to game type. For example, sports and FPS games such as need for speed vehicles and hl2 require very precise collision computing and rigid body motion. A good solution is to adopt a mature physical engine. For a wow role-playing game, precise collision is not what it wants most. Because the use of physical engines will occupy too much CPU resources, considering the efficiency, such games generally adopt a simplified collision system.

The core of building the collision system is the construction of the physical world. The physical world does not care about rendering. Only the location and shape of the model in the world space are considered. I will briefly describe the collision detection process.

1. When loading a model (including a terrain) in a scene, extract the corresponding low-touch vertex data and use a specific data structure for management (which can be an octotree or BSP ). When the model is detached from the scenario, the corresponding low-mode data is also detached. It is best to process the data in the background thread.

2. for objects that require touch detection, first let the object detect the box with the low-mode collision, and then perform precise triangle detection through the box (there are many methods in this process)

3. Based on the collision detection results, change the method and speed of entity motion.

4. Simple blocking and collision detection are required for server monster pathfinding. The collision system needs to export a grayscale image based on the low-mode data. You can use the viewpoint method to find the indoor path.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.