Thanks Sean,
I managed to change the factory to add my own dummy format.
var factory = Cesium.Cesium3DTileContentFactory;
factory[“pkso”] = function (tileset, tile, url, arrayBuffer, byteOffset) {
return new PksTileContent(tileset, tile, url, arrayBuffer, byteOffset, this._dataSource);
};
``
and also create a dummy tile content class
class PksTileContent {
featuresLength = 1;
pointsLength = 0;
trianglesLength = 0;
geometryByteLength = 0;
texturesByteLength = 0;
batchTableByteLength = 0;
innerContents = undefined;
batchTable = undefined;
featurePropertiesDirty = false;
constructor(public tileset, public tile, public url, arrayBuffer, byteOffset,private dataSource) {
}
readyPromise = new Promise((resolve, reject) => { setTimeout(() => { resolve(true); this.test = false; }, 60000); });
hasProperty(b, n) {
debugger;
return false;
}
getFeature(b) {
debugger;
}
applyDebugSettings(e, c) {
debugger;
}
applyStyle(fs, s) {
debugger;
}
test = false;
mypolygon = null;
update(tileset, framestate) {
//What should I exactly do in update?
if (!this.test) {
console.log(framestate);
this.test = true;
}
if (!this.mypolygon) {
this.mypolygon = this.dataSource.entities.add({
name: ‘Orange polygon with per-position heights and outline’,
polygon: {
hierarchy: ,
extrudedHeight: 0,
perPositionHeight: true,
material: Cesium.Color.BLACK,
outline: true,
outlineColor: Cesium.Color.BLACK
}
});
}
}
isDestroyed() {
debugger;
return false;
}
destroy() {
debugger;
}
}
``
and everything works, loading up just fine when adding my tileset dummy tileset.
var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
url: ‘…/src/demos/3dtiles/content/tileset.json’
}));
``
I think that I got the basic covers from this little experiment.
Since I am just going to hack this demo together as a proof of concept, i dont want to go to deep into 3d programming and instead just want to load up my content from this custom format and add it to my datasource using the entity api.
Would it be correct that I should keep some state about which “entities” i have loaded
and as more detailed tiles are being loaded up I should update my entities positions.
Also, if i want to create a dummy filestreaming position sampled property, is it possible that cesium only downloads the first X bytes of the content url (containing my time index) and then as the update callback runs it can request other parts of the file depending on time/view? (if not, since I am also creating the api for my content tiles, i can just on return the first bytes only unless some magic query string is present).