Comparing version 0.0.97 to 0.0.98
{ | ||
"name": "ogl", | ||
"version": "0.0.97", | ||
"version": "0.0.98", | ||
"description": "WebGL Library", | ||
@@ -5,0 +5,0 @@ "exports": "./src/index.mjs", |
@@ -102,3 +102,3 @@ import { Transform } from './Transform.js'; | ||
frustumIntersectsMesh(node) { | ||
frustumIntersectsMesh(node, worldMatrix = node.worldMatrix) { | ||
// If no position attribute, treat as frustumCulled false | ||
@@ -113,5 +113,5 @@ if (!node.geometry.attributes.position) return true; | ||
center.copy(node.geometry.bounds.center); | ||
center.applyMatrix4(node.worldMatrix); | ||
center.applyMatrix4(worldMatrix); | ||
const radius = node.geometry.bounds.radius * node.worldMatrix.getMaxScaleOnAxis(); | ||
const radius = node.geometry.bounds.radius * worldMatrix.getMaxScaleOnAxis(); | ||
@@ -118,0 +118,0 @@ return this.frustumIntersectsSphere(center, radius); |
@@ -26,3 +26,3 @@ // TODO: upload empty texture if null ? maybe not | ||
) { | ||
if (!gl.canvas) console.error('gl not passed as fist argument to Program'); | ||
if (!gl.canvas) console.error('gl not passed as first argument to Program'); | ||
this.gl = gl; | ||
@@ -29,0 +29,0 @@ this.uniforms = uniforms; |
324887