SDK 6.3/C++/Topology
SDK 6.3 · PAWN API: Core ·
Graphics ·
Topology ·
Sound ·
Motion Sensor ·
Leaderboard ·
Splash Screen ·
Physics ·
Network ·
Save ·
Scramble ·
Logging
C++: Native API · Application · GFX Engine · Rust: Rust API (experimental) · Changelog
← SDK 6.3 · C++ Native API / Topology
Cube geometry: facelets, faces, places, orientation and twist events.
Shared types, enums and constants are listed on the Native API overview.
Contents
Minimal example
The assembled-check used by the official Twinkle sample before cross-screen drawing:
if(TOPOLOGY_isAssembled() == 1)
{
// safe to place objects across the whole face
}
Cubios::TOPOLOGY_faceletInfo_t nb;
TOPOLOGY_getAdjacentFacelet(cubeN, screen.ID(), Cubios::NEIGHBOR_TOP, &nb);
Functions
TOPOLOGY_getAdjacentFacelet
Syntax:
i32_t TOPOLOGY_getAdjacentFacelet(u32_t module, u32_t screen, u32_t direction, Cubios::TOPOLOGY_faceletInfo_t* result)
Description:
- Get a facelet neighbor in the given direction.
- Facelet can have neighbors on the same cube face or neighbors by module.
- This function provide a neighbor of the given facelet in the given
- direction. Connection status indicates if there is a connection between
- modules on which given facelet and its neighbor are located.
Return values:
- Neighbor facelet in a given direction with its connection status. The
- module ID will be MODULES_MAX and the screen number will be SCREENS_MAX in
- case of an error (e.g. incorrect arguments or the topology malfunction).
TOPOLOGY_getFacelet
Syntax:
i32_t TOPOLOGY_getFacelet(u32_t face, u32_t position, Cubios::TOPOLOGY_orientation_mode_t mode, Cubios::TOPOLOGY_faceletInfo_t* result)
Description:
- Get a facelet located in the given place.
Return values:
- Facelet located in the given place, connection status indicates if there
- any connection to the module on which this facelet resides. The module ID
- will be MODULES_MAX and the screen screen will be SCREENS_MAX in case of an
- error (e.g. incorrect arguments or the topology malfunction).
TOPOLOGY_getPlace
Syntax:
i32_t TOPOLOGY_getPlace(u32_t module, u32_t screen, Cubios::TOPOLOGY_orientation_mode_t mode, Cubios::TOPOLOGY_place_t* result)
Description:
- Get a place of the facelet.
Return values:
- Place on cube surface where the given facelet located. Face will be
- TOPOLOGY_FACES_MAX and position will be TOPOLOGY_POSITIONS_MAX in case of
- an error (e.g. incorrect arguments or topology malfunction)
TOPOLOGY_getOppositeFacelet
Syntax:
i32_t TOPOLOGY_getOppositeFacelet(u32_t module, u32_t screen, Cubios::TOPOLOGY_faceletInfo_t* result)
Description:
- Get an opposite facelet located on a diagonal counterpart module.
Return values:
- Diagonal opposite counterpart facelet. Connection status indicates if there
- any connection to the module on which that facelet resides. The module ID
- will be MODULES_MAX and the screen number will be SCREENS_MAX in case of an
- error (e.g. incorrect arguments or topology malfunction).
TOPOLOGY_getAngle
Syntax:
i32_t TOPOLOGY_getAngle(u32_t module, u32_t screen, Cubios::TOPOLOGY_orientation_mode_t mode)
Description:
- Get an angle to align images on a face according to the orientation mode.
- Display coordinates system is persistent on a module screen. Different
- angles are needed to align images on all modules with screens on the same
- face. This function returns the angle for the screen specified by the
- facelet. The angle is relative to the position 0 on the same face where the
- facelet is located in the given orientation mode.
Return values:
- Angle to align images on the same face according to the orientation mode, 0
- in case of an error (e.g. incorrect arguments or the topology malfunction).
TOPOLOGY_getFaceletOrientation
Syntax:
i32_t TOPOLOGY_getFaceletOrientation(u32_t module, u32_t screen)
Description:
- Get a face orientation on which the given facelet resides.
Return values:
- Face orientation on which the given facelet resides, ORIENTATION_MAX in
- case of an error (e.g. incorrect arguments or the topology malfunction).
History:
- v5.0 - renamed from TOPOLOGY_getFaceletLocation() to the
- TOPOLOGY_getFaceletOrientation()
TOPOLOGY_getPlaceOrientation
Syntax:
i32_t TOPOLOGY_getPlaceOrientation(u32_t face, u32_t position)
Description:
- Get a face orientation on which the given place resides.
Return values:
- Face orientation on which the given place resides, ORIENTATION_MAX in case
- of an error (e.g. incorrect arguments or the topology malfunction).
History:
- v5.0 - renamed from TOPOLOGY_getPlaceLocation() to the
- TOPOLOGY_getPlaceOrientation()
TOPOLOGY_getFace
Syntax:
i32_t TOPOLOGY_getFace(u32_t orientation)
Description:
- Get a face number which has the given orientation.
Return values:
- Face number which has the given orientation, TOPOLOGY_FACES_MAX in case of
- an error (e.g. incorrect arguments or the topology malfunction).
TOPOLOGY_isAssembled
Syntax:
i32_t TOPOLOGY_isAssembled()
Description:
- Check that all modules in a system are connected to each other.
Return values:
- True if all modules in a system are connected to each other, false
- otherwise.
TOPOLOGY_getTwist
Syntax:
i32_t TOPOLOGY_getTwist(Cubios::TOPOLOGY_twistInfo_t* twist)
Description:
- Read the pending twist event into a
TOPOLOGY_twistInfo_t. Normally consumed byAppManager, which callsApplication::on_Twist().