Book Image

Unreal Engine Physics Essentials

By : Devin Sherry, Vladimir Alyamkin, Katax Emperore
Book Image

Unreal Engine Physics Essentials

By: Devin Sherry, Vladimir Alyamkin, Katax Emperore

Overview of this book

This book gives readers practical insight into the mathematical and physics principles necessary to properly implement physics within Unreal Engine 4. Discover how to manipulate physics within Unreal Engine 4 by learning basic real-world mathematical and physics concepts that assist in the implementation of physics-based objects in your game world. Then, you'll be introduced to PhAT (Physics Asset Tool) within Unreal Engine 4 to learn more about developing game physics objects for your game world. Next, dive into Unreal Engine 4’s collision generation, physical materials, blueprints, constraints, and more to get hands-on experience with the tools provided by Epic to create real-world physics in Unreal Engine 4. Lastly, you will create a working Vehicle Blueprint that uses all the concepts covered in this book, as well as covering advanced physics-based topics.
Table of Contents (15 chapters)
Unreal Engine Physics Essentials
About the Authors
About the Reviewer

Forces and energy

One of the most important concepts regarding energy is that it's a property of objects that can be transferred from one object to another, but it cannot be created or destroyed. All forms of energy follow the conservation of energy aspect and can be converted to different types of energy. There are many types of energy that exist in the real world. Here are a few examples:

  • Kinetic Energy: This specifies the motion of a moving body

  • Potential Energy: This denotes the energy that an object has due to its location in the 3D space

  • Mechanical Energy: This specifies the sum of kinetic and potential energies

  • Heat: This denotes the amount of thermal energy being transferred in the direction of decreasing temperature

These are just a few examples of energy that exist in the real world, so feel free to perform additional research on the concept of energy because this section will only cover the surface of the topic. When it comes to the concept of energy and the conservation of energy, Unreal Engine 4 follows these properties as well through its built-in physics engine.

As discussed in the previous section of this chapter regarding the Newtonian principles, forces are any interaction that tends to change the motion of an object. This can also be referred to as concepts (such as pushing and pulling) and contains a magnitude and direction, making it a vector quantity. Forces can be caused by gravity, magnetism, wind, or even the pushing or pulling of an object by a person or machine.

In Unreal Engine 4, we can add forces through blueprint scripting, and we can perform this in a few ways. The first method is a function called Add Force. This acts a lot like a thruster and adds a linear burst of energy in the specified direction.

You can add this type of force to any component associated with our blueprint, or you can apply this force to any component that is hit by a component of our blueprint. We can also see that there is a bone name property in this function. This means that we can apply force to a bone if one exists in our blueprint.

The second method of applying forces to our blueprint components or to components in our game world is through the Add Radial Force function:

This function allows you to specify a location in the 3D space. Here, the source of the radial force begins and then specifies a radius and strength using Float values. Lastly, we can apply one of the two methods of Falloff for the radius, which is either a constant fall-off or a linear fall-off. All bodies in this radius will be affected by this force, so make sure that you take this into consideration when you apply radius and strength values.