@ue-too/board / restrictRotateByHandler
Function: restrictRotateByHandler()
restrictRotateByHandler(
delta,camera,config):number
Defined in: packages/board/src/camera/camera-rig/rotation-handler.ts:288
Handler pipeline step that prevents "rotate by" operations when rotation is locked.
Parameters
delta
number
Rotation angle change in radians
camera
Current camera instance
config
Restriction configuration
Returns
number
Zero (if locked) or delta (if unlocked)
Remarks
This handler implements a global rotation lock for relative rotation operations.
Behavior:
- If
restrictRotationis true: Returns 0 (prevents any change) - If
restrictRotationis false: Returns delta unchanged
Example
typescript
const config: RotationHandlerRestrictConfig = {
restrictRotation: true // Lock rotation
};
const delta = Math.PI / 4; // Try to rotate 45 degrees
const result = restrictRotateByHandler(delta, camera, config);
// result = 0 (rotation locked, no change allowed)See
createDefaultRotateByHandler for default pipeline usage