@@ -17,9 +17,6 @@ pub struct OzzBlend {
17
17
spine_trans : Vec < OzzTransform > ,
18
18
}
19
19
20
- unsafe impl Send for OzzBlend { }
21
- unsafe impl Sync for OzzBlend { }
22
-
23
20
impl OzzBlend {
24
21
pub async fn new ( ) -> Box < dyn OzzExample > {
25
22
let ( ( mut ar_skeleton, mut ar_animation1) , ( mut ar_animation2, mut ar_animation3) ) = try_zip (
@@ -40,7 +37,7 @@ impl OzzBlend {
40
37
let animation2 = Arc :: new ( Animation :: from_archive ( & mut ar_animation2) . unwrap ( ) ) ;
41
38
let animation3 = Arc :: new ( Animation :: from_archive ( & mut ar_animation3) . unwrap ( ) ) ;
42
39
43
- let mut ob = OzzBlend {
40
+ let mut o = OzzBlend {
44
41
skeleton : skeleton. clone ( ) ,
45
42
sample_job1 : SamplingJob :: default ( ) ,
46
43
sample_job2 : SamplingJob :: default ( ) ,
@@ -52,40 +49,40 @@ impl OzzBlend {
52
49
spine_trans : Vec :: new ( ) ,
53
50
} ;
54
51
55
- ob . sample_job1 . set_animation ( animation1. clone ( ) ) ;
56
- ob . sample_job1
52
+ o . sample_job1 . set_animation ( animation1. clone ( ) ) ;
53
+ o . sample_job1
57
54
. set_context ( SamplingContext :: new ( animation1. num_tracks ( ) ) ) ;
58
55
let sample_out1 = Arc :: new ( RwLock :: new ( vec ! [ SoaTransform :: default ( ) ; skeleton. num_soa_joints( ) ] ) ) ;
59
- ob . sample_job1 . set_output ( sample_out1. clone ( ) ) ;
56
+ o . sample_job1 . set_output ( sample_out1. clone ( ) ) ;
60
57
61
- ob . sample_job2 . set_animation ( animation2. clone ( ) ) ;
62
- ob . sample_job2
58
+ o . sample_job2 . set_animation ( animation2. clone ( ) ) ;
59
+ o . sample_job2
63
60
. set_context ( SamplingContext :: new ( animation2. num_tracks ( ) ) ) ;
64
61
let sample_out2 = Arc :: new ( RwLock :: new ( vec ! [ SoaTransform :: default ( ) ; skeleton. num_soa_joints( ) ] ) ) ;
65
- ob . sample_job2 . set_output ( sample_out2. clone ( ) ) ;
62
+ o . sample_job2 . set_output ( sample_out2. clone ( ) ) ;
66
63
67
- ob . sample_job3 . set_animation ( animation3. clone ( ) ) ;
68
- ob . sample_job3
64
+ o . sample_job3 . set_animation ( animation3. clone ( ) ) ;
65
+ o . sample_job3
69
66
. set_context ( SamplingContext :: new ( animation3. num_tracks ( ) ) ) ;
70
67
let sample_out3 = Arc :: new ( RwLock :: new ( vec ! [ SoaTransform :: default ( ) ; skeleton. num_soa_joints( ) ] ) ) ;
71
- ob . sample_job3 . set_output ( sample_out3. clone ( ) ) ;
68
+ o . sample_job3 . set_output ( sample_out3. clone ( ) ) ;
72
69
73
- ob . blending_job . set_skeleton ( skeleton. clone ( ) ) ;
70
+ o . blending_job . set_skeleton ( skeleton. clone ( ) ) ;
74
71
let blending_out = Arc :: new ( RwLock :: new ( vec ! [ SoaTransform :: default ( ) ; skeleton. num_soa_joints( ) ] ) ) ;
75
- ob . blending_job . set_output ( blending_out. clone ( ) ) ;
76
- ob . blending_job
72
+ o . blending_job . set_output ( blending_out. clone ( ) ) ;
73
+ o . blending_job
77
74
. layers_mut ( )
78
75
. push ( BlendingLayer :: new ( sample_out1. clone ( ) ) ) ;
79
- ob . blending_job
76
+ o . blending_job
80
77
. layers_mut ( )
81
78
. push ( BlendingLayer :: new ( sample_out2. clone ( ) ) ) ;
82
- ob . blending_job
79
+ o . blending_job
83
80
. layers_mut ( )
84
81
. push ( BlendingLayer :: new ( sample_out3. clone ( ) ) ) ;
85
82
86
- ob . l2m_job . set_skeleton ( skeleton. clone ( ) ) ;
87
- ob . l2m_job . set_input ( blending_out. clone ( ) ) ;
88
- ob . l2m_job . set_output ( ob . models . clone ( ) ) ;
83
+ o . l2m_job . set_skeleton ( skeleton. clone ( ) ) ;
84
+ o . l2m_job . set_input ( blending_out. clone ( ) ) ;
85
+ o . l2m_job . set_output ( o . models . clone ( ) ) ;
89
86
90
87
let mut bone_count = 0 ;
91
88
let mut spine_count = 0 ;
@@ -101,9 +98,9 @@ impl OzzBlend {
101
98
}
102
99
}
103
100
104
- ob . bone_trans . reserve ( bone_count) ;
105
- ob . spine_trans . reserve ( spine_count) ;
106
- Box :: new ( ob )
101
+ o . bone_trans . reserve ( bone_count) ;
102
+ o . spine_trans . reserve ( spine_count) ;
103
+ Box :: new ( o )
107
104
}
108
105
}
109
106
0 commit comments