Define FLAMEGPU_AGENT_FUNCTION_CONDITION

Define Documentation

FLAMEGPU_AGENT_FUNCTION_CONDITION(funcName)

Macro for defining agent transition functions conditions with the correct input. Must always be a device function to be called by CUDA.

struct SomeAgentFunctionCondition { // User Implemented agent function condition behaviour device forceinline bool operator()(ReadOnlyDeviceAPI *FLAMEGPU) const { // do something return something ? true : false; } // Returns a function pointer to the agent function condition wrapper for this function // Including it here, force instantiates the template, without requiring the user to specify the template args elsewhere static constexpr AgentFunctionConditionWrapper *fnPtr() { return &agent_function_condition_wrapper<SomeAgentFunctionCondition>; } }; }