Skip to content

Commit

Permalink
new trait demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Nan committed Apr 9, 2024
1 parent c6ff670 commit 0d525fe
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
10 changes: 5 additions & 5 deletions demo/src/blend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use crate::base::*;

pub struct OzzBlend {
skeleton: Arc<Skeleton>,
sample_job1: SamplingJobMT,
sample_job2: SamplingJobMT,
sample_job3: SamplingJobMT,
blending_job: BlendingJobMT,
l2m_job: LocalToModelJobMT,
sample_job1: SamplingJobArc,
sample_job2: SamplingJobArc,
sample_job3: SamplingJobArc,
blending_job: BlendingJobArc,
l2m_job: LocalToModelJobArc,
models: Arc<RwLock<Vec<Mat4>>>,
bone_trans: Vec<OzzTransform>,
spine_trans: Vec<OzzTransform>,
Expand Down
4 changes: 2 additions & 2 deletions demo/src/playback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use crate::base::*;

pub struct OzzPlayback {
skeleton: Arc<Skeleton>,
sample_job: SamplingJobMT,
l2m_job: LocalToModelJobMT,
sample_job: SamplingJobArc,
l2m_job: LocalToModelJobArc,
models: Arc<RwLock<Vec<Mat4>>>,
bone_trans: Vec<OzzTransform>,
spine_trans: Vec<OzzTransform>,
Expand Down
6 changes: 3 additions & 3 deletions demo/src/two_bone_ik.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const TARGET_OFFSET: Vec3 = Vec3::new(0.0, 0.2, 0.1);

pub struct OzzTwoBoneIK {
skeleton: Arc<Skeleton>,
l2m_job1: LocalToModelJobMT,
l2m_job1: LocalToModelJobArc,
ik_job: IKTwoBoneJob,
l2m_job2: LocalToModelJobMT,
l2m_job2: LocalToModelJobArc,
locals: Arc<RwLock<Vec<SoaTransform>>>,
models1: Arc<RwLock<Vec<Mat4>>>,
models2: Arc<RwLock<Vec<Mat4>>>,
Expand Down Expand Up @@ -122,7 +122,7 @@ impl OzzExample for OzzTwoBoneIK {
self.models2
.mut_buf()
.unwrap()
.clone_from_slice(self.models1.buf().unwrap().as_slice());
.clone_from_slice(self.models1.buf().unwrap().as_ref());
{
let mut locals_mut = self.locals.mut_buf().unwrap();

Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ pub use sampling_job::{
InterpSoaFloat3, InterpSoaQuaternion, SamplingContext, SamplingJob, SamplingJobArc, SamplingJobRc, SamplingJobRef,
};
pub use skeleton::Skeleton;
pub use skinning_job::{SkinningJob, SkinningJobArc, SkinningJobRc, SkinningJobRef};
pub use track::Track;
pub use track_sampling_job::{TrackSamplingJob, TrackSamplingJobArc, TrackSamplingJobRc, TrackSamplingJobRef};
pub use track_triggering_job::{
TrackTriggeringJob, TrackTriggeringJobArc, TrackTriggeringJobRc, TrackTriggeringJobRef,
};
// pub use skinning_job::{SkinningJob, SkinningJobArc, SkinningJobRc, SkinningJobRef};
// pub use track::Track;
// pub use track_sampling_job::{TrackSamplingJob, TrackSamplingJobArc, TrackSamplingJobRc, TrackSamplingJobRef};
// pub use track_triggering_job::{
// TrackTriggeringJob, TrackTriggeringJobArc, TrackTriggeringJobRc, TrackTriggeringJobRef,
// };
3 changes: 3 additions & 0 deletions src/sampling_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ pub struct SamplingContext {
scale_cursor: usize,
}

unsafe impl Send for SamplingContext {}
unsafe impl Sync for SamplingContext {}

impl Debug for SamplingContext {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
return f
Expand Down

0 comments on commit 0d525fe

Please sign in to comment.