From f5729d06b41d2e8b710211d39a744cac6cb08c30 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Sun, 3 Nov 2024 20:57:23 -0500 Subject: [PATCH] TransformControls: Add min/max constraints. --- .../jsm/controls/TransformControls.d.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/types/three/examples/jsm/controls/TransformControls.d.ts b/types/three/examples/jsm/controls/TransformControls.d.ts index 1ecfe12d7..3fff2cbc4 100644 --- a/types/three/examples/jsm/controls/TransformControls.d.ts +++ b/types/three/examples/jsm/controls/TransformControls.d.ts @@ -38,6 +38,12 @@ export interface TransformControlsEventMap { "showX-changed": { value: unknown }; "showY-changed": { value: unknown }; "showZ-changed": { value: unknown }; + "minX-changed": { value: unknown }; + "maxX-changed": { value: unknown }; + "minY-changed": { value: unknown }; + "maxY-changed": { value: unknown }; + "minZ-changed": { value: unknown }; + "maxZ-changed": { value: unknown }; "worldPosition-changed": { value: unknown }; "worldPositionStart-changed": { value: unknown }; "worldQuaternion-changed": { value: unknown }; @@ -116,6 +122,36 @@ declare class TransformControls extends Controls { */ showZ: boolean; + /** + * The minimum allowed X position during translation. Default is `-Infinity`. + */ + minx: number; + + /** + * The maximum allowed X position during translation. Default is `Infinity`. + */ + maxX: number; + + /** + * The minimum allowed Y position during translation. Default is `-Infinity`. + */ + minY: number; + + /** + * The maximum allowed Y position during translation. Default is `Infinity`. + */ + maxY: number; + + /** + * The minimum allowed Z position during translation. Default is `-Infinity`. + */ + minZ: number; + + /** + * The maximum allowed Z position during translation. Default is `Infinity`. + */ + maxZ: number; + /** * Creates a new instance of TransformControls. * @param camera The camera of the rendered scene.