/** * GameLib.D3.API.Mesh.Sphere * @constructor * @param apiMesh * @param radius * @param widthSegments * @param heightSegments */ GameLib.D3.API.Mesh.Sphere = function( apiMesh, radius, widthSegments, heightSegments ) { if (GameLib.Utils.UndefinedOrNull(apiMesh)) { apiMesh = { meshType : GameLib.D3.API.Mesh.MESH_TYPE_SPHERE }; } if (GameLib.Utils.UndefinedOrNull(apiMesh.meshType)) { apiMesh.meshType = GameLib.D3.API.Mesh.MESH_TYPE_SPHERE; } if (GameLib.Utils.UndefinedOrNull(radius)) { radius = 1; } this.radius = radius; if (GameLib.Utils.UndefinedOrNull(widthSegments)) { widthSegments = 5; } this.widthSegments = widthSegments; if (GameLib.Utils.UndefinedOrNull(heightSegments)) { heightSegments = 5; } this.heightSegments = heightSegments; GameLib.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 ); }; GameLib.D3.API.Mesh.Sphere.prototype = Object.create(GameLib.D3.API.Mesh.prototype); GameLib.D3.API.Mesh.Sphere.prototype.constructor = GameLib.D3.API.Mesh.Sphere;