import { f as RichTypeVector3, R as RichTypeAny } from './declarationMapper-CyxdrUFP.esm.js';
import { F as FlowGraphCachedOperationBlock } from './flowGraphCachedOperationBlock-BYuTMQ0T.esm.js';
import { as as Vector3, R as RegisterClass } from './index-BvJBnIUK.esm.js';
import './KHR_interactivity-BGk_Crki.esm.js';
import './objectModelMapping-BtiDAwYm.esm.js';

/** This file must only contain pure code and pure imports */
/**
 * @experimental
 * A data block that reads the angular velocity of a physics body.
 */
class FlowGraphGetAngularVelocityBlock extends FlowGraphCachedOperationBlock {
    /**
     * Constructs a new FlowGraphGetAngularVelocityBlock.
     * @param config - optional configuration for the block
     */
    constructor(config) {
        super(RichTypeVector3, config);
        this.body = this.registerDataInput("body", RichTypeAny);
    }
    /**
     * @internal
     */
    _doOperation(context) {
        const physicsBody = this.body.getValue(context);
        if (!physicsBody) {
            return undefined;
        }
        let result = context._getExecutionVariable(this, "_cachedVelocity", null);
        if (!result) {
            result = new Vector3();
            context._setExecutionVariable(this, "_cachedVelocity", result);
        }
        physicsBody.getAngularVelocityToRef(result);
        return result;
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FlowGraphGetAngularVelocityBlock" /* FlowGraphBlockNames.PhysicsGetAngularVelocity */;
    }
}
let _Registered = false;
/**
 * Register side effects for flowGraphGetAngularVelocityBlock.
 * Safe to call multiple times; only the first call has an effect.
 */
function RegisterFlowGraphGetAngularVelocityBlock() {
    if (_Registered) {
        return;
    }
    _Registered = true;
    RegisterClass("FlowGraphGetAngularVelocityBlock" /* FlowGraphBlockNames.PhysicsGetAngularVelocity */, FlowGraphGetAngularVelocityBlock);
}

/**
 * Re-exports pure implementation and applies runtime side effects.
 * Import flowGraphGetAngularVelocityBlock.pure for tree-shakeable, side-effect-free usage.
 */
RegisterFlowGraphGetAngularVelocityBlock();

export { FlowGraphGetAngularVelocityBlock, RegisterFlowGraphGetAngularVelocityBlock };
//# sourceMappingURL=flowGraphGetAngularVelocityBlock-D1z_t_F0.esm.js.map
