Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Unreal Engine Physics Essentials
Unreal Engine Physics Essentials

Unreal Engine Physics Essentials: Gain practical knowledge of mathematical and physics concepts in order to design and develop an awesome game world using Unreal Engine 4

Arrow left icon
Profile Icon Devin Sherry Profile Icon Katax Emperore
Arrow right icon
$19.99 per month
Paperback Sep 2015 216 pages 1st Edition
eBook
$31.99 $35.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Devin Sherry Profile Icon Katax Emperore
Arrow right icon
$19.99 per month
Paperback Sep 2015 216 pages 1st Edition
eBook
$31.99 $35.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$31.99 $35.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Unreal Engine Physics Essentials

Chapter 1. Math and Physics Primer

In this chapter, we will discuss and evaluate the basic 3D physics and mathematics concepts in an effort to gain a basic understanding of Unreal Engine 4 physics and real-world physics. To start with, we will discuss the units of measurement, what they are, and how they are used in Unreal Engine 4. In addition, we will cover the following topics:

  • The scientific notation
  • 2D and 3D coordinate systems
  • Scalars and vectors
  • Newton's laws or Newtonian physics concepts
  • Forces and energy

For the purpose of this chapter, we will want to open Unreal Engine 4 and create a simple project using the First Person template by following these steps.

Launching Unreal Engine 4

When we first open Unreal Engine 4, we will see the Unreal Engine launcher, which contains a News tab, a Learn tab, a Marketplace tab, and a Library tab. As the first title suggests, the News tab provides you with the latest news from Epic Games, ranging from Marketplace Content releases to Unreal Dev Grant winners, Twitch Stream Recaps, and so on. The Learn tab provides you with numerous resources to learn more about Unreal Engine 4, such as written documentation, video tutorials, community wikis, sample game projects, and community contributions. The Marketplace tab allows you to purchase content, such as FX, weapons packs, blueprint scripts, environmental assets, and so on, from the community wikis and Epic Games. Lastly, the Library tab is where you can download the newest versions of Unreal Engine 4, open previously created projects, and manage your project files.

Let's start by first launching the Unreal Engine launcher and choosing Launch from the Library tab, as seen in the following image:

Launching Unreal Engine 4

For the sake of consistency, we will use the latest version of the editor. At the time of writing this book, the version is 4.7.6. Next, we will select the New Project tab that appears at the top of the window, select the First Person project template with Starter Content, and name the project Unreal_PhyProject:

Launching Unreal Engine 4

Now that we have the game engine open, we can now continue with our lesson.

Units of measurement

To begin this section, we want to first define measurement and what exactly we will measure in the context of Unreal Engine 4. In a general sense, the definition of measurement is determining the size, length, or the amount of something (such as distance), the length/width/height of an object, or the volume of a particular space. In the context of Unreal Engine 4, we will measure the lengths of each component of a 3D vector in the 3D space and the X, Y, and Z dimensions. For the 2D game world, we will measure the X and Y axes. In the real world, we can use the U.S. Standard and the European Standard units of measurement to measure distance.

In the U.S., we can use the standard of lengths that involve the use of inches (in), feet (ft), yards (yd), and miles, whereas in Europe, there is the standard of lengths in place that includes millimeters (mm), centimeters (cm), meters (m), and kilometer (km). For our convenience and as a point of reference, here are a set of conversion charts between the U.S. and the European units of measurements. For more conversions, refer to this free conversion website at http://converter.eu/length/.

The following table shows the U.S. Conversions:

1 ft

12 in

1 in

0.0833333 ft

1 yd

3 ft

1 yd

36 in

1 Mile

1,760 yd

1 Mile

5,280 ft

1 Mile

63359.999 in

The following table shows the European Conversions:

1 mm

0.1 cm

1 cm

10 mm

1 cm

0.0099999 m

1 m

100 cm

1 m

1000 mm

1 mm

0.000999999 m

1 km

1000000 mm

1 km

100000 cm

1 km

1000 m

The following table shows U.S. to European Conversions:

1 in

25.4 mm

1 in

2.54 cm

1 in

0.0254 m

1 in

0.0000254 km

1 ft

304.8 mm

1 ft

30.48 cm

1 ft

0.3048 m

1 ft

0.0003048 km

1 yd

914.4 mm

1 yd

91.44 cm

1 yd

0.9144 m

1 yd

0.0009144 km

1 Mile

1609344 mm

1 Mile

160934.4 cm

1 Mile

1609.3439999999998 m

1 Mile

1.609344 km

Now that we have a strong understanding of the real-world units of measurement, we are now ready to discuss how Unreal Engine 4 uses these units of measurement to determine distances and sizes of objects.

What is an Unreal Unit?

Back in the days of the UDK or Unreal Engine 3, the units of measurement were based on what was called Unreal Units (uu), where one uu equaled 0.75 in, or 16 units equaled 1 ft. In Unreal Engine 4, the measurement has changed to where 1 uu is equal to 1 cm by default, but the engine allows you to change the conversion ratio between an Unreal Unit and a meter in its World settings, as shown in the following screenshot:

What is an Unreal Unit?

The value of 100.0 in this property equates an Unreal Unit to 1 cm. For example, by changing the World to Meters property to the value of 1 (as shown before), it will equate 1 uu to 1 m and a value of 1,000 will result in 1 uu equaling 1 mm. For the purposes of this project, we will leave the default value of 100 so that an Unreal Unit will equal 1 cm, but for future reference, this is the World settings property you would want to alter in order to change this conversion ratio.

Common measurements in Unreal Engine 4

When you work on any game engine, it is very important and useful to know the common measurements that are used in your game world. Each game is different, and the scaling of that game world will be different depending on whether or not the developers are going for realistic scaling measurements, but for the purposes of this book, the following measurements will be for a game world that is going for realism. Remembering that by default, 1 uu is equal to 1 cm in Unreal Engine 4, here are some of the common measurements that you can implement in your game world. An additional note is that all the following dimensions are set under the assumption that your player character is roughly 6 ft tall or 180 uu.

The dimensions of a player character are 180(uu)H, 60(uu)W, 60(uu)D. These are dimensions for a larger character that is roughly 6 ft tall, so you may need to adjust these values accordingly based on your character's height.

Common measurements in Unreal Engine 4

The wall height is 300(uu)H to 400(uu)H. A value of 400 uu will produce a slightly taller wall, whereas a value of 300 uu will result in a slightly shorter wall, but any value between 300 uu and 400 uu will work just fine.

Common measurements in Unreal Engine 4

The wall depth (thickness)is 10(uu)D to 20(uu)D. The value of the wall thickness depends greatly on the material that the wall is made of. For example, a brick wall would be thicker than a wall made of plaster.

The dimensions of doors and doorways are 210(uu)H – 230(uu)H / 110(uu)W – 140(uu)W. The value of the door and the doorway depth (thickness) depends on the value of the wall thickness.

Common measurements in Unreal Engine 4

Staircases

  • The step height is 15(uu)H
  • The step length/depth is 30(uu)D

The value of the staircase width will depend on the area that the staircase is placed in, so the dimensional measurement of width will vary. The following image has a step length of 30(uu)L, a step height of 15(uu)H, a step width of 200(uu)W, and 20 steps in total:

Common measurements in Unreal Engine 4

Unit snapping in Unreal Engine 4

If you open a blank map in Unreal Engine 4 or the different viewports in the editor, you will notice a grid. This grid can change dynamically depending on the current unit snapping measurement applied in the editor. The spacing between each grid square will determine the number of units an object will move when you place or transform objects in the editor. Back in Unreal Engine 3 or the UDK, the grid snapping would follow the power of 2 (2/4/8/16/32/64/128/256/512/1024/2048), but in Unreal Engine 4, the grid snapping follows these values (1/5/10/50/100/500/1000/5000/10000). The main reason for this change is due to the fact that Unreal Engine 4 uses the value of an Unreal Unit equaling 1 cm instead of 1 uu equaling 0.75 in. This is similar to what it did in Unreal Engine 3 or the UDK.

By default, the unit snapping grid follows the notion that 1 uu equals 1 cm, but if we were to follow the power of 2 unit snapping scale, we have this option. In Editor Preferences under the Level Editor section, there is an option for Viewports. Under Viewports, there is a subsection labeled Grid Snapping and an option to enable/disable the Use Power of Two Snap Size, as shown in the following screenshot:

Unit snapping in Unreal Engine 4

When it comes to unit snapping, follow the measurement that works best for you. Unit snapping is a very important aspect when it comes to placing assets in your game world. It can be a lifesaver when it comes to avoiding clipping or Z fighting between two objects. Unit snapping is also crucial when it comes to creating proper distances between objects, such as creating hallways or alleyways between buildings. In the end, it will save a lot of time and effort to take unit snapping into consideration at the beginning stages of level development and particularly during the white box stages of level design. There will also be specific instances when placing objects in our game world where unit snapping is not necessary, such as placing debris on the ground, placing paper on a desk, or any other objects that don't require specific distances between themselves and other in-game objects. When it comes to these instances, Unreal Engine 4 gives us the ability to toggle unit snapping on and off by clicking on the grid icon, as shown in the following screenshot. Lastly, we can also snap our objects to the grid or the floor of our environment by pressing the End key. Alternatively, we can press Ctrl + End to snap an actor to the grid. If we ever need to change the key bindings for these actions, we can navigate to the Edit Menu | Editor Preferences | Keyboard Shortcuts to make any changes.

Unit snapping in Unreal Engine 4

Changing units of measurement in 3ds Max and Maya

For both character and environmental artists, it is very important to know how to change the units of measurement in the third-party 3D modeling so that when assets are exported from the art program and then imported to Unreal Engine 4, the scale is correct and as intended by the artist. Keeping in mind that Unreal Engine 4 uses the measurement conversion of 1 uu equaling 1 cm by default, we want to make sure that the units of measurement in our 3D art program uses the same conversion.

To change the units of measurement in 3ds Max (2013 version), select the Customize option and then Units Setup. Here, click on the System Unit Setup button and change the units of measurement as follows:

Changing units of measurement in 3ds Max and Maya

In Maya, we can change the units of measurement by clicking on Window from the toolbar. Now, select Settings/Preferences from the drop-down window and then Preferences. In the Preferences dialogue box, select Settings. Under Working Units, we can change the linear units to centimeter.

Changing units of measurement in 3ds Max and Maya
Changing units of measurement in 3ds Max and Maya

Units of measurement – a section review

In this section, you learned about the basic unit conversions between the U.S. and European units and how these units translate into Unreal Engine 4's Unreal Units. Additionally, we briefly discussed the common measurements for our game world for our player character, walls, staircases, and doors/doorways. Moreover, we took an in-depth look at unit snapping in Unreal Engine 4 and the significance of the tool when it comes to object placement and creating our game world. Lastly, we looked at how to convert or change the units of measurement in 3D art programs, such as 3ds Max and Maya so that artists can ensure that their models are exported and imported to the correct scale when placed in Unreal Engine 4.

Now that we have a better understanding of the units of measurement and how they translate into Unreal Engine 4, we can now move forward to briefly discuss scientific notation.

The scientific notation

This is a method in which we can easily write very large or significantly small numbers without having to express the entire length of the number, meaning writing a bunch of zeroes. The use of scientific notation is not very common when you use Unreal Engine 4 as a designer or an artist, but as a programmer or a technical designer who uses blueprints or even C++ coding in the engine, the use of scientific notation can deem itself useful.

Let's take a look at some examples of both large and small numbers that are expressed in their scientific notation. To keep things as simple as possible, these examples will use the base of 10 for ease of clarity:

  • 1,000 (1 thousand) – 1 * 10^3
  • 100,000 (1 hundred thousand) – 1 * 10^5
  • 1,000,000 (1 million) – 1 * 10^6
  • .01 (1 hundredth) – 1 * 10^-2
  • .001 (1 thousandth) – 1 * 10^-3
  • .0001 (1 ten thousandth) – 1 * 10^-4

How to use scientific notation?

The main logic behind using scientific notation is to take a very large or small number and convert it to an easy to read/write expression. For an example that isn't a power of 10, the number 0.5 converted to scientific notation would read as 5 * 10^-1. We reached this expression by moving the decimal point in 0.5 once to the right-hand side making the number into 5. The goal of using scientific notation is to reach the base number, meaning a number between 1 and 9. As we had to move the decimal point to the right-hand side, we know that the expression would read as a negative exponent, whereas if we were to move the decimal point to the left-hand side, the exponent would be positive. The number 5 is our base, and we multiply it by 10 with an exponent that is equal to the number of times we moved the decimal point to reach the said base. In our case, it would be 1. Lastly, we know that the exponent would be negative because we are dealing with 0.5, a number less than 1, and we had to move the decimal point to the right-hand side. As a result, our scientific notation of 0.5 would be 5 * 10^-1. Here are a few more examples of large and small numbers as expressed in the scientific notation:

  • 642,300,544,000 – 6.42300544 * 10^11
  • .00002055 – 2.055 * 10^-5
  • 8,549,248.5004 – 8.549285004 * 10^6
  • .0125174 – 1.25174 * 10^-2
Left arrow icon Right arrow icon

Key benefits

  • Use the Physics Asset Tool within Unreal Engine 4 to develop game physics objects for your game world
  • Explore the Collision mechanics within Unreal Engine 4 to create advanced, real-world physics
  • A step-by-step guide to implementing the Physics concepts involved in Unreal Engine 4 to create a working Vehicle Blueprint

Description

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.

Who is this book for?

This book is intended for beginner to intermediate users of Epic Games' Unreal Engine 4 who want to learn more about how to implement physics within their game-world. No matter what your knowledge base of Unreal Engine 4 is, this book contains valuable information on blueprint scripting, collision generation, materials, and the Physical Asset Tool (PhAT) for all users to create better games.

What you will learn

  • Get to know basic to intermediate topics in mathematics and physics
  • Create assets using the Physics Asset Tool (PhAT) in Unreal Engine 4
  • Develop Collision Hulls, which are necessary to take advantage of Unreal Engine 4's physics and collision events
  • Use constraints to create advanced physics-based assets for your game-world
  • Working knowledge of physics bodies, physics damping, and friction within Unreal Engine 4
  • Develop physical materials to recreate real-world friction for substances such as glass and ice
  • Create a working vehicle blueprint from scratch using assets provided by Unreal Engine 4
  • Implement multiple physical elements and materials to simulate complex behavior over the objects in game

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 28, 2015
Length: 216 pages
Edition : 1st
Language : English
ISBN-13 : 9781784394905
Vendor :
Epic Games
Languages :
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Sep 28, 2015
Length: 216 pages
Edition : 1st
Language : English
ISBN-13 : 9781784394905
Vendor :
Epic Games
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 153.97
Mastering Unreal Engine 4.X
$54.99
Unreal Engine 4.X By Example
$54.99
Unreal Engine Physics Essentials
$43.99
Total $ 153.97 Stars icon

Table of Contents

9 Chapters
1. Math and Physics Primer Chevron down icon Chevron up icon
2. Physics Asset Tool Chevron down icon Chevron up icon
3. Collision Chevron down icon Chevron up icon
4. Constraints Chevron down icon Chevron up icon
5. Physics Damping, Friction, and Physics Bodies Chevron down icon Chevron up icon
6. Materials Chevron down icon Chevron up icon
7. Creating a Vehicle Blueprint Chevron down icon Chevron up icon
8. Advanced Topics Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.