@@ -52,12 +52,12 @@ const colliderDefaultOptions: NgtrColliderOptions = {
52
52
53
53
@Directive ( { selector : 'ngt-object3D[collider]' } )
54
54
export 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' ] > ( ) ;
61
61
options = input ( colliderDefaultOptions , { transform : mergeInputs ( rigidBodyDefaultOptions ) } ) ;
62
62
63
63
private object3DParameters = computed ( ( ) => {
@@ -70,7 +70,7 @@ export class NgtrAnyCollider {
70
70
this . name ( ) ,
71
71
] ;
72
72
73
- const parameters = { position, scale, userData, name } ;
73
+ const parameters = { position, scale, userData, name : name || ` ${ untracked ( this . shape ) } - ${ Date . now ( ) } ` } ;
74
74
75
75
if ( quaternion ) {
76
76
Object . assign ( parameters , { quaternion } ) ;
@@ -85,6 +85,7 @@ export class NgtrAnyCollider {
85
85
86
86
// TODO: change this to input required when Angular allows setting hostDirective input
87
87
shape = model < NgtrColliderShape | undefined > ( undefined , { alias : 'collider' } ) ;
88
+ // NOTE: this will be typed by individual collider
88
89
args = model < unknown [ ] > ( [ ] ) ;
89
90
90
91
collisionEnter = output < NgtrCollisionEnterPayload > ( ) ;
@@ -442,11 +443,11 @@ export class NgtrRigidBody {
442
443
return value ;
443
444
} ,
444
445
} ) ;
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' ] > ( ) ;
450
451
options = input ( rigidBodyDefaultOptions , { transform : mergeInputs ( rigidBodyDefaultOptions ) } ) ;
451
452
452
453
private object3DParameters = computed ( ( ) => {
0 commit comments