如果shape是一个"line", 则它是一个从折线描述的一个立面, 此时zShape的pathStep里面应该是和shape相同长度的PathStep数组, 里面的command和coords长度与第一个shape逐一对应, 但coords表示是z的起始位置和z的结束位置 并以每个类型为MOVE的PathStep作为折线段的起点 如果shape是一个'shape', 则它是一个从多边形描述的水平图形, 这时zShape的pathStep里面应该是和shape相同长度的PathStep数组, 里面的command和coords长度与第一个shape逐一对应, 但coords[0]表示其z高度 除第一个以外的类型为MOVE的PathStep作为一个孔的起点,可参考earcut的定义方式:https://github.com/mapbox/earcut
见上述说明
Array with animation clips.
Gets rendered into shadow map.
Array with object's children.
Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes. When shadow-casting with a DirectionalLight or SpotLight, if you are (a) modifying vertex positions in the vertex shader, (b) using a displacement map, (c) using an alpha map with alphaTest, or (d) using a transparent texture with alphaTest, you must specify a customDepthMaterial for proper shadows.
Same as customDepthMaterial, but used with PointLight.
When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object. If set to false the object gets rendered every frame even if it is not in the frustum of the camera.
Unique number of this object instance.
可碰撞成员元素
Used to check whether this or derived classes are Object3Ds. Default is true. You should not change this, as it is used internally for optimisation.
Local transform.
When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property.
The global transform of the object. If the Object3d has no parent, then it's identical to the local transform.
When this is set, it calculates the matrixWorld in that frame and resets this property to false.
Optional name of the object (doesn't need to be unique).
Calls after rendering object
Calls before rendering object
Object's parent in the scene graph.
Object's local position.
Object's local rotation as a Quaternion.
Material gets baked in shadow receiving.
Overrides the default rendering order of scene graph objects, from lowest to highest renderOrder. Opaque and transparent objects remain sorted independently though. When this property is set for an instance of Group, all descendants objects will be sorted and rendered together.
Object's local rotation (Euler angles), in radians.
Object's local scale.
Up direction.
An object that can be used to store custom data about the Object3d. It should not hold references to functions as these will not be cloned.
Object gets rendered if true.
Adds object as child of this object.
Adds a listener to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
This updates the position, rotation and scale with the matrix.
Adds object as a child of this, while maintaining the object's world transform.
Removes all child objects.
Fire an event type.
Searches through the object's children and returns the first with a matching id.
Unique number of the object instance
Searches through the object's children and returns the first with a matching name.
String to match to the children's Object3d.name property.
得到当前用以描述顶面/线的Shape对象
获取元素的uuid
获得从顶点序号到顶点位置的映射Map
得到当前用以描述侧面的Shape对象
Checks if listener is added to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
加载数据
加载数据所需要的参数
Updates the vector from local space to world space.
A local vector.
Rotates object to face point in space.
A world vector to look at.
注销事件监听
事件名
回调函数
注册事件监听
事件名
回调函数
Removes object as child of this object.
Removes a listener from an event type.
The type of the listener that gets removed.
The listener function that gets removed.
Rotate an object along an axis in object space. The axis is assumed to be normalized.
A normalized vector in object space.
The angle in radians.
Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent.
A normalized vector in object space.
The angle in radians.
设置元素的uuid
配置的uuid
设置单个已有顶点的位置
顶点序号
三维坐标
若顶点序号越界,则返回false
A normalized vector in object space.
The distance to translate.
Translates object along x axis by distance.
Distance.
Translates object along y axis by distance.
Distance.
Translates object along z axis by distance.
Distance.
Updates local transform.
Updates global transform of the object and its children.
Updates the vector from world space to local space.
A world vector.
生成三角化多边形网格 通过一个Shape描述形状, 通过第二个Shape来做高度的描述.
const rectsLinesShapeData = { id: 'rectsLines', x: panoData[2].position.x, y: panoData[2].position.y, zIndex: 1000, height: panoData[2].position.z - 0.5, shapeType: 'line', path: 'm-2,-2l-2,2l2,2l2,-2l-2,-2m-1,-1l-1,1l1,1l1,-1l-1,-1', fill: 0x00ffff, opacity: 1.0, scale: [1.0, 1.0, 1.0], rotation: [0.0, 0.0, 0.0, 1.0], }; const rectsLines = new Shape(rectsLinesShapeData); const rectsSidesShapeData = { id: 'rectsSides', shapeType: 'line', path: 'm1,0l1,0l1,0l1,0l1,0m1,-1l1,-1l1,-1l1,-1l1,-1', }; const rectsSides = new Shape(rectsSidesShapeData); const facade = new PolygonMesh( rectsLines, rectsSides, ); stage.bindElement(facade); const rectsPolygonShapeData = { id: 'rectsPolygon', x: panoData[2].position.x, y: panoData[2].position.y, zIndex: 1100, height: panoData[2].position.z - 0.5, shapeType: 'shape', path: 'm-2,-2l-2,2l2,2l2,-2l-2,-2m-1,-1l-1,1l1,1l1,-1l-1,-1', fill: 0xff00ff, opacity: 1.0, scale: [1.0, 1.0, 1.0], rotation: [0.0, 0.0, 0.0, 1.0], }; const rectsPolygon = new Shape(rectsPolygonShapeData); const polygon = new PolygonMesh( rectsPolygon, rectsSides, ); stage.bindElement(polygon);