Item
Extends:
Indirect Subclass:
An Item is an abstract entity for all things placed in the scene, e.g. at walls or on the floor.
Constructor Summary
Public Constructor | ||
public |
constructor(model: *, metadata: *, geometry: *, material: *, position: *, rotation: *, scale: *) Constructs an item. |
Member Summary
Public Members | ||
public |
Show rotate option in context menu |
|
public |
bhelper: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
canvasWD: * |
|
public |
canvasWH: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
dragOffset: * dragging |
|
public |
|
|
public |
|
|
public |
|
|
public |
errorGlow: * |
|
public |
|
|
public |
geometry: * |
|
public |
halfSize: * |
|
public |
|
|
public |
|
|
public |
material: * |
|
public |
metadata: * |
|
public |
model: * |
|
public |
Does this object affect other floor items |
|
public |
|
|
public |
|
|
public |
|
|
public |
resizable: * |
|
public |
|
|
public |
scene: * |
|
public |
|
|
public |
texture: * |
|
public |
wirematerial: * |
Method Summary
Public Methods | ||
public |
clickDragged(intersection: *) |
|
public |
clickPressed(intersection: *) intersection has attributes point (vec3) and object (THREE.Mesh) |
|
public |
|
|
public |
createGlow(color: *, opacity: *, ignoreDepth: *): * |
|
public |
customIntersectionPlanes(): *[] Returns an array of planes to use other than the ground plane for passing intersection to clickPressed and clickDragged |
|
public |
getCorners(xDim: *, yDim: *, position: *): * returns the 2d corners of the bounding polygon |
|
public |
getDepth(): * |
|
public |
getHeight(): * |
|
public |
getMaterial(): * |
|
public |
getMaterialColor(index: *): * |
|
public |
getMetaData(): {"item_name": *, "item_type": *, "format": *, "model_url": *, "xpos": *, "ypos": *, "zpos": *, "rotation": *, "scale_x": *, "scale_y": *, "scale_z": *, "fixed": *, "material_colors": *} |
|
public |
|
|
public |
getWidth(): * |
|
public |
|
|
public |
|
|
public |
|
|
public |
mouseOff() |
|
public |
|
|
public |
moveToPosition(vec3: *) |
|
public |
objectHalfSize(): * |
|
public |
|
|
public |
remove() |
|
public |
removed() |
|
public |
resize(height: *, width: *, depth: *) |
|
public |
resized() Subclass can define to take action after a resize. |
|
public |
rotate(intersection: *) |
|
public |
setFixed(fixed: *) |
|
public |
setMaterialColor(color: *, index: *) |
|
public |
setProportionalResize(flag: *) |
|
public |
setScale(x: *, y: *, z: *) |
|
public |
|
|
public |
|
|
public |
showError(vec3: *) |
|
public |
switchWireframe(flag: *) |
|
public |
updateCanvasTexture(canvas: *, context: *, material: *, w: *, h: *, wPrefix: *, hPrefix: *) |
|
public |
on is a bool |
Public Constructors
public constructor(model: *, metadata: *, geometry: *, material: *, position: *, rotation: *, scale: *) source
Constructs an item.
Params:
Name | Type | Attribute | Description |
model | * | TODO |
|
metadata | * | TODO |
|
geometry | * | TODO |
|
material | * | TODO |
|
position | * | TODO |
|
rotation | * | TODO |
|
scale | * | TODO |
Public Members
public bhelper: * source
public canvasMaterialWD: * source
public canvasMaterialWH: * source
public canvasPlaneWD: * source
public canvasPlaneWH: * source
public canvasTextureWD: * source
public canvasTextureWH: * source
public canvasWD: * source
public canvasWH: * source
public canvascontextWD: * source
public canvascontextWH: * source
public errorGlow: * source
public geometry: * source
public halfSize: * source
public material: * source
public metadata: * source
public model: * source
public originalmaterial: * source
public resizable: * source
public scene: * source
public texture: * source
public wirematerial: * source
Public Methods
public clickDragged(intersection: *) source
Params:
Name | Type | Attribute | Description |
intersection | * |
public clickPressed(intersection: *) source
intersection has attributes point (vec3) and object (THREE.Mesh)
Params:
Name | Type | Attribute | Description |
intersection | * |
public clickReleased() source
public createGlow(color: *, opacity: *, ignoreDepth: *): * source
Params:
Name | Type | Attribute | Description |
color | * | ||
opacity | * | ||
ignoreDepth | * |
Return:
* |
public customIntersectionPlanes(): *[] source
Returns an array of planes to use other than the ground plane for passing intersection to clickPressed and clickDragged
Return:
*[] |
public getCorners(xDim: *, yDim: *, position: *): * source
returns the 2d corners of the bounding polygon
offset is Vector3 (used for getting corners of object at a new position)
TODO: handle rotated objects better!
Params:
Name | Type | Attribute | Description |
xDim | * | ||
yDim | * | ||
position | * |
Return:
* |
public getMetaData(): {"item_name": *, "item_type": *, "format": *, "model_url": *, "xpos": *, "ypos": *, "zpos": *, "rotation": *, "scale_x": *, "scale_y": *, "scale_z": *, "fixed": *, "material_colors": *} source
Return:
{"item_name": *, "item_type": *, "format": *, "model_url": *, "xpos": *, "ypos": *, "zpos": *, "rotation": *, "scale_x": *, "scale_y": *, "scale_z": *, "fixed": *, "material_colors": *} |
public hideError() source
public initObject() source
public mouseOff() source
public mouseOver() source
public moveToPosition(vec3: *) source
Params:
Name | Type | Attribute | Description |
vec3 | * |
public placeInRoom() source
public remove() source
public removed() source
public resize(height: *, width: *, depth: *) source
Params:
Name | Type | Attribute | Description |
height | * | ||
width | * | ||
depth | * |
public rotate(intersection: *) source
Params:
Name | Type | Attribute | Description |
intersection | * |
public setFixed(fixed: *) source
Params:
Name | Type | Attribute | Description |
fixed | * |
public setMaterialColor(color: *, index: *) source
Params:
Name | Type | Attribute | Description |
color | * | ||
index | * |
public setProportionalResize(flag: *) source
Params:
Name | Type | Attribute | Description |
flag | * |
public setScale(x: *, y: *, z: *) source
Params:
Name | Type | Attribute | Description |
x | * | ||
y | * | ||
z | * |
public setSelected() source
public setUnselected() source
public showError(vec3: *) source
Params:
Name | Type | Attribute | Description |
vec3 | * |
public switchWireframe(flag: *) source
Params:
Name | Type | Attribute | Description |
flag | * |
public updateCanvasTexture(canvas: *, context: *, material: *, w: *, h: *, wPrefix: *, hPrefix: *) source
Params:
Name | Type | Attribute | Description |
canvas | * | ||
context | * | ||
material | * | ||
w | * | ||
h | * | ||
wPrefix | * | ||
hPrefix | * |