Class: XComponent

XComponent()

new XComponent()

Package of components exposed by x-visual.

Note

**Components can not created directly. See example for how to use.**

see docs for more details about components.

Source:

Classes

Canvas
CmdFlag
CmpTween
CmpTweens
Dynatex
Filming
FlowingPath
Glow
GlowingEdge
GpuPickable
HudChild
HudGroup
Input
ModelSeqs
Obj3
Occluder
RayCastee
TweenScript
UserCmd
UserTween
Visual
XCamera

Members

(static, constant) AnimCate :int

Animation type (AnimType) category / mask.

Type:
  • int
Properties:
Name Type Description
COMBINE_AFFINE int

cate: affine combination

MASK int

cate mask

Source:

(static, constant) AnimType :int

Animation types.

Type:
  • int
Properties:
Name Type Description
USER int

User defined animation - not supported in v1.0

POSITION int

Model translation

SCALE int

Model scale

ALPHA int

Alpah change @deprecated replaced by U_ALPHA

U_ALPHA int

uniform u_alpha animation

Tween's of this uniform can be updated to children - handled by XTweener.
UNIFORMS int

Uniform change - @deprecated?

U_t int
U_NOW int

current time (ms)

U_NOW is acctually not a tweened variable. XTweener just keep update unforms.u_now with cuurent time.
U_MORPHi int

Vertex translate morphing in vertex uniforms

U_PATH_MORPH int

Uniform pos morphing

  • tweening Obj3.mesh.unfiorms.wpos alone Obj3.datum.path, which is created by Thrender case like AssetType.PathTube.
U_PATHn_MORPH int

Uniform pos morphing, with count specifying position number

WIREFAME int

??

ROTATEX int

DEPRECATED
replaced by ROTAXIS, used for affines + non-affine combination testing

ROTAXIS int

Rotate around axis

ORBIT int

Orbit around pivot

PATH_MOVE int

Move alone path

SHADER_COLOR int

Shader material with color changing

TODO int

Extending

Source:

(static, constant) AssetType :int

Visual effects supported by x-visual, texture | basic material | custom shader ...

Type:
  • int
Properties:
Name Type Description
material int

not used?

mat int

short for material

shader int

deprecated
shaders provide by xglsl

cust int

deprecated
customer

mesh int

mesh created as THREE.Mesh(), using THREE.MeshPhongMaterial as material, usually loaded asset from gltf asset

mesh_basic int

mesh created as THREE.Mesh(), using THREE.MeshBasicMaterial as material

point int

THREE.Points.
If Visual.assets is a gltf, load the vertices;
if Visual.assets is undefined, generate vertices from the geometry declared in Obj3.

Note

  1. Obj3Type.POINTS is an array of vertices buffer.
  2. Visual.asset is different from Obj3.asset, see XComponent.Visual.asset
refPoint int

THREE.Points created from referencing model, with asset = entity id.

cubeVoxel int

voxel generated for Obj3.box

cubeVoxels int

ShaderFlag has a similar name, makes this error proven

DomCanvas int

html DOM as texture, test/example: htmltex.html

DynaSects int

lines group, with dynamic lines' segment, of which end points can be tweened and updated.

PathTube int

tube generated according curve geometry. Visual.paras: tubularSegments = 20, radius = 2, radialSegments = 6, closed = false,
the same as Three.js TubeBufferGeometry constructor

wireframe int

opengl / webgl wireframe

GeomCurve int

THREE.Curve, rendered as opengl / webgl line. Geometry is created with Obj3.geom.
So there are lines, curves and shape using this visual type.

DynaPolygon int

Daynamic polygon, extruded and the top vertices can be animated, with customer shader (not in v0.3)

Arrow int

used by axis

gltf int

gltf asset file

SvgPath int

Svg format asset

SvgExtrude int

Svg format asset

Sprite int

not used

UserMesh int

User provide mesh in Obj3.mesh

vertParticle int

Handled by as an extesion like XComponent.Dynatex by CanvTex

reflector3js int

A reference implementation of refrection, ported from Three.js mirror example

reflectex int

Shader receiving light, shadow, reflection & textures

Dynatex int

With component XComponent.Dynatex handled by CanvTex

Extension int

Handled by as a user extesion.
Thrender will create only an empty group.
Dynatex is a good example for use to implement / extend a component that only need an empty group.

Source:

(static, constant) CameraCtrl :int

Camera controls that XWorld supported for main scene.

Type:
  • int
Properties:
Name Type Description
Camctrl int

default camera ctrl

Mapctrl int

map ctrl

Orbitctrl int

orbit ctrl

Source:

(static, constant) Obj3Type :int

Types of THREE.Geometry, in addition to some extensions like shapes in 2d.

TODO To be renamed as GeomType

Type:
  • int
Properties:
Name Type Description
USER int

custom or undefined

BOX int

THREE.Box:
Obj3.box paras:
[width, height, depth]

PLANE int
SPHERE int
TORUS int
CONE int

Obj3.box: [radius, height, radialSegments]

Cylinder int

THREE.Cylinder
box paras:
radiusTop — Radius of the cylinder at the top. Default is 1.
radiusBottom — Radius of the cylinder at the bottom. Default is 1.
height — Height of the cylinder. Default is 1.
radialSegments — Number of segmented faces around the circumference of the cylinder. Default is 8
heightSegments — Number of rows of faces along the height of the cylinder. Default is 1.
openEnded — A Boolean indicating whether the ends of the cylinder are open or capped. Default is false, meaning capped.
thetaStart — Start angle for first segment, default = 0 (three o'clock position).
thetaLength — The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete cylinder.

Tetrahedron int

Three.js Tetrahedron
box paras:
radius — Radius of the tetrahedron. Default is 1.
detail — Default is 0. Setting this to a value greater than 0 adds vertices making it no longer a tetrahedron.

Dodecahedron int

Three.js Dodecahedron

Octahedron int

Three.js Octahedron

Icosahedron int

Three.js Icosahedron

SHAPE int

Three.js Icosahedron

RING int

Three.js Icosahedron

Polyhedron int

THREE.PolyhedronBufferGeometry, not supported

Lathe int

Three.js Icosahedron

CIRCLE int

line
For gl.LINE_STRip vs. gl.LINES, see Three.js Icosahedron

HILBERT int
RandomCurve int

Random CatmullRomCurve3

RandomSects int

Random line segments

PointSects int

THREE.Curve, with section points provided by user

PointGrid int

?

PointCurve int

same as pointSect, but converted to THREE.CatmullRomCurve3

SvgPath int

TODO

CatmullRom int
GeoPath int

Geojson path

MapXZRoad int

Polygon in xz plane from way points, with y = paras.y0.

Hexatile int

Hexatiles generated with help of AssetKeepr.

GeoPrism int

Tiles of cylinders generated by extruding polygon, with help of AssetKeepr.
Shader: ShaderFlag.boxLayers or texPrism

Spline int
XyHyperbola int
XyParabola int
XyEllipse int
GeoPoints int
Source:

(static, constant) ShaderAlpha :int

Shader alpha handling mode.

Type:
  • int
Properties:
Name Type Description
discard int

discard fragment when alpha less than threshold

mix int

defualt normal mix

multiply int

defualt normal mix

additive int

adding (clampped)

product int

color acculating by multiplication

differential int

color difference

Source:

(static, constant) ShaderFlag :int

Shater Types.

javascript operators uses 32 bits signed integers

reference: javascript bitwise operators
Type:
  • int
Properties:
Name Type Description
mask int

mask, 16 bits for types

lightened int

Materials of this kind of shader can accepting xlight.

testPoints int

default points shader

randomParticles int
cubeVoxels int

Shadding a cube into evenly distributed points, with texture

blinkStar int
flameLight int
colorArray int

Color array defined by visual.color, can be morphed by ModelSeqs.script.

scaleOrb int

A scaled volumetric orb, with each vertices has an "a_tan" vec3 attribute representing path point's direction

worldOrbs int

A scaled volumetric orb moving alone a_pos, a vec3 array, and tweened by a_t float

orbGroups int

Groups of moving orbs

tiledOrbs int

Orbs centered at eacth uniform 'geoLoc'

colorLine int

color line

texPrism int

polygon layers

boxLayers int

polygon layers (tiled floor)

cubeTex int

volumetric boxes texture

reflectex int

Only used for AssetType.reflectex

receiveShadow int

for testing receiving directional shadow, see receiving Three.js directional shadow handling.

fragShape int

Fragment shape

discard int

Igonre the face, e.g. a plane for picking Dynatex area.

Source:

(static, constant) TexFlag :int

Shader texture handling flag.

Type:
  • int
Properties:
Name Type Description
BLANK int
TESSELLATE int
DEFAULT_TEX int
Source: