Skip to content

Commit

Permalink
Merge pull request #198 from CesiumGS/samples_next
Browse files Browse the repository at this point in the history
Samples next
  • Loading branch information
lilleyse committed Apr 30, 2020
2 parents d2502ff + f1323ba commit 78827cc
Show file tree
Hide file tree
Showing 9 changed files with 2,358 additions and 1,277 deletions.
2,771 changes: 1,610 additions & 1,161 deletions samples-generator/bin/3d-tiles-samples-generator.ts

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion samples-generator/lib/compositeSamplesNext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ export namespace CompositeSamplesNext {
properties: {
Height: {
values: i3dmHeights
}
}
}
});
);

// b3dm
const transform = FeatureTableUtils.getDefaultTransform();
Expand Down Expand Up @@ -104,6 +105,7 @@ export namespace CompositeSamplesNext {
featureLayers: [
{
featureTable: 1,
instanceStride: 1,
vertexAttribute: {
implicit: {
increment: 1,
Expand Down
4 changes: 2 additions & 2 deletions samples-generator/lib/createBuildingsTile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ export function createBuildingsTile(options) {

export type BatchTable = {
id?: number[];
Longitude: number[];
Latitude: number[];
Longitude?: number[];
Latitude?: number[];
Height: number[];
}

Expand Down
25 changes: 18 additions & 7 deletions samples-generator/lib/createInstancesTile.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
import fsExtra = require('fs-extra');
import path = require('path');
import { Gltf } from './gltfType';
import { FLOAT32_SIZE_BYTES, UINT16_SIZE_BYTES, UINT32_SIZE_BYTES, UINT8_SIZE_BYTES } from './typeSize';
import { Cartesian2, Cartesian3, defaultValue, Math as CesiumMath, Matrix4 } from 'cesium';
import {
FLOAT32_SIZE_BYTES,
UINT16_SIZE_BYTES,
UINT8_SIZE_BYTES,
UINT32_SIZE_BYTES
} from './typeSize';
import {
Matrix4,
Cartesian2,
Cartesian3,
Math as CesiumMath,
defaultValue
} from 'cesium';

const createI3dm = require('./createI3dm');
const AttributeCompression = require('cesium').AttributeCompression;
Expand All @@ -29,10 +40,10 @@ export interface InstanceTileOptions {
}

export interface InstancesTileResult {
glb?: Buffer;
gltf?: Gltf;
i3dm?: any;
batchTableJson?: any;
glb?: Buffer,
gltf?: Gltf,
i3dm?: any,
batchTableJson?: any
}

/**
Expand Down Expand Up @@ -69,7 +80,7 @@ export async function createInstancesTile(
const transform = defaultValue(options.transform, Matrix4.IDENTITY);
const instancesLength = defaultValue(options.instancesLength, 25);
let uri = options.uri;
const embed = defaultValue(options.embed, true);
const embed = defaultValue(options.embed, true) as boolean;
const modelSize = defaultValue(options.modelSize, 20.0) as number;
const createBatchTable = defaultValue(options.createBatchTable, true);
const createBatchTableBinary = defaultValue(
Expand Down
2 changes: 1 addition & 1 deletion samples-generator/lib/createPointCloudTile.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';
import { createFeatureMetadataExtension } from './createFeatureMetadataExtension';
import { Extensions } from './Extensions';

var Cesium = require('cesium');
var draco3d = require('draco3d');
var SimplexNoise = require('simplex-noise');
var createPnts = require('./createPnts');
var Extensions = require('./Extensions');
var createGltfFromPnts = require('./createGltfFromPnts');
var typeConversion = require('./typeConversion');

Expand Down
Loading

0 comments on commit 78827cc

Please sign in to comment.