🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

babylonjs-float32heightmap

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babylonjs-float32heightmap - npm Package Compare versions

Comparing version

to
0.1.1

3

dist/GroundBuilderEx.d.ts
import { Scene } from "@babylonjs/core/scene";
import { GroundMesh } from "@babylonjs/core/Meshes/groundMesh";
import { Nullable } from '@babylonjs/core/types';
export declare function CreateGroundFromFloat32Array(name: string, buffer: Float32Array, bufferWidth: number, bufferHeight: number, width: number, height: number, subdivisions: number, scene: Scene, updatable?: boolean, onReady?: (mesh: GroundMesh) => void): GroundMesh;
export declare function CreateGroundFromFloat32Array(name: string, buffer: Float32Array, bufferWidth: number, bufferHeight: number, minHeight: number, width: number, height: number, subdivisions: number, scene: Scene, updatable?: boolean, onReady?: (mesh: GroundMesh) => void): GroundMesh;
/**

@@ -28,2 +28,3 @@ * Class containing static functions to help procedurally build meshes

height?: number;
minHeight?: number;
subdivisions?: number;

@@ -30,0 +31,0 @@ updatable?: boolean;

@@ -36,8 +36,16 @@ import { Vector3 } from '@babylonjs/core/Maths/math.vector';

var idx4 = (col + (row + 1) * (options.subdivisions + 1));
indices.push(idx1);
indices.push(idx2);
indices.push(idx3);
indices.push(idx4);
indices.push(idx1);
indices.push(idx3);
var isVisibleIdx1 = positions[idx1 * 3 + 1] >= options.minHeight;
var isVisibleIdx2 = positions[idx2 * 3 + 1] >= options.minHeight;
var isVisibleIdx3 = positions[idx3 * 3 + 1] >= options.minHeight;
if (isVisibleIdx1 && isVisibleIdx2 && isVisibleIdx3) {
indices.push(idx1);
indices.push(idx2);
indices.push(idx3);
}
var isVisibleIdx4 = positions[idx4 * 3 + 1] >= options.minHeight;
if (isVisibleIdx4 && isVisibleIdx1 && isVisibleIdx3) {
indices.push(idx4);
indices.push(idx1);
indices.push(idx3);
}
}

@@ -55,6 +63,7 @@ }

};
function CreateGroundFromFloat32Array(name, buffer, bufferWidth, bufferHeight, width, height, subdivisions, scene, updatable, onReady) {
function CreateGroundFromFloat32Array(name, buffer, bufferWidth, bufferHeight, minHeight, width, height, subdivisions, scene, updatable, onReady) {
var options = {
width: width,
height: height,
minHeight: minHeight,
subdivisions: subdivisions,

@@ -92,2 +101,3 @@ updatable: updatable,

var height = options.height || 10.0;
var minHeight = options.minHeight || -1000;
var subdivisions = options.subdivisions || 1 | 0;

@@ -113,3 +123,4 @@ var updatable = options.updatable;

subdivisions: subdivisions,
buffer: buffer, bufferWidth: bufferWidth, bufferHeight: bufferHeight
buffer: buffer, bufferWidth: bufferWidth, bufferHeight: bufferHeight,
minHeight: minHeight
});

@@ -116,0 +127,0 @@ vertexData.applyToMesh(ground, updatable);

@@ -40,8 +40,16 @@ 'use strict';

var idx4 = (col + (row + 1) * (options.subdivisions + 1));
indices.push(idx1);
indices.push(idx2);
indices.push(idx3);
indices.push(idx4);
indices.push(idx1);
indices.push(idx3);
var isVisibleIdx1 = positions[idx1 * 3 + 1] >= options.minHeight;
var isVisibleIdx2 = positions[idx2 * 3 + 1] >= options.minHeight;
var isVisibleIdx3 = positions[idx3 * 3 + 1] >= options.minHeight;
if (isVisibleIdx1 && isVisibleIdx2 && isVisibleIdx3) {
indices.push(idx1);
indices.push(idx2);
indices.push(idx3);
}
var isVisibleIdx4 = positions[idx4 * 3 + 1] >= options.minHeight;
if (isVisibleIdx4 && isVisibleIdx1 && isVisibleIdx3) {
indices.push(idx4);
indices.push(idx1);
indices.push(idx3);
}
}

@@ -59,6 +67,7 @@ }

};
function CreateGroundFromFloat32Array(name, buffer, bufferWidth, bufferHeight, width, height, subdivisions, scene, updatable, onReady) {
function CreateGroundFromFloat32Array(name, buffer, bufferWidth, bufferHeight, minHeight, width, height, subdivisions, scene, updatable, onReady) {
var options = {
width: width,
height: height,
minHeight: minHeight,
subdivisions: subdivisions,

@@ -96,2 +105,3 @@ updatable: updatable,

var height = options.height || 10.0;
var minHeight = options.minHeight || -1000;
var subdivisions = options.subdivisions || 1 | 0;

@@ -117,3 +127,4 @@ var updatable = options.updatable;

subdivisions: subdivisions,
buffer: buffer, bufferWidth: bufferWidth, bufferHeight: bufferHeight
buffer: buffer, bufferWidth: bufferWidth, bufferHeight: bufferHeight,
minHeight: minHeight
});

@@ -120,0 +131,0 @@ vertexData.applyToMesh(ground, updatable);

{
"name": "babylonjs-float32heightmap",
"version": "0.1.0",
"version": "0.1.1",
"description": "generate babylonjs heightmaps from float32 arrays",

@@ -5,0 +5,0 @@ "main": "dist/index.js",