Creating a New Simulation
A new simulation will be created for this tutorial series, including both a level and a scenario blueprint. The level will be named Tutorial_03_PowerNetwork
.
Within the demo blueprint, on the Begin Play event, the solar system should be initialized to the epoch of 12:00:00 PM, Jan 01, 2024. Similarly, the simulation should be configured using the Configure Simulation
event.
NOTE
Once created, ensure that the demo blueprint has been added to the level by dragging the demo blueprint created into the level. It should appear once, and only once, in the outliner of the level.
Creating a Spacecraft
A new spacecraft will be designed for this tutorial, named BP_Tutorial_03_Spacecraft
. The base class will be the BP_NS_Spacecraft_Empty_3U
model, which includes a 3-unit chassis for the spacecraft. The spacecraft will need to include the following components attached:
- Two 3U solar panels (
BP_NS_SC_SolarPanel_3U_XY
) - A reaction wheel stack (
BP_NS_SC_ReactionWheels_Triad
) - A guidance computer (
BP_NS_SC_GuidanceComputer
) - A battery (
BP_NS_SC_Battery_Single
)
These components can be added to the spacecraft using the child actor components and by selecting one of the default provided assets on the class selection. Once the components have been moved around the viewport and are in a reasonable configuration, the spacecraft may look like the following:
Updating the Guidance Computer
For this tutorial, the Guidance Computer will use the velocity pointing software mode. This will attempt to orient the spacecraft’s primary payload (which will be the camera that is added later) towards the direction of the spacecraft’s velocity.
NOTE
The white arrows to the right of a variable indicate that the value has been changed from the default value. Pressing the white arrow will return the value to the default value for that particular variable.
Creating the Spacecraft
The Spacecraft is spawned on the demo blueprint on the Begin Play event after the solar system is configured. This is typically done in its function, using the Create Object
node. The spacecraft will also make use of the custom mass override function with some standard values.
Initializing Vector Elements
There are several ways to initialize the orbit of a spacecraft. On a low level, initializing an orbit requires setting the position and velocity of the craft in inertial space relative to some celestial body. Classical elements include the six Keplerian elements and geodetic elements allow for a specific latitude and longitude point to start at. A raw form of the position and velocity can also be set if desired using the Set Vector Elements
function on the spacecraft. The position is in meters and the velocity is in meters per second.
NOTE
Structs, represented by the dark-blue pin colours, are collections of data stored of a particular type. Each structure will have its
Make
orBreak
Blueprint node. These can be found by dragging the empty pin off the reference and then selecting the appropriate node to open the data.
Playing the Simulation
Once the Configure Spacecraft
function is connected up to the Event Begin Play
on the demo Blueprint, the spacecraft will be added and, since the guidance computer already exists, the spacecraft will orient itself towards the velocity direction.