Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TransformControls: Add min/max constraints. #1332

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions types/three/examples/jsm/controls/TransformControls.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -116,6 +122,36 @@ declare class TransformControls extends Controls<TransformControlsEventMap> {
*/
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.
Expand Down
Loading