Make the query pipeline serializable.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
||||||
pub struct IntegrationParameters {
|
pub struct IntegrationParameters {
|
||||||
/// The timestep (default: `1.0 / 60.0`)
|
/// The timestep length (default: `1.0 / 60.0`)
|
||||||
dt: f32,
|
dt: f32,
|
||||||
/// The inverse of `dt`.
|
/// The inverse of `dt`.
|
||||||
inv_dt: f32,
|
inv_dt: f32,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use crate::math::{Point, Vector};
|
|||||||
use ncollide::bounding_volume::BoundingVolume;
|
use ncollide::bounding_volume::BoundingVolume;
|
||||||
|
|
||||||
/// A pipeline for performing queries on all the colliders of a scene.
|
/// A pipeline for performing queries on all the colliders of a scene.
|
||||||
|
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
||||||
pub struct QueryPipeline {
|
pub struct QueryPipeline {
|
||||||
quadtree: WQuadtree,
|
quadtree: WQuadtree,
|
||||||
tree_built: bool,
|
tree_built: bool,
|
||||||
@@ -65,7 +66,7 @@ impl QueryPipeline {
|
|||||||
// let t0 = instant::now();
|
// let t0 = instant::now();
|
||||||
let inter = self.quadtree.cast_ray(ray, max_toi);
|
let inter = self.quadtree.cast_ray(ray, max_toi);
|
||||||
// println!(
|
// println!(
|
||||||
// "Found {} interefrences in time {}.",
|
// "Found {} interferences in time {}.",
|
||||||
// inter.len(),
|
// inter.len(),
|
||||||
// instant::now() - t0
|
// instant::now() - t0
|
||||||
// );
|
// );
|
||||||
|
|||||||
@@ -261,10 +261,10 @@ impl PhysxWorld {
|
|||||||
fn setup_joints(&mut self, joints: &JointSet) {
|
fn setup_joints(&mut self, joints: &JointSet) {
|
||||||
unsafe {
|
unsafe {
|
||||||
for joint in joints.iter() {
|
for joint in joints.iter() {
|
||||||
let actor1 = self.rapier2physx[&joint.body1];
|
let actor1 = self.rapier2physx[&joint.1.body1];
|
||||||
let actor2 = self.rapier2physx[&joint.body2];
|
let actor2 = self.rapier2physx[&joint.1.body2];
|
||||||
|
|
||||||
match &joint.params {
|
match &joint.1.params {
|
||||||
JointParams::BallJoint(params) => {
|
JointParams::BallJoint(params) => {
|
||||||
let frame1 = physx::transform::gl_to_px_tf(
|
let frame1 = physx::transform::gl_to_px_tf(
|
||||||
Isometry3::new(params.local_anchor1.coords, na::zero()).into_glam(),
|
Isometry3::new(params.local_anchor1.coords, na::zero()).into_glam(),
|
||||||
|
|||||||
Reference in New Issue
Block a user