Skip to content

Commit

Permalink
add rkyv-safe-deser feature for deriving CheckBytes on Archive types
Browse files Browse the repository at this point in the history
  • Loading branch information
samlich committed Apr 5, 2023
1 parent bbb1fd1 commit 95cac1f
Show file tree
Hide file tree
Showing 41 changed files with 67 additions and 8 deletions.
3 changes: 2 additions & 1 deletion crates/parry2d-f64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dim2 = [ ]
f64 = [ ]
serde-serialize = [ "serde", "nalgebra/serde-serialize", "arrayvec/serde" ]
rkyv-serialize = [ "rkyv", "nalgebra/rkyv-serialize", "simba/rkyv-serialize" ]
rkyv-safe-deser = [ "rkyv-serialize", "rkyv/validation" ]
bytemuck-serialize = [ "bytemuck", "nalgebra/convert-bytemuck" ]
simd-stable = [ "simba/wide", "simd-is-enabled" ]
simd-nightly = [ "simba/packed_simd", "simd-is-enabled" ]
Expand Down Expand Up @@ -52,7 +53,7 @@ simba = { version = "0.8", default-features = false }
nalgebra = { version = "0.32", default-features = false, features = [ "libm" ] }
approx = { version = "0.5", default-features = false }
serde = { version = "1.0", optional = true, features = ["derive"] }
rkyv = { version = "0.7", optional = true }
rkyv = { version = "0.7.41", optional = true }
num-derive = "0.3"
indexmap = { version = "1", features = [ "serde-1" ], optional = true }
rustc-hash = { version = "1", optional = true }
Expand Down
3 changes: 2 additions & 1 deletion crates/parry2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dim2 = [ ]
f32 = [ ]
serde-serialize = [ "serde", "nalgebra/serde-serialize", "arrayvec/serde" ]
rkyv-serialize = [ "rkyv", "nalgebra/rkyv-serialize", "simba/rkyv-serialize" ]
rkyv-safe-deser = [ "rkyv-serialize", "rkyv/validation" ]
bytemuck-serialize = [ "bytemuck", "nalgebra/convert-bytemuck" ]
simd-stable = [ "simba/wide", "simd-is-enabled" ]
simd-nightly = [ "simba/packed_simd", "simd-is-enabled" ]
Expand Down Expand Up @@ -52,7 +53,7 @@ simba = { version = "0.8", default-features = false }
nalgebra = { version = "0.32", default-features = false, features = [ "libm" ] }
approx = { version = "0.5", default-features = false }
serde = { version = "1.0", optional = true, features = ["derive"] }
rkyv = { version = "0.7", optional = true }
rkyv = { version = "0.7.41", optional = true }
num-derive = "0.3"
indexmap = { version = "1", features = [ "serde-1" ], optional = true }
rustc-hash = { version = "1", optional = true }
Expand Down
3 changes: 2 additions & 1 deletion crates/parry3d-f64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dim3 = [ ]
f64 = [ ]
serde-serialize = [ "serde", "nalgebra/serde-serialize" ]
rkyv-serialize = [ "rkyv", "nalgebra/rkyv-serialize", "simba/rkyv-serialize" ]
rkyv-safe-deser = [ "rkyv-serialize", "rkyv/validation" ]
bytemuck-serialize = [ "bytemuck", "nalgebra/convert-bytemuck" ]
simd-stable = [ "simba/wide", "simd-is-enabled" ]
simd-nightly = [ "simba/packed_simd", "simd-is-enabled" ]
Expand Down Expand Up @@ -52,7 +53,7 @@ simba = { version = "0.8", default-features = false }
nalgebra = { version = "0.32", default-features = false, features = [ "libm" ] }
approx = { version = "0.5", default-features = false }
serde = { version = "1.0", optional = true, features = ["derive", "rc"]}
rkyv = { version = "0.7", optional = true }
rkyv = { version = "0.7.41", optional = true }
num-derive = "0.3"
indexmap = { version = "1", features = [ "serde-1" ], optional = true }
rustc-hash = { version = "1", optional = true }
Expand Down
3 changes: 2 additions & 1 deletion crates/parry3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dim3 = [ ]
f32 = [ ]
serde-serialize = [ "serde", "nalgebra/serde-serialize" ]
rkyv-serialize = [ "rkyv", "nalgebra/rkyv-serialize", "simba/rkyv-serialize" ]
rkyv-safe-deser = [ "rkyv-serialize", "rkyv/validation" ]
bytemuck-serialize = [ "bytemuck", "nalgebra/convert-bytemuck" ]

simd-stable = [ "simba/wide", "simd-is-enabled" ]
Expand Down Expand Up @@ -53,7 +54,7 @@ simba = { version = "0.8", default-features = false }
nalgebra = { version = "0.32", default-features = false, features = [ "libm" ] }
approx = { version = "0.5", default-features = false }
serde = { version = "1.0", optional = true, features = ["derive", "rc"]}
rkyv = { version = "0.7", optional = true }
rkyv = { version = "0.7.41", optional = true }
num-derive = "0.3"
indexmap = { version = "1", features = [ "serde-1" ], optional = true }
rustc-hash = { version = "1", optional = true }
Expand Down
1 change: 1 addition & 0 deletions src/bounding_volume/aabb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use na::ComplexField; // for .abs()
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(Debug, PartialEq, Copy, Clone)]
#[repr(C)]
Expand Down
1 change: 1 addition & 0 deletions src/bounding_volume/bounding_sphere.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use num::Zero;
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(Debug, PartialEq, Copy, Clone)]
#[repr(C)]
pub struct BoundingSphere {
Expand Down
1 change: 1 addition & 0 deletions src/bounding_volume/simd_aabb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use simba::simd::{SimdPartialOrd, SimdValue};
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub struct SimdAabb {
/// The min coordinates of the Aabbs.
Expand Down
1 change: 1 addition & 0 deletions src/mass_properties/mass_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const EPSILON: Real = f32::EPSILON as Real;
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
/// The local mass properties of a rigid-body.
pub struct MassProperties {
/// The center of mass of a rigid-body expressed in its local-space.
Expand Down
4 changes: 4 additions & 0 deletions src/partitioning/qbvh/qbvh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub type SimdNodeIndex = u32;
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
/// The index of one specific node of a Qbvh.
pub struct NodeIndex {
Expand Down Expand Up @@ -117,6 +118,7 @@ bitflags! {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
pub struct QbvhNode {
/// The Aabbs of the qbvh nodes represented by this node.
Expand Down Expand Up @@ -190,6 +192,7 @@ impl QbvhNode {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
/// Combination of a leaf data and its associated node’s index.
pub struct QbvhProxy<LeafData> {
Expand Down Expand Up @@ -230,6 +233,7 @@ impl<LeafData> QbvhProxy<LeafData> {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[repr(C)] // Needed for Cuda.
#[derive(Debug)]
pub struct GenericQbvh<LeafData, Storage: QbvhStorage<LeafData>> {
Expand Down
1 change: 1 addition & 0 deletions src/query/closest_points/closest_points.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::mem;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
pub enum ClosestPoints {
/// The two objects are intersecting.
Intersecting,
Expand Down
1 change: 1 addition & 0 deletions src/query/contact/contact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::mem;
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
pub struct Contact {
/// Position of the contact on the first object.
pub point1: Point<Real>,
Expand Down
1 change: 1 addition & 0 deletions src/query/contact_manifolds/contact_manifold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::shape::PackedFeatureId;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
/// A single contact between two shape.
pub struct TrackedContact<Data> {
/// The contact point in the local-space of the first shape.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use crate::utils::IsometryOpt;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(Clone)]
struct SubDetector {
manifold_id: usize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use crate::utils::IsometryOpt;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(Clone)]
struct SubDetector {
manifold_id: usize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use crate::query::contact_manifolds::InternalEdgesFixer;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(Clone)]
struct SubDetector {
manifold_id: usize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use crate::query::contact_manifolds::InternalEdgesFixer;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(Clone)]
struct SubDetector {
manifold_id: usize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use crate::shape::{Shape, TriMesh};
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(Clone)]
pub struct TriMeshShapeContactManifoldsWorkspace {
interferences: Vec<u32>,
Expand Down
1 change: 1 addition & 0 deletions src/query/contact_manifolds/internal_edges_fixer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::math::Real;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(Default, Clone)]
#[allow(dead_code)] // We will need these for 2D too in the future.
pub struct InternalEdgesFixer {
Expand Down
1 change: 1 addition & 0 deletions src/query/point/point_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use na;
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
pub struct PointProjection {
/// Whether or not the point to project was inside of the shape.
pub is_inside: bool,
Expand Down
2 changes: 2 additions & 0 deletions src/query/ray/ray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::shape::FeatureId;
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[repr(C)]
pub struct Ray {
Expand Down Expand Up @@ -64,6 +65,7 @@ impl Ray {
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
pub struct RayIntersection {
/// The time of impact of the ray with the object. The exact contact point can be computed
/// with: `ray.point_at(toi)` or equivalently `origin + dir * toi` where `origin` is the origin of the ray;
Expand Down
9 changes: 5 additions & 4 deletions src/shape/ball.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ use crate::shape::SupportMap;
/// A Ball shape.
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
// #[cfg_attr(
// feature = "rkyv",
// derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
// )]
#[cfg_attr(
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(PartialEq, Debug, Copy, Clone)]
#[repr(C)]
Expand Down
1 change: 1 addition & 0 deletions src/shape/capsule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use either::Either;
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[repr(C)]
/// A capsule shape defined as a round segment.
Expand Down
1 change: 1 addition & 0 deletions src/shape/cone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use na::RealField; // for .copysign()
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(PartialEq, Debug, Copy, Clone)]
#[repr(C)]
Expand Down
1 change: 1 addition & 0 deletions src/shape/convex_polygon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use na::{self, ComplexField, RealField, Unit};
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(Clone, Debug)]
pub struct ConvexPolygon {
points: Vec<Point<Real>>,
Expand Down
5 changes: 5 additions & 0 deletions src/shape/convex_polyhedron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use na::ComplexField; // for .abs()
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(PartialEq, Debug, Copy, Clone)]
pub struct Vertex {
pub first_adj_face_or_edge: u32,
Expand All @@ -27,6 +28,7 @@ pub struct Vertex {
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(PartialEq, Debug, Copy, Clone)]
pub struct Edge {
pub vertices: Point2<u32>,
Expand All @@ -51,6 +53,7 @@ impl Edge {
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(PartialEq, Debug, Copy, Clone)]
pub struct Face {
pub first_vertex_or_edge: u32,
Expand All @@ -63,6 +66,7 @@ pub struct Face {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(PartialEq, Debug, Copy, Clone)]
struct Triangle {
vertices: [u32; 3],
Expand All @@ -89,6 +93,7 @@ impl Triangle {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(PartialEq, Debug, Clone)]
/// A convex polyhedron without degenerate faces.
pub struct ConvexPolyhedron {
Expand Down
1 change: 1 addition & 0 deletions src/shape/cuboid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use na::RealField; // for .copysign()
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(PartialEq, Debug, Copy, Clone)]
#[repr(C)]
Expand Down
1 change: 1 addition & 0 deletions src/shape/cylinder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use na::RealField; // for .copysign()
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(PartialEq, Debug, Copy, Clone)]
#[repr(C)]
Expand Down
2 changes: 2 additions & 0 deletions src/shape/feature_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
pub enum FeatureId {
/// Shape-dependent identifier of a vertex.
Expand Down Expand Up @@ -62,6 +63,7 @@ impl FeatureId {
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
/// A feature id where the feature type is packed into the same value as the feature index.
pub struct PackedFeatureId(pub u32);
Expand Down
1 change: 1 addition & 0 deletions src/shape/half_space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use na::Unit;
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[repr(C)]
pub struct HalfSpace {
Expand Down
1 change: 1 addition & 0 deletions src/shape/heightfield2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl HeightFieldStorage for CudaStoragePtr {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(Debug)]
#[repr(C)] // Needed for Cuda.
/// A 2D heightfield with a generic storage buffer for its heights.
Expand Down
2 changes: 2 additions & 0 deletions src/shape/heightfield3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ bitflags! {
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize),
archive(as = "Self")
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(Default)]
/// The status of the cell of an heightfield.
Expand Down Expand Up @@ -70,6 +71,7 @@ impl HeightFieldStorage for CudaStoragePtr {
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[derive(Debug)]
#[repr(C)] // Needed for Cuda.
/// A 3D heightfield with a generic storage buffer for its height grid.
Expand Down
1 change: 1 addition & 0 deletions src/shape/polygon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use parry::bounding_volume::Aabb;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
/// A convex planar polygon.
pub struct Polygon {
pub(crate) vertices: Vec<Point<Real>>,
Expand Down
1 change: 1 addition & 0 deletions src/shape/polyline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use na::ComplexField; // for .abs()
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
/// A polyline.
pub struct Polyline {
qbvh: Qbvh<u32>,
Expand Down
1 change: 1 addition & 0 deletions src/shape/round_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use na::Unit;
feature = "rkyv",
derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)
)]
#[cfg_attr(feature = "rkyv-safe-deser", archive(check_bytes))]
#[cfg_attr(feature = "cuda", derive(cust_core::DeviceCopy))]
#[derive(Copy, Clone, Debug)]
#[repr(C)]
Expand Down
Loading

0 comments on commit 95cac1f

Please sign in to comment.