/** * R3.D3.API.Mesh.Sphere * @constructor * @param apiMesh * @param radius * @param widthSegments * @param heightSegments */ R3.D3.API.Mesh.Sphere = function( apiMesh, radius, widthSegments, heightSegments ) { if (R3.Utils.UndefinedOrNull(apiMesh)) { apiMesh = { meshType : R3.D3.API.Mesh.MESH_TYPE_SPHERE }; } if (R3.Utils.UndefinedOrNull(apiMesh.meshType)) { apiMesh.meshType = R3.D3.API.Mesh.MESH_TYPE_SPHERE; } if (R3.Utils.UndefinedOrNull(radius)) { radius = 1; } this.radius = radius; if (R3.Utils.UndefinedOrNull(widthSegments)) { widthSegments = 5; } this.widthSegments = widthSegments; if (R3.Utils.UndefinedOrNull(heightSegments)) { heightSegments = 5; } this.heightSegments = heightSegments; R3.D3.API.Mesh.call( this, apiMesh.id, apiMesh.name, apiMesh.meshType, apiMesh.excludeFromEnvironment, apiMesh.vertices, apiMesh.faces, apiMesh.materials, apiMesh.parentMesh, apiMesh.parentScene, apiMesh.skeleton, apiMesh.skinIndices, apiMesh.skinWeights, apiMesh.position, apiMesh.quaternion, apiMesh.rotation, apiMesh.scale, apiMesh.up, apiMesh.modelMatrix, apiMesh.renderOrder, apiMesh.isBufferMesh, apiMesh.useQuaternion, apiMesh.visible, apiMesh.castShadow, apiMesh.receiveShadow, apiMesh.parentEntity ); }; R3.D3.API.Mesh.Sphere.prototype = Object.create(R3.D3.API.Mesh.prototype); R3.D3.API.Mesh.Sphere.prototype.constructor = R3.D3.API.Mesh.Sphere;