Skip to content

Commit 38f64ee

Browse files
committed
Merge branch 'vert-attrs-for-skinning' into animations
2 parents 30dea54 + 202ed1d commit 38f64ee

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

crates/bevy_render/src/mesh/mesh.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ pub const VERTEX_ATTRIBUTE_BUFFER_ID: u64 = 10;
2424
/// An array where each entry describes a property of a single vertex.
2525
#[derive(Clone, Debug)]
2626
pub enum VertexAttributeValues {
27-
Uchar4(Vec<[u8; 4]>),
28-
Ushort4(Vec<[u16; 4]>),
2927
Float(Vec<f32>),
3028
Int(Vec<i32>),
3129
Uint(Vec<u32>),
@@ -39,6 +37,7 @@ pub enum VertexAttributeValues {
3937
Int4(Vec<[i32; 4]>),
4038
Uint4(Vec<[u32; 4]>),
4139
Uchar4Norm(Vec<[u8; 4]>),
40+
Ushort4(Vec<[u16; 4]>),
4241
}
4342

4443
impl VertexAttributeValues {
@@ -61,6 +60,7 @@ impl VertexAttributeValues {
6160
VertexAttributeValues::Int4(ref values) => values.len(),
6261
VertexAttributeValues::Uint4(ref values) => values.len(),
6362
VertexAttributeValues::Uchar4Norm(ref values) => values.len(),
63+
VertexAttributeValues::Ushort4(ref values) => values.len(),
6464
}
6565
}
6666

@@ -89,6 +89,7 @@ impl VertexAttributeValues {
8989
VertexAttributeValues::Int4(values) => values.as_slice().as_bytes(),
9090
VertexAttributeValues::Uint4(values) => values.as_slice().as_bytes(),
9191
VertexAttributeValues::Uchar4Norm(values) => values.as_slice().as_bytes(),
92+
VertexAttributeValues::Ushort4(values) => values.as_slice().as_bytes(),
9293
}
9394
}
9495
}
@@ -111,6 +112,7 @@ impl From<&VertexAttributeValues> for VertexFormat {
111112
VertexAttributeValues::Int4(_) => VertexFormat::Int4,
112113
VertexAttributeValues::Uint4(_) => VertexFormat::Uint4,
113114
VertexAttributeValues::Uchar4Norm(_) => VertexFormat::Uchar4Norm,
115+
VertexAttributeValues::Ushort4(_) => VertexFormat::Ushort4,
114116
}
115117
}
116118
}
@@ -264,9 +266,9 @@ impl Mesh {
264266
pub const ATTRIBUTE_UV_0: &'static str = "Vertex_Uv";
265267

266268
/// Per vertex joint transform matrix weight. Use in conjunction with [`Mesh::set_attribute`]
267-
pub const ATTRIBUTE_WEIGHT: &'static str = "Vertex_JointWeight";
269+
pub const ATTRIBUTE_JOINT_WEIGHT: &'static str = "Vertex_JointWeight";
268270
/// Per vertex joint transform matrix index. Use in conjunction with [`Mesh::set_attribute`]
269-
pub const ATTRIBUTE_JOINT: &'static str = "Vertex_JointIndex";
271+
pub const ATTRIBUTE_JOINT_INDEX: &'static str = "Vertex_JointIndex";
270272

271273
/// Construct a new mesh. You need to provide a PrimitiveTopology so that the
272274
/// renderer knows how to treat the vertex data. Most of the time this will be

0 commit comments

Comments
 (0)