Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions physx-sys/pxbind/src/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,9 @@ pub enum Builtin {
Mat33,
Mat34,
Mat44,
// on the C++ side, `void*`, but we want to be able to pack arbitrary data into the space
// available so we treat it as a separate type so we can do that properly in the Rust side
UserData,
}

impl Builtin {
Expand Down Expand Up @@ -758,6 +761,7 @@ impl Builtin {
Self::Mat34V => "glam::Affine3A",
Self::Mat34 => "Affine",
Self::Mat44V | Self::Mat44 => "PxMat44",
Self::UserData => "UserDataField",
}
}

Expand Down Expand Up @@ -793,6 +797,7 @@ impl Builtin {
Self::Mat34 => "physx_Mat34_Pod",
Self::Mat44V => "physx_Mat44V_Pod",
Self::Mat44 => "physx_PxMat44_Pod",
Self::UserData => "void*",
}
}

Expand Down Expand Up @@ -828,6 +833,7 @@ impl Builtin {
Self::Mat34 => "physx::PxMat34",
Self::Mat44V => "physx::PxMat44V",
Self::Mat44 => "physx::PxMat44",
Self::UserData => "void*",
}
}

Expand Down
11 changes: 8 additions & 3 deletions physx-sys/pxbind/src/consumer/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,16 +713,21 @@ impl<'ast> super::AstConsumer<'ast> {
continue;
}

let kind = self
.parse_type(kind, template_types)
.with_context(|| format!("failed to parse type for {rname}::{name}"))?;
let kind = if name == "userData" || name == "mUserData" {
QualType::Builtin(Builtin::UserData)
} else {
self
.parse_type(kind, template_types)
.with_context(|| format!("failed to parse type for {rname}::{name}"))?
};

// if matches!(&kind, QualType::FunctionPointer) {
// continue;
// }

let is_reference = matches!(kind, QualType::Reference { .. });


fields.push(FieldBinding {
name,
kind,
Expand Down
Loading