-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfnode_spatial_location_data.cpp
More file actions
24 lines (23 loc) · 1.16 KB
/
fnode_spatial_location_data.cpp
File metadata and controls
24 lines (23 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
* fnode_spatial_location_data
*
* Purpose:
* Broadcast FNODE position for spatial proximity queries.
*
* Inputs:
* - FNODE variables: id, x, y, z
*
* Outputs:
* - MessageSpatial3D payload used by FNODE/FOCAD interaction kernels
*/
FLAMEGPU_AGENT_FUNCTION(fnode_spatial_location_data, flamegpu::MessageNone, flamegpu::MessageSpatial3D) {
FLAMEGPU->message_out.setVariable<int>("id", FLAMEGPU->getVariable<int>("id"));
FLAMEGPU->message_out.setVariable<float>("x", FLAMEGPU->getVariable<float>("x"));
FLAMEGPU->message_out.setVariable<float>("y", FLAMEGPU->getVariable<float>("y"));
FLAMEGPU->message_out.setVariable<float>("z", FLAMEGPU->getVariable<float>("z"));
FLAMEGPU->message_out.setVariable<uint8_t>("connectivity_count", FLAMEGPU->getVariable<uint8_t>("connectivity_count"));
FLAMEGPU->message_out.setVariable<int>("closest_fnode_id", FLAMEGPU->getVariable<int>("closest_fnode_id"));
FLAMEGPU->message_out.setVariable<int>("second_closest_fnode_id", FLAMEGPU->getVariable<int>("second_closest_fnode_id"));
FLAMEGPU->message_out.setVariable<int>("marked_for_removal", FLAMEGPU->getVariable<int>("marked_for_removal"));
return flamegpu::ALIVE;
}