@@ -52,12 +52,12 @@ const colliderDefaultOptions: NgtrColliderOptions = {
5252
5353@Directive ( { selector : 'ngt-object3D[collider]' } )
5454export class NgtrAnyCollider {
55- position = input < NgtVector3 | undefined > ( [ 0 , 0 , 0 ] ) ;
56- rotation = input < NgtEuler | undefined > ( ) ;
57- scale = input < NgtVector3 | undefined > ( [ 1 , 1 , 1 ] ) ;
58- quaternion = input < NgtQuaternion | undefined > ( ) ;
59- userData = input < NgtThreeElements [ 'ngt-object3D' ] [ 'userData' ] | undefined > ( undefined ) ;
60- name = input < NgtThreeElements [ 'ngt-object3D' ] [ 'name' ] | undefined > ( undefined ) ;
55+ position = input < NgtVector3 > ( [ 0 , 0 , 0 ] ) ;
56+ rotation = input < NgtEuler > ( ) ;
57+ scale = input < NgtVector3 > ( [ 1 , 1 , 1 ] ) ;
58+ quaternion = input < NgtQuaternion > ( ) ;
59+ userData = input < NgtThreeElements [ 'ngt-object3D' ] [ 'userData' ] > ( ) ;
60+ name = input < NgtThreeElements [ 'ngt-object3D' ] [ 'name' ] > ( ) ;
6161 options = input ( colliderDefaultOptions , { transform : mergeInputs ( rigidBodyDefaultOptions ) } ) ;
6262
6363 private object3DParameters = computed ( ( ) => {
@@ -70,7 +70,7 @@ export class NgtrAnyCollider {
7070 this . name ( ) ,
7171 ] ;
7272
73- const parameters = { position, scale, userData, name } ;
73+ const parameters = { position, scale, userData, name : name || ` ${ untracked ( this . shape ) } - ${ Date . now ( ) } ` } ;
7474
7575 if ( quaternion ) {
7676 Object . assign ( parameters , { quaternion } ) ;
@@ -85,6 +85,7 @@ export class NgtrAnyCollider {
8585
8686 // TODO: change this to input required when Angular allows setting hostDirective input
8787 shape = model < NgtrColliderShape | undefined > ( undefined , { alias : 'collider' } ) ;
88+ // NOTE: this will be typed by individual collider
8889 args = model < unknown [ ] > ( [ ] ) ;
8990
9091 collisionEnter = output < NgtrCollisionEnterPayload > ( ) ;
@@ -442,11 +443,11 @@ export class NgtrRigidBody {
442443 return value ;
443444 } ,
444445 } ) ;
445- position = input < NgtVector3 | undefined > ( [ 0 , 0 , 0 ] ) ;
446- rotation = input < NgtEuler | undefined > ( [ 0 , 0 , 0 ] ) ;
447- scale = input < NgtVector3 | undefined > ( [ 1 , 1 , 1 ] ) ;
448- quaternion = input < NgtQuaternion | undefined > ( [ 0 , 0 , 0 , 1 ] ) ;
449- userData = input < NgtThreeElements [ 'ngt-object3D' ] [ 'userData' ] | undefined > ( undefined ) ;
446+ position = input < NgtVector3 > ( [ 0 , 0 , 0 ] ) ;
447+ rotation = input < NgtEuler > ( ) ;
448+ scale = input < NgtVector3 > ( [ 1 , 1 , 1 ] ) ;
449+ quaternion = input < NgtQuaternion > ( ) ;
450+ userData = input < NgtThreeElements [ 'ngt-object3D' ] [ 'userData' ] > ( ) ;
450451 options = input ( rigidBodyDefaultOptions , { transform : mergeInputs ( rigidBodyDefaultOptions ) } ) ;
451452
452453 private object3DParameters = computed ( ( ) => {
0 commit comments