Skip to content

Commit

Permalink
DecalGeometry: Add default parameters. (#29868)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored Nov 12, 2024
1 parent 2c2bfc3 commit 91147e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/jsm/geometries/DecalGeometry.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {
BufferGeometry,
Euler,
Float32BufferAttribute,
Matrix3,
Matrix4,
Mesh,
Vector3
} from 'three';

Expand All @@ -23,7 +25,7 @@ import {

class DecalGeometry extends BufferGeometry {

constructor( mesh, position, orientation, size ) {
constructor( mesh = new Mesh(), position = new Vector3(), orientation = new Euler(), size = new Vector3( 1, 1, 1 ) ) {

super();

Expand Down Expand Up @@ -109,6 +111,8 @@ class DecalGeometry extends BufferGeometry {

} else {

if ( positionAttribute === undefined ) return; // empty geometry

// non-indexed BufferGeometry

for ( let i = 0; i < positionAttribute.count; i ++ ) {
Expand Down

0 comments on commit 91147e9

Please sign in to comment.