1- import { Directive , effect , inject , input , untracked } from '@angular/core' ;
1+ import { Directive , effect , inject , input } from '@angular/core' ;
22import { NgtrAnyCollider } from './rigid-body' ;
33import {
44 NgtrBallArgs ,
@@ -33,10 +33,7 @@ export class NgtrCuboidCollider {
3333 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
3434 anyCollider . setShape ( 'cuboid' ) ;
3535 effect ( ( ) => {
36- const args = this . args ( ) ;
37- untracked ( ( ) => {
38- anyCollider . setArgs ( args ) ;
39- } ) ;
36+ anyCollider . setArgs ( this . args ( ) ) ;
4037 } ) ;
4138 }
4239}
@@ -49,10 +46,7 @@ export class NgtrCapsuleCollider {
4946 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
5047 anyCollider . setShape ( 'capsule' ) ;
5148 effect ( ( ) => {
52- const args = this . args ( ) ;
53- untracked ( ( ) => {
54- anyCollider . setArgs ( args ) ;
55- } ) ;
49+ anyCollider . setArgs ( this . args ( ) ) ;
5650 } ) ;
5751 }
5852}
@@ -65,10 +59,7 @@ export class NgtrBallCollider {
6559 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
6660 anyCollider . setShape ( 'ball' ) ;
6761 effect ( ( ) => {
68- const args = this . args ( ) ;
69- untracked ( ( ) => {
70- anyCollider . setArgs ( args ) ;
71- } ) ;
62+ anyCollider . setArgs ( this . args ( ) ) ;
7263 } ) ;
7364 }
7465}
@@ -81,10 +72,7 @@ export class NgtrConvexHullCollider {
8172 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
8273 anyCollider . setShape ( 'roundConvexHull' ) ;
8374 effect ( ( ) => {
84- const args = this . args ( ) ;
85- untracked ( ( ) => {
86- anyCollider . setArgs ( args ) ;
87- } ) ;
75+ anyCollider . setArgs ( this . args ( ) ) ;
8876 } ) ;
8977 }
9078}
@@ -97,10 +85,7 @@ export class NgtrHeightfieldCollider {
9785 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
9886 anyCollider . setShape ( 'heightfield' ) ;
9987 effect ( ( ) => {
100- const args = this . args ( ) ;
101- untracked ( ( ) => {
102- anyCollider . setArgs ( args ) ;
103- } ) ;
88+ anyCollider . setArgs ( this . args ( ) ) ;
10489 } ) ;
10590 }
10691}
@@ -113,10 +98,7 @@ export class NgtrTrimeshCollider {
11398 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
11499 anyCollider . setShape ( 'trimesh' ) ;
115100 effect ( ( ) => {
116- const args = this . args ( ) ;
117- untracked ( ( ) => {
118- anyCollider . setArgs ( args ) ;
119- } ) ;
101+ anyCollider . setArgs ( this . args ( ) ) ;
120102 } ) ;
121103 }
122104}
@@ -129,10 +111,7 @@ export class NgtrPolylineCollider {
129111 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
130112 anyCollider . setShape ( 'polyline' ) ;
131113 effect ( ( ) => {
132- const args = this . args ( ) ;
133- untracked ( ( ) => {
134- anyCollider . setArgs ( args ) ;
135- } ) ;
114+ anyCollider . setArgs ( this . args ( ) ) ;
136115 } ) ;
137116 }
138117}
@@ -145,10 +124,7 @@ export class NgtrRoundCuboidCollider {
145124 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
146125 anyCollider . setShape ( 'roundCuboid' ) ;
147126 effect ( ( ) => {
148- const args = this . args ( ) ;
149- untracked ( ( ) => {
150- anyCollider . setArgs ( args ) ;
151- } ) ;
127+ anyCollider . setArgs ( this . args ( ) ) ;
152128 } ) ;
153129 }
154130}
@@ -161,10 +137,7 @@ export class NgtrCylinderCollider {
161137 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
162138 anyCollider . setShape ( 'cylinder' ) ;
163139 effect ( ( ) => {
164- const args = this . args ( ) ;
165- untracked ( ( ) => {
166- anyCollider . setArgs ( args ) ;
167- } ) ;
140+ anyCollider . setArgs ( this . args ( ) ) ;
168141 } ) ;
169142 }
170143}
@@ -177,10 +150,7 @@ export class NgtrRoundCylinderCollider {
177150 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
178151 anyCollider . setShape ( 'roundCylinder' ) ;
179152 effect ( ( ) => {
180- const args = this . args ( ) ;
181- untracked ( ( ) => {
182- anyCollider . setArgs ( args ) ;
183- } ) ;
153+ anyCollider . setArgs ( this . args ( ) ) ;
184154 } ) ;
185155 }
186156}
@@ -193,10 +163,7 @@ export class NgtrConeCollider {
193163 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
194164 anyCollider . setShape ( 'cone' ) ;
195165 effect ( ( ) => {
196- const args = this . args ( ) ;
197- untracked ( ( ) => {
198- anyCollider . setArgs ( args ) ;
199- } ) ;
166+ anyCollider . setArgs ( this . args ( ) ) ;
200167 } ) ;
201168 }
202169}
@@ -209,10 +176,7 @@ export class NgtrRoundConeCollider {
209176 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
210177 anyCollider . setShape ( 'roundCone' ) ;
211178 effect ( ( ) => {
212- const args = this . args ( ) ;
213- untracked ( ( ) => {
214- anyCollider . setArgs ( args ) ;
215- } ) ;
179+ anyCollider . setArgs ( this . args ( ) ) ;
216180 } ) ;
217181 }
218182}
@@ -225,10 +189,7 @@ export class NgtrConvexMeshCollider {
225189 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
226190 anyCollider . setShape ( 'convexMesh' ) ;
227191 effect ( ( ) => {
228- const args = this . args ( ) ;
229- untracked ( ( ) => {
230- anyCollider . setArgs ( args ) ;
231- } ) ;
192+ anyCollider . setArgs ( this . args ( ) ) ;
232193 } ) ;
233194 }
234195}
@@ -241,10 +202,7 @@ export class NgtrRoundConvexHullCollider {
241202 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
242203 anyCollider . setShape ( 'roundConvexHull' ) ;
243204 effect ( ( ) => {
244- const args = this . args ( ) ;
245- untracked ( ( ) => {
246- anyCollider . setArgs ( args ) ;
247- } ) ;
205+ anyCollider . setArgs ( this . args ( ) ) ;
248206 } ) ;
249207 }
250208}
@@ -257,10 +215,7 @@ export class NgtrRoundConvexMeshCollider {
257215 const anyCollider = inject ( NgtrAnyCollider , { host : true } ) ;
258216 anyCollider . setShape ( 'roundConvexMesh' ) ;
259217 effect ( ( ) => {
260- const args = this . args ( ) ;
261- untracked ( ( ) => {
262- anyCollider . setArgs ( args ) ;
263- } ) ;
218+ anyCollider . setArgs ( this . args ( ) ) ;
264219 } ) ;
265220 }
266221}
0 commit comments