rusteal-codegen 0.4.1

Code generator: UHT JSON to Rust bindings and C++ wrappers for rusteal
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Collision channels and object types: a trace "for objects" takes object
// types (`EObjectTypeQuery`), while a component's settings name channels
// (`ECollisionChannel`), and which object type a channel is depends on the
// project's collision settings.

use rusteal_core::UeEnum;

use crate::engine::{ECollisionChannel, EObjectTypeQuery};

/// The object type of a collision channel, as C++'s
/// `UEngineTypes::ConvertToObjectType` (`ECC_Pawn` is `ObjectTypeQuery3`; a
/// project's own object channels follow the engine's); `None` for a channel
/// that is no object type (a trace channel).
pub fn object_type_query(channel: ECollisionChannel) -> Option<EObjectTypeQuery> {
    let value =
        unsafe { rusteal_core::ffi_dispatch::world_channel_to_object_type(channel.to_i64() as u8) };
    EObjectTypeQuery::from_value(value)
}