|
@@ -42254,6 +42254,148 @@ declare module "babylonjs/Gizmos/gizmo" {
|
|
|
dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
+declare module "babylonjs/Gizmos/planeDragGizmo" {
|
|
|
+ import { Observable } from "babylonjs/Misc/observable";
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
+ import { Vector3, Color3 } from "babylonjs/Maths/math";
|
|
|
+ import { TransformNode } from "babylonjs/Meshes/transformNode";
|
|
|
+ import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
|
|
|
+ import { PointerDragBehavior } from "babylonjs/Behaviors/Meshes/pointerDragBehavior";
|
|
|
+ import { Gizmo } from "babylonjs/Gizmos/gizmo";
|
|
|
+ import { UtilityLayerRenderer } from "babylonjs/Rendering/utilityLayerRenderer";
|
|
|
+ import { StandardMaterial } from "babylonjs/Materials/standardMaterial";
|
|
|
+ import { Scene } from "babylonjs/scene";
|
|
|
+ import { PositionGizmo } from "babylonjs/Gizmos/positionGizmo";
|
|
|
+ /**
|
|
|
+ * Single plane drag gizmo
|
|
|
+ */
|
|
|
+ export class PlaneDragGizmo extends Gizmo {
|
|
|
+ /**
|
|
|
+ * Drag behavior responsible for the gizmos dragging interactions
|
|
|
+ */
|
|
|
+ dragBehavior: PointerDragBehavior;
|
|
|
+ private _pointerObserver;
|
|
|
+ /**
|
|
|
+ * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
|
|
|
+ */
|
|
|
+ snapDistance: number;
|
|
|
+ /**
|
|
|
+ * Event that fires each time the gizmo snaps to a new location.
|
|
|
+ * * snapDistance is the the change in distance
|
|
|
+ */
|
|
|
+ onSnapObservable: Observable<{
|
|
|
+ snapDistance: number;
|
|
|
+ }>;
|
|
|
+ private _plane;
|
|
|
+ private _coloredMaterial;
|
|
|
+ private _hoverMaterial;
|
|
|
+ private _isEnabled;
|
|
|
+ private _parent;
|
|
|
+ /** @hidden */
|
|
|
+ static _CreatePlane(scene: Scene, material: StandardMaterial): TransformNode;
|
|
|
+ /** @hidden */
|
|
|
+ static _CreateArrowInstance(scene: Scene, arrow: TransformNode): TransformNode;
|
|
|
+ /**
|
|
|
+ * Creates a PlaneDragGizmo
|
|
|
+ * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
+ * @param dragPlaneNormal The axis normal to which the gizmo will be able to drag on
|
|
|
+ * @param color The color of the gizmo
|
|
|
+ */
|
|
|
+ constructor(dragPlaneNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, parent?: Nullable<PositionGizmo>);
|
|
|
+ protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
|
|
|
+ /**
|
|
|
+ * If the gizmo is enabled
|
|
|
+ */
|
|
|
+ isEnabled: boolean;
|
|
|
+ /**
|
|
|
+ * Disposes of the gizmo
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module "babylonjs/Gizmos/positionGizmo" {
|
|
|
+ import { Observable } from "babylonjs/Misc/observable";
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
+ import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
|
|
|
+ import { Mesh } from "babylonjs/Meshes/mesh";
|
|
|
+ import { Gizmo } from "babylonjs/Gizmos/gizmo";
|
|
|
+ import { AxisDragGizmo } from "babylonjs/Gizmos/axisDragGizmo";
|
|
|
+ import { PlaneDragGizmo } from "babylonjs/Gizmos/planeDragGizmo";
|
|
|
+ import { UtilityLayerRenderer } from "babylonjs/Rendering/utilityLayerRenderer";
|
|
|
+ /**
|
|
|
+ * Gizmo that enables dragging a mesh along 3 axis
|
|
|
+ */
|
|
|
+ export class PositionGizmo extends Gizmo {
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the x axis
|
|
|
+ */
|
|
|
+ xGizmo: AxisDragGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the y axis
|
|
|
+ */
|
|
|
+ yGizmo: AxisDragGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the z axis
|
|
|
+ */
|
|
|
+ zGizmo: AxisDragGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the yz plane
|
|
|
+ */
|
|
|
+ xPlaneGizmo: PlaneDragGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the xz plane
|
|
|
+ */
|
|
|
+ yPlaneGizmo: PlaneDragGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the xy plane
|
|
|
+ */
|
|
|
+ zPlaneGizmo: PlaneDragGizmo;
|
|
|
+ /**
|
|
|
+ * private variables
|
|
|
+ */
|
|
|
+ private _meshAttached;
|
|
|
+ private _updateGizmoRotationToMatchAttachedMesh;
|
|
|
+ private _snapDistance;
|
|
|
+ private _scaleRatio;
|
|
|
+ /** Fires an event when any of it's sub gizmos are dragged */
|
|
|
+ onDragStartObservable: Observable<{}>;
|
|
|
+ /** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
+ onDragEndObservable: Observable<{}>;
|
|
|
+ /**
|
|
|
+ * If set to true, planar drag is enabled
|
|
|
+ */
|
|
|
+ private _planarGizmoEnabled;
|
|
|
+ attachedMesh: Nullable<AbstractMesh>;
|
|
|
+ /**
|
|
|
+ * Creates a PositionGizmo
|
|
|
+ * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
+ */
|
|
|
+ constructor(gizmoLayer?: UtilityLayerRenderer);
|
|
|
+ /**
|
|
|
+ * If the planar drag gizmo is enabled
|
|
|
+ * setting this will enable/disable XY, XZ and YZ planes regardless of individual gizmo settings.
|
|
|
+ */
|
|
|
+ planarGizmoEnabled: boolean;
|
|
|
+ updateGizmoRotationToMatchAttachedMesh: boolean;
|
|
|
+ /**
|
|
|
+ * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
|
|
|
+ */
|
|
|
+ snapDistance: number;
|
|
|
+ /**
|
|
|
+ * Ratio for the scale of the gizmo (Default: 1)
|
|
|
+ */
|
|
|
+ scaleRatio: number;
|
|
|
+ /**
|
|
|
+ * Disposes of the gizmo
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ /**
|
|
|
+ * CustomMeshes are not supported by this gizmo
|
|
|
+ * @param mesh The mesh to replace the default mesh of the gizmo
|
|
|
+ */
|
|
|
+ setCustomMesh(mesh: Mesh): void;
|
|
|
+ }
|
|
|
+}
|
|
|
declare module "babylonjs/Gizmos/axisDragGizmo" {
|
|
|
import { Observable } from "babylonjs/Misc/observable";
|
|
|
import { Nullable } from "babylonjs/types";
|
|
@@ -42265,6 +42407,7 @@ declare module "babylonjs/Gizmos/axisDragGizmo" {
|
|
|
import { UtilityLayerRenderer } from "babylonjs/Rendering/utilityLayerRenderer";
|
|
|
import { StandardMaterial } from "babylonjs/Materials/standardMaterial";
|
|
|
import { Scene } from "babylonjs/scene";
|
|
|
+ import { PositionGizmo } from "babylonjs/Gizmos/positionGizmo";
|
|
|
/**
|
|
|
* Single axis drag gizmo
|
|
|
*/
|
|
@@ -42285,6 +42428,11 @@ declare module "babylonjs/Gizmos/axisDragGizmo" {
|
|
|
onSnapObservable: Observable<{
|
|
|
snapDistance: number;
|
|
|
}>;
|
|
|
+ private _isEnabled;
|
|
|
+ private _parent;
|
|
|
+ private _arrow;
|
|
|
+ private _coloredMaterial;
|
|
|
+ private _hoverMaterial;
|
|
|
/** @hidden */
|
|
|
static _CreateArrow(scene: Scene, material: StandardMaterial): TransformNode;
|
|
|
/** @hidden */
|
|
@@ -42295,9 +42443,13 @@ declare module "babylonjs/Gizmos/axisDragGizmo" {
|
|
|
* @param dragAxis The axis which the gizmo will be able to drag on
|
|
|
* @param color The color of the gizmo
|
|
|
*/
|
|
|
- constructor(dragAxis: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer);
|
|
|
+ constructor(dragAxis: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, parent?: Nullable<PositionGizmo>);
|
|
|
protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
|
|
|
/**
|
|
|
+ * If the gizmo is enabled
|
|
|
+ */
|
|
|
+ isEnabled: boolean;
|
|
|
+ /**
|
|
|
* Disposes of the gizmo
|
|
|
*/
|
|
|
dispose(): void;
|
|
@@ -44197,6 +44349,109 @@ declare module "babylonjs/Gamepads/index" {
|
|
|
export * from "babylonjs/Gamepads/gamepadSceneComponent";
|
|
|
export * from "babylonjs/Gamepads/xboxGamepad";
|
|
|
}
|
|
|
+declare module "babylonjs/Meshes/Builders/polyhedronBuilder" {
|
|
|
+ import { Scene } from "babylonjs/scene";
|
|
|
+ import { Color4, Vector4 } from "babylonjs/Maths/math";
|
|
|
+ import { Mesh } from "babylonjs/Meshes/mesh";
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
+ /**
|
|
|
+ * Class containing static functions to help procedurally build meshes
|
|
|
+ */
|
|
|
+ export class PolyhedronBuilder {
|
|
|
+ /**
|
|
|
+ * Creates a polyhedron mesh
|
|
|
+ * * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embbeded types. Please refer to the type sheet in the tutorial to choose the wanted type
|
|
|
+ * * The parameter `size` (positive float, default 1) sets the polygon size
|
|
|
+ * * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value)
|
|
|
+ * * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overwrittes the parameter `type`
|
|
|
+ * * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron
|
|
|
+ * * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`)
|
|
|
+ * * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : https://doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors
|
|
|
+ * * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored
|
|
|
+ * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
+ * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
+ * @param name defines the name of the mesh
|
|
|
+ * @param options defines the options used to create the mesh
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ * @returns the polyhedron mesh
|
|
|
+ * @see https://doc.babylonjs.com/how_to/polyhedra_shapes
|
|
|
+ */
|
|
|
+ static CreatePolyhedron(name: string, options: {
|
|
|
+ type?: number;
|
|
|
+ size?: number;
|
|
|
+ sizeX?: number;
|
|
|
+ sizeY?: number;
|
|
|
+ sizeZ?: number;
|
|
|
+ custom?: any;
|
|
|
+ faceUV?: Vector4[];
|
|
|
+ faceColors?: Color4[];
|
|
|
+ flat?: boolean;
|
|
|
+ updatable?: boolean;
|
|
|
+ sideOrientation?: number;
|
|
|
+ frontUVs?: Vector4;
|
|
|
+ backUVs?: Vector4;
|
|
|
+ }, scene?: Nullable<Scene>): Mesh;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module "babylonjs/Gizmos/scaleGizmo" {
|
|
|
+ import { Observable } from "babylonjs/Misc/observable";
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
+ import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
|
|
|
+ import { Gizmo } from "babylonjs/Gizmos/gizmo";
|
|
|
+ import { AxisScaleGizmo } from "babylonjs/Gizmos/axisScaleGizmo";
|
|
|
+ import { UtilityLayerRenderer } from "babylonjs/Rendering/utilityLayerRenderer";
|
|
|
+ /**
|
|
|
+ * Gizmo that enables scaling a mesh along 3 axis
|
|
|
+ */
|
|
|
+ export class ScaleGizmo extends Gizmo {
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the x axis
|
|
|
+ */
|
|
|
+ xGizmo: AxisScaleGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the y axis
|
|
|
+ */
|
|
|
+ yGizmo: AxisScaleGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the z axis
|
|
|
+ */
|
|
|
+ zGizmo: AxisScaleGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used to scale all axis equally
|
|
|
+ */
|
|
|
+ uniformScaleGizmo: AxisScaleGizmo;
|
|
|
+ private _meshAttached;
|
|
|
+ private _updateGizmoRotationToMatchAttachedMesh;
|
|
|
+ private _snapDistance;
|
|
|
+ private _scaleRatio;
|
|
|
+ private _uniformScalingMesh;
|
|
|
+ private _octahedron;
|
|
|
+ /** Fires an event when any of it's sub gizmos are dragged */
|
|
|
+ onDragStartObservable: Observable<{}>;
|
|
|
+ /** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
+ onDragEndObservable: Observable<{}>;
|
|
|
+ attachedMesh: Nullable<AbstractMesh>;
|
|
|
+ /**
|
|
|
+ * Creates a ScaleGizmo
|
|
|
+ * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
+ */
|
|
|
+ constructor(gizmoLayer?: UtilityLayerRenderer);
|
|
|
+ updateGizmoRotationToMatchAttachedMesh: boolean;
|
|
|
+ /**
|
|
|
+ * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
|
|
|
+ */
|
|
|
+ snapDistance: number;
|
|
|
+ /**
|
|
|
+ * Ratio for the scale of the gizmo (Default: 1)
|
|
|
+ */
|
|
|
+ scaleRatio: number;
|
|
|
+ /**
|
|
|
+ * Disposes of the gizmo
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
declare module "babylonjs/Gizmos/axisScaleGizmo" {
|
|
|
import { Observable } from "babylonjs/Misc/observable";
|
|
|
import { Nullable } from "babylonjs/types";
|
|
@@ -44206,11 +44461,11 @@ declare module "babylonjs/Gizmos/axisScaleGizmo" {
|
|
|
import { PointerDragBehavior } from "babylonjs/Behaviors/Meshes/pointerDragBehavior";
|
|
|
import { Gizmo } from "babylonjs/Gizmos/gizmo";
|
|
|
import { UtilityLayerRenderer } from "babylonjs/Rendering/utilityLayerRenderer";
|
|
|
+ import { ScaleGizmo } from "babylonjs/Gizmos/scaleGizmo";
|
|
|
/**
|
|
|
* Single axis scale gizmo
|
|
|
*/
|
|
|
export class AxisScaleGizmo extends Gizmo {
|
|
|
- private _coloredMaterial;
|
|
|
/**
|
|
|
* Drag behavior responsible for the gizmos dragging interactions
|
|
|
*/
|
|
@@ -44231,15 +44486,24 @@ declare module "babylonjs/Gizmos/axisScaleGizmo" {
|
|
|
* If the scaling operation should be done on all axis (default: false)
|
|
|
*/
|
|
|
uniformScaling: boolean;
|
|
|
+ private _isEnabled;
|
|
|
+ private _parent;
|
|
|
+ private _arrow;
|
|
|
+ private _coloredMaterial;
|
|
|
+ private _hoverMaterial;
|
|
|
/**
|
|
|
* Creates an AxisScaleGizmo
|
|
|
* @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
* @param dragAxis The axis which the gizmo will be able to scale on
|
|
|
* @param color The color of the gizmo
|
|
|
*/
|
|
|
- constructor(dragAxis: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer);
|
|
|
+ constructor(dragAxis: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, parent?: Nullable<ScaleGizmo>);
|
|
|
protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
|
|
|
/**
|
|
|
+ * If the gizmo is enabled
|
|
|
+ */
|
|
|
+ isEnabled: boolean;
|
|
|
+ /**
|
|
|
* Disposes of the gizmo
|
|
|
*/
|
|
|
dispose(): void;
|
|
@@ -44391,6 +44655,7 @@ declare module "babylonjs/Gizmos/planeRotationGizmo" {
|
|
|
import { Gizmo } from "babylonjs/Gizmos/gizmo";
|
|
|
import { UtilityLayerRenderer } from "babylonjs/Rendering/utilityLayerRenderer";
|
|
|
import "babylonjs/Meshes/Builders/linesBuilder";
|
|
|
+ import { RotationGizmo } from "babylonjs/Gizmos/rotationGizmo";
|
|
|
/**
|
|
|
* Single plane rotation gizmo
|
|
|
*/
|
|
@@ -44411,6 +44676,8 @@ declare module "babylonjs/Gizmos/planeRotationGizmo" {
|
|
|
onSnapObservable: Observable<{
|
|
|
snapDistance: number;
|
|
|
}>;
|
|
|
+ private _isEnabled;
|
|
|
+ private _parent;
|
|
|
/**
|
|
|
* Creates a PlaneRotationGizmo
|
|
|
* @param gizmoLayer The utility layer the gizmo will be added to
|
|
@@ -44418,9 +44685,13 @@ declare module "babylonjs/Gizmos/planeRotationGizmo" {
|
|
|
* @param color The color of the gizmo
|
|
|
* @param tessellation Amount of tessellation to be used when creating rotation circles
|
|
|
*/
|
|
|
- constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number);
|
|
|
+ constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable<RotationGizmo>);
|
|
|
protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
|
|
|
/**
|
|
|
+ * If the gizmo is enabled
|
|
|
+ */
|
|
|
+ isEnabled: boolean;
|
|
|
+ /**
|
|
|
* Disposes of the gizmo
|
|
|
*/
|
|
|
dispose(): void;
|
|
@@ -44454,6 +44725,7 @@ declare module "babylonjs/Gizmos/rotationGizmo" {
|
|
|
onDragStartObservable: Observable<{}>;
|
|
|
/** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
onDragEndObservable: Observable<{}>;
|
|
|
+ private _meshAttached;
|
|
|
attachedMesh: Nullable<AbstractMesh>;
|
|
|
/**
|
|
|
* Creates a RotationGizmo
|
|
@@ -44481,157 +44753,6 @@ declare module "babylonjs/Gizmos/rotationGizmo" {
|
|
|
setCustomMesh(mesh: Mesh): void;
|
|
|
}
|
|
|
}
|
|
|
-declare module "babylonjs/Gizmos/positionGizmo" {
|
|
|
- import { Observable } from "babylonjs/Misc/observable";
|
|
|
- import { Nullable } from "babylonjs/types";
|
|
|
- import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
|
|
|
- import { Mesh } from "babylonjs/Meshes/mesh";
|
|
|
- import { Gizmo } from "babylonjs/Gizmos/gizmo";
|
|
|
- import { AxisDragGizmo } from "babylonjs/Gizmos/axisDragGizmo";
|
|
|
- import { UtilityLayerRenderer } from "babylonjs/Rendering/utilityLayerRenderer";
|
|
|
- /**
|
|
|
- * Gizmo that enables dragging a mesh along 3 axis
|
|
|
- */
|
|
|
- export class PositionGizmo extends Gizmo {
|
|
|
- /**
|
|
|
- * Internal gizmo used for interactions on the x axis
|
|
|
- */
|
|
|
- xGizmo: AxisDragGizmo;
|
|
|
- /**
|
|
|
- * Internal gizmo used for interactions on the y axis
|
|
|
- */
|
|
|
- yGizmo: AxisDragGizmo;
|
|
|
- /**
|
|
|
- * Internal gizmo used for interactions on the z axis
|
|
|
- */
|
|
|
- zGizmo: AxisDragGizmo;
|
|
|
- /** Fires an event when any of it's sub gizmos are dragged */
|
|
|
- onDragStartObservable: Observable<{}>;
|
|
|
- /** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
- onDragEndObservable: Observable<{}>;
|
|
|
- attachedMesh: Nullable<AbstractMesh>;
|
|
|
- /**
|
|
|
- * Creates a PositionGizmo
|
|
|
- * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
- */
|
|
|
- constructor(gizmoLayer?: UtilityLayerRenderer);
|
|
|
- updateGizmoRotationToMatchAttachedMesh: boolean;
|
|
|
- /**
|
|
|
- * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
|
|
|
- */
|
|
|
- snapDistance: number;
|
|
|
- /**
|
|
|
- * Ratio for the scale of the gizmo (Default: 1)
|
|
|
- */
|
|
|
- scaleRatio: number;
|
|
|
- /**
|
|
|
- * Disposes of the gizmo
|
|
|
- */
|
|
|
- dispose(): void;
|
|
|
- /**
|
|
|
- * CustomMeshes are not supported by this gizmo
|
|
|
- * @param mesh The mesh to replace the default mesh of the gizmo
|
|
|
- */
|
|
|
- setCustomMesh(mesh: Mesh): void;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module "babylonjs/Meshes/Builders/polyhedronBuilder" {
|
|
|
- import { Scene } from "babylonjs/scene";
|
|
|
- import { Color4, Vector4 } from "babylonjs/Maths/math";
|
|
|
- import { Mesh } from "babylonjs/Meshes/mesh";
|
|
|
- import { Nullable } from "babylonjs/types";
|
|
|
- /**
|
|
|
- * Class containing static functions to help procedurally build meshes
|
|
|
- */
|
|
|
- export class PolyhedronBuilder {
|
|
|
- /**
|
|
|
- * Creates a polyhedron mesh
|
|
|
- * * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embbeded types. Please refer to the type sheet in the tutorial to choose the wanted type
|
|
|
- * * The parameter `size` (positive float, default 1) sets the polygon size
|
|
|
- * * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value)
|
|
|
- * * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overwrittes the parameter `type`
|
|
|
- * * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron
|
|
|
- * * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`)
|
|
|
- * * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : https://doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors
|
|
|
- * * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored
|
|
|
- * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
- * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
- * @param name defines the name of the mesh
|
|
|
- * @param options defines the options used to create the mesh
|
|
|
- * @param scene defines the hosting scene
|
|
|
- * @returns the polyhedron mesh
|
|
|
- * @see https://doc.babylonjs.com/how_to/polyhedra_shapes
|
|
|
- */
|
|
|
- static CreatePolyhedron(name: string, options: {
|
|
|
- type?: number;
|
|
|
- size?: number;
|
|
|
- sizeX?: number;
|
|
|
- sizeY?: number;
|
|
|
- sizeZ?: number;
|
|
|
- custom?: any;
|
|
|
- faceUV?: Vector4[];
|
|
|
- faceColors?: Color4[];
|
|
|
- flat?: boolean;
|
|
|
- updatable?: boolean;
|
|
|
- sideOrientation?: number;
|
|
|
- frontUVs?: Vector4;
|
|
|
- backUVs?: Vector4;
|
|
|
- }, scene?: Nullable<Scene>): Mesh;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module "babylonjs/Gizmos/scaleGizmo" {
|
|
|
- import { Observable } from "babylonjs/Misc/observable";
|
|
|
- import { Nullable } from "babylonjs/types";
|
|
|
- import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
|
|
|
- import { Gizmo } from "babylonjs/Gizmos/gizmo";
|
|
|
- import { AxisScaleGizmo } from "babylonjs/Gizmos/axisScaleGizmo";
|
|
|
- import { UtilityLayerRenderer } from "babylonjs/Rendering/utilityLayerRenderer";
|
|
|
- /**
|
|
|
- * Gizmo that enables scaling a mesh along 3 axis
|
|
|
- */
|
|
|
- export class ScaleGizmo extends Gizmo {
|
|
|
- /**
|
|
|
- * Internal gizmo used for interactions on the x axis
|
|
|
- */
|
|
|
- xGizmo: AxisScaleGizmo;
|
|
|
- /**
|
|
|
- * Internal gizmo used for interactions on the y axis
|
|
|
- */
|
|
|
- yGizmo: AxisScaleGizmo;
|
|
|
- /**
|
|
|
- * Internal gizmo used for interactions on the z axis
|
|
|
- */
|
|
|
- zGizmo: AxisScaleGizmo;
|
|
|
- /**
|
|
|
- * Internal gizmo used to scale all axis equally
|
|
|
- */
|
|
|
- uniformScaleGizmo: AxisScaleGizmo;
|
|
|
- /** Fires an event when any of it's sub gizmos are dragged */
|
|
|
- onDragStartObservable: Observable<{}>;
|
|
|
- /** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
- onDragEndObservable: Observable<{}>;
|
|
|
- attachedMesh: Nullable<AbstractMesh>;
|
|
|
- /**
|
|
|
- * Creates a ScaleGizmo
|
|
|
- * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
- */
|
|
|
- constructor(gizmoLayer?: UtilityLayerRenderer);
|
|
|
- updateGizmoRotationToMatchAttachedMesh: boolean;
|
|
|
- /**
|
|
|
- * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
|
|
|
- */
|
|
|
- snapDistance: number;
|
|
|
- /**
|
|
|
- * Ratio for the scale of the gizmo (Default: 1)
|
|
|
- */
|
|
|
- scaleRatio: number;
|
|
|
- /**
|
|
|
- * Disposes of the gizmo
|
|
|
- */
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
declare module "babylonjs/Gizmos/gizmoManager" {
|
|
|
import { Observable } from "babylonjs/Misc/observable";
|
|
|
import { Nullable } from "babylonjs/types";
|
|
@@ -102863,6 +102984,129 @@ declare module BABYLON {
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
/**
|
|
|
+ * Single plane drag gizmo
|
|
|
+ */
|
|
|
+ export class PlaneDragGizmo extends Gizmo {
|
|
|
+ /**
|
|
|
+ * Drag behavior responsible for the gizmos dragging interactions
|
|
|
+ */
|
|
|
+ dragBehavior: PointerDragBehavior;
|
|
|
+ private _pointerObserver;
|
|
|
+ /**
|
|
|
+ * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
|
|
|
+ */
|
|
|
+ snapDistance: number;
|
|
|
+ /**
|
|
|
+ * Event that fires each time the gizmo snaps to a new location.
|
|
|
+ * * snapDistance is the the change in distance
|
|
|
+ */
|
|
|
+ onSnapObservable: Observable<{
|
|
|
+ snapDistance: number;
|
|
|
+ }>;
|
|
|
+ private _plane;
|
|
|
+ private _coloredMaterial;
|
|
|
+ private _hoverMaterial;
|
|
|
+ private _isEnabled;
|
|
|
+ private _parent;
|
|
|
+ /** @hidden */
|
|
|
+ static _CreatePlane(scene: Scene, material: StandardMaterial): TransformNode;
|
|
|
+ /** @hidden */
|
|
|
+ static _CreateArrowInstance(scene: Scene, arrow: TransformNode): TransformNode;
|
|
|
+ /**
|
|
|
+ * Creates a PlaneDragGizmo
|
|
|
+ * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
+ * @param dragPlaneNormal The axis normal to which the gizmo will be able to drag on
|
|
|
+ * @param color The color of the gizmo
|
|
|
+ */
|
|
|
+ constructor(dragPlaneNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, parent?: Nullable<PositionGizmo>);
|
|
|
+ protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
|
|
|
+ /**
|
|
|
+ * If the gizmo is enabled
|
|
|
+ */
|
|
|
+ isEnabled: boolean;
|
|
|
+ /**
|
|
|
+ * Disposes of the gizmo
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * Gizmo that enables dragging a mesh along 3 axis
|
|
|
+ */
|
|
|
+ export class PositionGizmo extends Gizmo {
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the x axis
|
|
|
+ */
|
|
|
+ xGizmo: AxisDragGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the y axis
|
|
|
+ */
|
|
|
+ yGizmo: AxisDragGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the z axis
|
|
|
+ */
|
|
|
+ zGizmo: AxisDragGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the yz plane
|
|
|
+ */
|
|
|
+ xPlaneGizmo: PlaneDragGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the xz plane
|
|
|
+ */
|
|
|
+ yPlaneGizmo: PlaneDragGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the xy plane
|
|
|
+ */
|
|
|
+ zPlaneGizmo: PlaneDragGizmo;
|
|
|
+ /**
|
|
|
+ * private variables
|
|
|
+ */
|
|
|
+ private _meshAttached;
|
|
|
+ private _updateGizmoRotationToMatchAttachedMesh;
|
|
|
+ private _snapDistance;
|
|
|
+ private _scaleRatio;
|
|
|
+ /** Fires an event when any of it's sub gizmos are dragged */
|
|
|
+ onDragStartObservable: Observable<{}>;
|
|
|
+ /** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
+ onDragEndObservable: Observable<{}>;
|
|
|
+ /**
|
|
|
+ * If set to true, planar drag is enabled
|
|
|
+ */
|
|
|
+ private _planarGizmoEnabled;
|
|
|
+ attachedMesh: Nullable<AbstractMesh>;
|
|
|
+ /**
|
|
|
+ * Creates a PositionGizmo
|
|
|
+ * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
+ */
|
|
|
+ constructor(gizmoLayer?: UtilityLayerRenderer);
|
|
|
+ /**
|
|
|
+ * If the planar drag gizmo is enabled
|
|
|
+ * setting this will enable/disable XY, XZ and YZ planes regardless of individual gizmo settings.
|
|
|
+ */
|
|
|
+ planarGizmoEnabled: boolean;
|
|
|
+ updateGizmoRotationToMatchAttachedMesh: boolean;
|
|
|
+ /**
|
|
|
+ * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
|
|
|
+ */
|
|
|
+ snapDistance: number;
|
|
|
+ /**
|
|
|
+ * Ratio for the scale of the gizmo (Default: 1)
|
|
|
+ */
|
|
|
+ scaleRatio: number;
|
|
|
+ /**
|
|
|
+ * Disposes of the gizmo
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ /**
|
|
|
+ * CustomMeshes are not supported by this gizmo
|
|
|
+ * @param mesh The mesh to replace the default mesh of the gizmo
|
|
|
+ */
|
|
|
+ setCustomMesh(mesh: Mesh): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
* Single axis drag gizmo
|
|
|
*/
|
|
|
export class AxisDragGizmo extends Gizmo {
|
|
@@ -102882,6 +103126,11 @@ declare module BABYLON {
|
|
|
onSnapObservable: Observable<{
|
|
|
snapDistance: number;
|
|
|
}>;
|
|
|
+ private _isEnabled;
|
|
|
+ private _parent;
|
|
|
+ private _arrow;
|
|
|
+ private _coloredMaterial;
|
|
|
+ private _hoverMaterial;
|
|
|
/** @hidden */
|
|
|
static _CreateArrow(scene: Scene, material: StandardMaterial): TransformNode;
|
|
|
/** @hidden */
|
|
@@ -102892,9 +103141,13 @@ declare module BABYLON {
|
|
|
* @param dragAxis The axis which the gizmo will be able to drag on
|
|
|
* @param color The color of the gizmo
|
|
|
*/
|
|
|
- constructor(dragAxis: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer);
|
|
|
+ constructor(dragAxis: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, parent?: Nullable<PositionGizmo>);
|
|
|
protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
|
|
|
/**
|
|
|
+ * If the gizmo is enabled
|
|
|
+ */
|
|
|
+ isEnabled: boolean;
|
|
|
+ /**
|
|
|
* Disposes of the gizmo
|
|
|
*/
|
|
|
dispose(): void;
|
|
@@ -104632,10 +104885,102 @@ declare module BABYLON {
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
/**
|
|
|
+ * Class containing static functions to help procedurally build meshes
|
|
|
+ */
|
|
|
+ export class PolyhedronBuilder {
|
|
|
+ /**
|
|
|
+ * Creates a polyhedron mesh
|
|
|
+ * * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embbeded types. Please refer to the type sheet in the tutorial to choose the wanted type
|
|
|
+ * * The parameter `size` (positive float, default 1) sets the polygon size
|
|
|
+ * * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value)
|
|
|
+ * * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overwrittes the parameter `type`
|
|
|
+ * * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron
|
|
|
+ * * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`)
|
|
|
+ * * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : https://doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors
|
|
|
+ * * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored
|
|
|
+ * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
+ * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
+ * @param name defines the name of the mesh
|
|
|
+ * @param options defines the options used to create the mesh
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ * @returns the polyhedron mesh
|
|
|
+ * @see https://doc.babylonjs.com/how_to/polyhedra_shapes
|
|
|
+ */
|
|
|
+ static CreatePolyhedron(name: string, options: {
|
|
|
+ type?: number;
|
|
|
+ size?: number;
|
|
|
+ sizeX?: number;
|
|
|
+ sizeY?: number;
|
|
|
+ sizeZ?: number;
|
|
|
+ custom?: any;
|
|
|
+ faceUV?: Vector4[];
|
|
|
+ faceColors?: Color4[];
|
|
|
+ flat?: boolean;
|
|
|
+ updatable?: boolean;
|
|
|
+ sideOrientation?: number;
|
|
|
+ frontUVs?: Vector4;
|
|
|
+ backUVs?: Vector4;
|
|
|
+ }, scene?: Nullable<Scene>): Mesh;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * Gizmo that enables scaling a mesh along 3 axis
|
|
|
+ */
|
|
|
+ export class ScaleGizmo extends Gizmo {
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the x axis
|
|
|
+ */
|
|
|
+ xGizmo: AxisScaleGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the y axis
|
|
|
+ */
|
|
|
+ yGizmo: AxisScaleGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used for interactions on the z axis
|
|
|
+ */
|
|
|
+ zGizmo: AxisScaleGizmo;
|
|
|
+ /**
|
|
|
+ * Internal gizmo used to scale all axis equally
|
|
|
+ */
|
|
|
+ uniformScaleGizmo: AxisScaleGizmo;
|
|
|
+ private _meshAttached;
|
|
|
+ private _updateGizmoRotationToMatchAttachedMesh;
|
|
|
+ private _snapDistance;
|
|
|
+ private _scaleRatio;
|
|
|
+ private _uniformScalingMesh;
|
|
|
+ private _octahedron;
|
|
|
+ /** Fires an event when any of it's sub gizmos are dragged */
|
|
|
+ onDragStartObservable: Observable<{}>;
|
|
|
+ /** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
+ onDragEndObservable: Observable<{}>;
|
|
|
+ attachedMesh: Nullable<AbstractMesh>;
|
|
|
+ /**
|
|
|
+ * Creates a ScaleGizmo
|
|
|
+ * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
+ */
|
|
|
+ constructor(gizmoLayer?: UtilityLayerRenderer);
|
|
|
+ updateGizmoRotationToMatchAttachedMesh: boolean;
|
|
|
+ /**
|
|
|
+ * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
|
|
|
+ */
|
|
|
+ snapDistance: number;
|
|
|
+ /**
|
|
|
+ * Ratio for the scale of the gizmo (Default: 1)
|
|
|
+ */
|
|
|
+ scaleRatio: number;
|
|
|
+ /**
|
|
|
+ * Disposes of the gizmo
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
* Single axis scale gizmo
|
|
|
*/
|
|
|
export class AxisScaleGizmo extends Gizmo {
|
|
|
- private _coloredMaterial;
|
|
|
/**
|
|
|
* Drag behavior responsible for the gizmos dragging interactions
|
|
|
*/
|
|
@@ -104656,15 +105001,24 @@ declare module BABYLON {
|
|
|
* If the scaling operation should be done on all axis (default: false)
|
|
|
*/
|
|
|
uniformScaling: boolean;
|
|
|
+ private _isEnabled;
|
|
|
+ private _parent;
|
|
|
+ private _arrow;
|
|
|
+ private _coloredMaterial;
|
|
|
+ private _hoverMaterial;
|
|
|
/**
|
|
|
* Creates an AxisScaleGizmo
|
|
|
* @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
* @param dragAxis The axis which the gizmo will be able to scale on
|
|
|
* @param color The color of the gizmo
|
|
|
*/
|
|
|
- constructor(dragAxis: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer);
|
|
|
+ constructor(dragAxis: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, parent?: Nullable<ScaleGizmo>);
|
|
|
protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
|
|
|
/**
|
|
|
+ * If the gizmo is enabled
|
|
|
+ */
|
|
|
+ isEnabled: boolean;
|
|
|
+ /**
|
|
|
* Disposes of the gizmo
|
|
|
*/
|
|
|
dispose(): void;
|
|
@@ -104820,6 +105174,8 @@ declare module BABYLON {
|
|
|
onSnapObservable: Observable<{
|
|
|
snapDistance: number;
|
|
|
}>;
|
|
|
+ private _isEnabled;
|
|
|
+ private _parent;
|
|
|
/**
|
|
|
* Creates a PlaneRotationGizmo
|
|
|
* @param gizmoLayer The utility layer the gizmo will be added to
|
|
@@ -104827,9 +105183,13 @@ declare module BABYLON {
|
|
|
* @param color The color of the gizmo
|
|
|
* @param tessellation Amount of tessellation to be used when creating rotation circles
|
|
|
*/
|
|
|
- constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number);
|
|
|
+ constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable<RotationGizmo>);
|
|
|
protected _attachedMeshChanged(value: Nullable<AbstractMesh>): void;
|
|
|
/**
|
|
|
+ * If the gizmo is enabled
|
|
|
+ */
|
|
|
+ isEnabled: boolean;
|
|
|
+ /**
|
|
|
* Disposes of the gizmo
|
|
|
*/
|
|
|
dispose(): void;
|
|
@@ -104856,6 +105216,7 @@ declare module BABYLON {
|
|
|
onDragStartObservable: Observable<{}>;
|
|
|
/** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
onDragEndObservable: Observable<{}>;
|
|
|
+ private _meshAttached;
|
|
|
attachedMesh: Nullable<AbstractMesh>;
|
|
|
/**
|
|
|
* Creates a RotationGizmo
|
|
@@ -104885,140 +105246,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
/**
|
|
|
- * Gizmo that enables dragging a mesh along 3 axis
|
|
|
- */
|
|
|
- export class PositionGizmo extends Gizmo {
|
|
|
- /**
|
|
|
- * Internal gizmo used for interactions on the x axis
|
|
|
- */
|
|
|
- xGizmo: AxisDragGizmo;
|
|
|
- /**
|
|
|
- * Internal gizmo used for interactions on the y axis
|
|
|
- */
|
|
|
- yGizmo: AxisDragGizmo;
|
|
|
- /**
|
|
|
- * Internal gizmo used for interactions on the z axis
|
|
|
- */
|
|
|
- zGizmo: AxisDragGizmo;
|
|
|
- /** Fires an event when any of it's sub gizmos are dragged */
|
|
|
- onDragStartObservable: Observable<{}>;
|
|
|
- /** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
- onDragEndObservable: Observable<{}>;
|
|
|
- attachedMesh: Nullable<AbstractMesh>;
|
|
|
- /**
|
|
|
- * Creates a PositionGizmo
|
|
|
- * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
- */
|
|
|
- constructor(gizmoLayer?: UtilityLayerRenderer);
|
|
|
- updateGizmoRotationToMatchAttachedMesh: boolean;
|
|
|
- /**
|
|
|
- * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
|
|
|
- */
|
|
|
- snapDistance: number;
|
|
|
- /**
|
|
|
- * Ratio for the scale of the gizmo (Default: 1)
|
|
|
- */
|
|
|
- scaleRatio: number;
|
|
|
- /**
|
|
|
- * Disposes of the gizmo
|
|
|
- */
|
|
|
- dispose(): void;
|
|
|
- /**
|
|
|
- * CustomMeshes are not supported by this gizmo
|
|
|
- * @param mesh The mesh to replace the default mesh of the gizmo
|
|
|
- */
|
|
|
- setCustomMesh(mesh: Mesh): void;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /**
|
|
|
- * Class containing static functions to help procedurally build meshes
|
|
|
- */
|
|
|
- export class PolyhedronBuilder {
|
|
|
- /**
|
|
|
- * Creates a polyhedron mesh
|
|
|
- * * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embbeded types. Please refer to the type sheet in the tutorial to choose the wanted type
|
|
|
- * * The parameter `size` (positive float, default 1) sets the polygon size
|
|
|
- * * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value)
|
|
|
- * * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overwrittes the parameter `type`
|
|
|
- * * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron
|
|
|
- * * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`)
|
|
|
- * * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : https://doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors
|
|
|
- * * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored
|
|
|
- * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
|
|
|
- * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
|
- * @param name defines the name of the mesh
|
|
|
- * @param options defines the options used to create the mesh
|
|
|
- * @param scene defines the hosting scene
|
|
|
- * @returns the polyhedron mesh
|
|
|
- * @see https://doc.babylonjs.com/how_to/polyhedra_shapes
|
|
|
- */
|
|
|
- static CreatePolyhedron(name: string, options: {
|
|
|
- type?: number;
|
|
|
- size?: number;
|
|
|
- sizeX?: number;
|
|
|
- sizeY?: number;
|
|
|
- sizeZ?: number;
|
|
|
- custom?: any;
|
|
|
- faceUV?: Vector4[];
|
|
|
- faceColors?: Color4[];
|
|
|
- flat?: boolean;
|
|
|
- updatable?: boolean;
|
|
|
- sideOrientation?: number;
|
|
|
- frontUVs?: Vector4;
|
|
|
- backUVs?: Vector4;
|
|
|
- }, scene?: Nullable<Scene>): Mesh;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /**
|
|
|
- * Gizmo that enables scaling a mesh along 3 axis
|
|
|
- */
|
|
|
- export class ScaleGizmo extends Gizmo {
|
|
|
- /**
|
|
|
- * Internal gizmo used for interactions on the x axis
|
|
|
- */
|
|
|
- xGizmo: AxisScaleGizmo;
|
|
|
- /**
|
|
|
- * Internal gizmo used for interactions on the y axis
|
|
|
- */
|
|
|
- yGizmo: AxisScaleGizmo;
|
|
|
- /**
|
|
|
- * Internal gizmo used for interactions on the z axis
|
|
|
- */
|
|
|
- zGizmo: AxisScaleGizmo;
|
|
|
- /**
|
|
|
- * Internal gizmo used to scale all axis equally
|
|
|
- */
|
|
|
- uniformScaleGizmo: AxisScaleGizmo;
|
|
|
- /** Fires an event when any of it's sub gizmos are dragged */
|
|
|
- onDragStartObservable: Observable<{}>;
|
|
|
- /** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
- onDragEndObservable: Observable<{}>;
|
|
|
- attachedMesh: Nullable<AbstractMesh>;
|
|
|
- /**
|
|
|
- * Creates a ScaleGizmo
|
|
|
- * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
- */
|
|
|
- constructor(gizmoLayer?: UtilityLayerRenderer);
|
|
|
- updateGizmoRotationToMatchAttachedMesh: boolean;
|
|
|
- /**
|
|
|
- * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)
|
|
|
- */
|
|
|
- snapDistance: number;
|
|
|
- /**
|
|
|
- * Ratio for the scale of the gizmo (Default: 1)
|
|
|
- */
|
|
|
- scaleRatio: number;
|
|
|
- /**
|
|
|
- * Disposes of the gizmo
|
|
|
- */
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /**
|
|
|
* Helps setup gizmo's in the scene to rotate/scale/position meshes
|
|
|
*/
|
|
|
export class GizmoManager implements IDisposable {
|