mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-23 13:17:44 +00:00
Improve PBD documentation
This commit is contained in:
parent
88562f4dc6
commit
2ded1ac2a0
1 changed files with 5 additions and 0 deletions
|
@ -48,16 +48,20 @@ pub struct PreBoneDeformer {
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct PreBoneDeformBone {
|
pub struct PreBoneDeformBone {
|
||||||
|
/// Name of the affected bone
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
/// The deform matrix
|
||||||
pub deform: [f32; 12]
|
pub deform: [f32; 12]
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct PreBoneDeformMatrices {
|
pub struct PreBoneDeformMatrices {
|
||||||
|
/// The prebone deform bones
|
||||||
pub bones: Vec<PreBoneDeformBone>
|
pub bones: Vec<PreBoneDeformBone>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PreBoneDeformer {
|
impl PreBoneDeformer {
|
||||||
|
/// Reads an existing PBD file
|
||||||
pub fn from_existing(buffer: ByteSpan) -> Option<PreBoneDeformer> {
|
pub fn from_existing(buffer: ByteSpan) -> Option<PreBoneDeformer> {
|
||||||
let mut cursor = Cursor::new(buffer);
|
let mut cursor = Cursor::new(buffer);
|
||||||
let mut header = PreBoneDeformerHeader::read(&mut cursor).ok()?;
|
let mut header = PreBoneDeformerHeader::read(&mut cursor).ok()?;
|
||||||
|
@ -69,6 +73,7 @@ impl PreBoneDeformer {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Calculates the deform matrices between two races
|
||||||
pub fn get_deform_matrices(&self, from_body_id: u16, to_body_id: u16) -> Option<PreBoneDeformMatrices> {
|
pub fn get_deform_matrices(&self, from_body_id: u16, to_body_id: u16) -> Option<PreBoneDeformMatrices> {
|
||||||
if from_body_id == to_body_id {
|
if from_body_id == to_body_id {
|
||||||
return None;
|
return None;
|
||||||
|
|
Loading…
Add table
Reference in a new issue