Constructor
new GuiSelectPoint(options, guiParamsopt)
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Options | See the options parameter of the MyThree class.
Properties
|
||||||||||||||||||||||||||||||||||||||||||||
guiParams |
object |
<optional> |
{} | Followed parameters is allowed.
Properties
|
- Source:
Example
import GuiSelectPoint from 'https://raw.githack.com/anhr/commonNodeJS/master/guiSelectPoint/guiSelectPoint.js';
new GuiSelectPoint( options );
options.guiSelectPoint.add();
options.guiSelectPoint.addMesh( points );
Methods
add(folderopt)
Adds select point GUI into dat.gui folder
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
folder |
GUI |
<optional> |
dat.gui folder. |
- Source:
addMesh(mesh)
Adds new mesh into select point GUI
Parameters:
Name | Type | Description |
---|---|---|
mesh |
THREE.Mesh | new Mech. |
- Source:
getFrustumPoints()
get frustum points.
- Source:
getMeshIndex(mesh)
get index of the mesh in the cMeshs controller
Parameters:
Name | Type | Description |
---|---|---|
mesh |
THREE.Mesh | Mech |
- Source:
Returns:
index of selectred mesh.
getSelectedPointIndex()
- Source:
Returns:
index of the selected point or -1 if mesh is not selected or if point is not selected.
getSelectedPointIndexShort()
- Source:
Returns:
index of the selected point or -1 if point is not selected.
isSelectedMesh(meshCur)
Is mesh selected in the GuiSelectPoint?
Parameters:
Name | Type | Description |
---|---|---|
meshCur |
THREE.Mesh | Mech to be tested |
- Source:
Returns:
true if meshCur is selected.
removeMesh(mesh, boHideF3DObjectsopt)
Removes a mesh from the select point GUI
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
mesh |
THREE.Mesh | Mech for removing. | ||
boHideF3DObjects |
boolean |
<optional> |
true | true - hide the 'Meshes' folder if no any mesh exists in the meshs dropdown menu. |
- Source:
removePoints()
Removes all points from points list control.
- Source:
select(intersectionSelected)
User has selected a point
Parameters:
Name | Type | Description |
---|---|---|
intersectionSelected |
Object | See intersectObject |
- Source:
selectPoint(index)
Selects a point in the points list control
Parameters:
Name | Type | Description |
---|---|---|
index |
number | index of the point in the points list control |
- Source:
setAxisControl(axis, scale)
Specify a maximum, minimum and step value for NumberController.
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
axis |
String | axis. Currently 'w' axis is available only. | ||||||||||||||||
scale |
object | The following NumberController properties are available:
Properties
|
- Source:
setAxisName(axis, name)
sets axis name of the controllers
Parameters:
Name | Type | Description |
---|---|---|
axis |
String | axis. 'x' or 'y' or 'z'. |
name |
String | new axis name |
- Source:
setIndexMesh(index, mesh)
Set a mesh in the mesh's list control
Parameters:
Name | Type | Description |
---|---|---|
index |
number | index of the mesh in the mesh's list control |
mesh |
THREE.Mesh | new Mech |
- Source:
setMesh()
Sets controllers to position, scale and rotation of the mesh. If AxesHelper is exist, expose the mesh to the axes.
- Source:
setPosition(intersectionSelected)
Sets controllers to position, scale and rotation of the mesh. If AxesHelper is exist, expose the mesh to the axes.
Parameters:
Name | Type | Description |
---|---|---|
intersectionSelected |
THREE.Raycaster.intersectObject |
- Source:
setReadOnlyPosition(boReadOnly)
Sets local position controllers to read-only
Parameters:
Name | Type | Description |
---|---|---|
boReadOnly |
boolean | true is read-only |
- Source:
update()
update the values of the controllers of the world position
- Source:
updatePoints()
Updates points in the points list control.
- Source: