GeoObject
Source: GeoObject.ts:51
Represents 3D object on the the globe or 3d space
Constructor
new GeoObject(options: IGeoObjectParams): GeoObjectParameters
options(IGeoObjectParams) — Geo object parameters:options.object3d(Object3d, optional) — 3D object associated with the geo object.options.objSrc(string, optional) — Source url of the 3D object.options.tag(string, optional) — Unique instancing drawing identifier tag.options.position(Vec3 | NumberArray3, optional) — Position in Cartesian coordinates.options.scale(number | Vec3 | NumberArray3, optional, default: 1) — Scale of the object.options.translate(Vec3 | NumberArray3, optional) — Translation offset.options.color(Vec4 | NumberArray4 | string, optional) — RGBA color or HTML color string.options.visibility(boolean, optional, default: true) — Visibility flag.
Instance Methods
getPosition(): Vec3
Gets the position of the geo object.
Returns
setOpacity(a: number)
Sets the opacity of the geo object.
Parameters
a(number) — Opacity value (0 to 1).
getOpacity(): number
Gets the opacity of the geo object.
Returns
number
setColor(r: number, g: number, b: number, a?: number)
Sets the color of the geo object.
Parameters
r(number) — Red component.g(number) — Green component.b(number) — Blue component.a(number, optional) — Alpha component.
setColor4v(color: Vec3 | Vec4)
Sets color.
Parameters
setVisibility(visibility: boolean)
Sets geo object visibility.
Parameters
visibility(boolean) — Visibility flag.
getVisibility(): boolean
Returns geo object visibility.
Returns
boolean
setPosition(x: number, y: number, z: number)
Sets geo object position.
Parameters
x(number) — X coordinate.y(number) — Y coordinate.z(number) — Z coordinate.
setPosition3v(position: Vec3)
Sets geo object position.
Parameters
position(Vec3) — Cartesian coordinates.
setObject(object: Object3d)
Sets Object3d for the object
Parameters
object(Object3d)
setObjectSrc(src: string)
Sets the object url source.
Parameters
src(string)
setColorHTML(color: string)
Sets object HTML color.
Parameters
color(string)
setScale(scale: number)
Sets scales.
Parameters
scale(number)
setScale3v(scale: Vec3)
Sets X, Y, Z axis scales
Parameters
scale(Vec3)
getScale(): Vec3
Gets scale.
Returns
setLocalPosition3v(localPosition: Vec3)
Sets local offset position.
Parameters
localPosition(Vec3)
getLocalPosition(): Vec3
Gets local offset position.
Returns
remove()
Removes the geo object from the handler.
setPickingColor3v(color: Vec3)
Sets billboard picking color.
Parameters
color(Vec3) — Picking color.
setRotation(qRot: Quat)
Sets the rotation quaternion.
Parameters
qRot(Quat) — Rotation quaternion.
getRotation(): Quat
Returns orientation quaternion.
Returns
updateRotation()
Update object rotation
getDirection(): Vec3
Returns object direction
Returns
Instance Fields
tag
Gets the unique tag of the geo object.
Returns
string
object3d
Gets the 3D object associated with this geo object.
Returns
Object3d
vertices
Gets geometry mesh vertices.
Returns
Array.<number>
normals
Gets geometry mesh normals.
Returns
Array.<number>
texCoords
Gets geometry mesh texture coordinates.
Returns
Array.<number>
indices
Gets geometry mesh indices.
Returns
Array.<number>