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
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unreal Engine Physics Essentials

You're reading from   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
Product type Paperback
Published in Sep 2015
Publisher
ISBN-13 9781784394905
Length 216 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Devin Sherry Devin Sherry
Author Profile Icon Devin Sherry
Devin Sherry
Katax Emperore Katax Emperore
Author Profile Icon Katax Emperore
Katax Emperore
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Math and Physics Primer 2. Physics Asset Tool FREE CHAPTER 3. Collision 4. Constraints 5. Physics Damping, Friction, and Physics Bodies 6. Materials 7. Creating a Vehicle Blueprint 8. Advanced Topics Index

The 2D and 3D coordinate systems

In Unreal Engine 4, the use of 2D and 3D coordinate systems are used to determine the positions of actors in our game world. In a 2D coordinate system, we can determine an actor's position based on the X and Y axes, left-right, and up-down respectively. In a 3D coordinate system, along with the X and Y dimensions, we can determine the actor's position based on the Z axis: the inclusion of depth.

The 2D and 3D coordinate systems

In Unreal Engine 4, the 3D axes are labeled differently, as displayed in the preceding image. Instead of the "up" axis being the y axis, in Unreal Engine 4, the "up" axis is labeled as the z axis. The "forward" axis is then the y axis instead of being the z axis, as depicted in the preceding image.

It should also be discussed that Unreal Engine 4 uses a left-handed coordinate system, which means that the positive direction for the X axis is on the right-hand side, the positive direction for the Z axis is upward, and the positive direction for the Y axis is forward. In the left-handed coordinate system, the positive rotation of an axis is always in the clockwise direction. We can see this reflected in the transform section of the details panel when an object is selected and is either moved or rotated.

The 2D and 3D coordinate systems

In Unreal Engine 4, the X axis is labeled as a red-colored arrow; the Y axis is labeled as the green arrow, and the Z axis as the blue arrow. In the editor, you can toggle the transformation type of a selected object between translation, rotation, and scale by either repeatedly pressing on the spacebar or by toggling between the W (translation), E (rotation), and R (scale) keys. The viewport depicted in the preceding image is known as the perspective viewport. This is the only 3D viewport in Unreal Engine 4 and can be accessed using the Alt + G shortcut. When you work on a 3D game, Unreal Engine 4 offers three 2D viewports: the top, side, and front perspective viewports to take advantage of when you place objects in your game world.

The top perspective

This perspective presents the 3D world from a top-down view (using the 2D coordinate system) with the X and Y axes that is similar to the previous image of the 2D coordinate system, where the Y axis represents up and down and the X axis represents left and right. This perspective can be accessed with the Alt + J shortcut or by clicking on the drop-down list labeled Perspective and selecting the Top option, as shown in the following screenshot:

The top perspective

The side perspective

This perspective presents the 3D world from a side view perspective with the Z and Y axes using the 2D coordinate system. It effectively looks at the world from the left-hand side to the right-hand side. In this perspective, the Z axis represents up and down, whereas the Y axis represents left and right. This perspective can be accessed with the Alt + K shortcut or by the same method that is used to access the other three perspectives.

The side perspective

The front perspective

This perspective presents the 3D world from the front perspective with the Z and X axes using a coordinate system. It essentially views the world from the front to back side. In this perspective, the Z axis represents up and down, whereas the X axis represents left and right. This perspective can be accessed with the Alt + H short cut or by the same method that is used to access the other three perspectives.

The front perspective

Lastly, let's briefly discuss how rotation works in 3D programs, such as Unreal Engine 4. In the real world, the three different types of rotation of an object are Yaw, Pitch, and Roll. These rotations are defined as follows:

  • Pitch: In Unreal Engine 4, this is defined as the rotation of an object about the Y axis.
  • Yaw: In Unreal Engine 4, this is defined as the rotation of an object about the Z axis.
  • Roll: In Unreal Engine 4, this is defined as the rotation of an object about the X axis.

In the real world, the pitch, yaw, and roll rotations of an object can be visualized by looking at how a plane can rotate, as shown in the following image:

The front perspective
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image